From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by sourceware.org (Postfix) with ESMTPS id 494FE3858D38 for ; Thu, 2 Nov 2023 17:34:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 494FE3858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=johannesthoma.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=johannesthoma.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 494FE3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=212.227.126.135 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698946454; cv=none; b=LHS7hxSawg7xLIR55LleqgcKHVwjHzc8n6BevqfTb0zh9zl4baSqyCniqdXyH8nI/KEh/MX47bgyK+yfqSG1od8vYcXgz8oKFagqR5f62Sawh/AzaD8tocMWlF6w8b5bbQSbUmFh7iNSZulPCXK0dsOjRjlHTTTIOTwQ6thx5Yk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698946454; c=relaxed/simple; bh=IpchSw/eCbQZSklesxTAT4QgiKLAMbBRitWMSGnQi2c=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=GW9FgHOgSP6VCAnX1yGOe8t6duyiwltWZS9E0Tay7E3afHCT+/nfDsMMEFxoV6/Vo3ffdu+qZuj4ex3rl6j2j259diL0qCGU3rveIvJQdTnn7R6q9T98dmXexXE8mcVDCwfzZos/+hrEuoi3/xS66j1UMWcMp+h9ka0O8FoRdRw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.43.10.15] ([62.99.137.214]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mt7Pt-1rHueJ2oKv-00tRhv; Thu, 02 Nov 2023 18:33:54 +0100 Message-ID: Date: Thu, 2 Nov 2023 18:33:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Question on statically linking with cygwin To: Jon Turney , Martin Wege , The Cygwin Mailing List References: <71e853b9-1b6c-4796-9488-b58f69c7de1e@dronecode.org.uk> From: Johannes Thoma In-Reply-To: <71e853b9-1b6c-4796-9488-b58f69c7de1e@dronecode.org.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:tZp0Aun3SFite83RCHn6LrLxVoDyukGw1tUhZAVuv2ykwXGH83P ZFuFAWeryTCwHjPQrbL5d7YFM/VYrAR5qfUaru7o5eqcDCOAZmQQpuI39nNa0GADGy/Rw4A +Dznk/7//hKkPruciaUB3EAaQRZrskpETr6YO1EYKlZ2uS2cYroccjksoUu/GSayMiNxjDx M9dRIUD5N9n5+FYdnTAWw== UI-OutboundReport: notjunk:1;M01:P0:J2+8NfCq6rQ=;V/sJDBqThqkzfO47sAzeK3PK4K3 p5Z/kQ0sJAofhjeYFFY2r6fhdym5C2lakxAp54t0g0QQjLGA7V+1Ud244kHZxLKa4DXICvrDR HcGTWd0ur5ySIHeZRYR/OYZ7gWC6NoH23aqxUNYGcW8CF/5gK/DcHg8+V2lpcDuClm9oJdbgx 0AB6N31ZpVi82TLT90UNQzBU3CctSekb5oFbbkcBgC20BrS5Ozj/5DSaZdsuK1OzAYe8s7na6 v3JdX+NQf81ZpaElHxaCuqG9xm8gfpOUNNyv6irF2HBR7ts2mdn97IX2jPkP6zwyPvvB2Pd0w 3e2l2tW9nM2nhgfXLrQThz1OB/o0WdyS1pHvEe7rqdvmwnw4/JmSLwpokFsgc2Pb04PmCzi1M ksa2LEU5wAb4SzBToB8xfTrBSVksa6H/YAMHmsUtEFbkTMQtMYFtwBWbx6WLGQeEuT/qmne9K wNPxJxyfbTc16ulfoAjeEOAeVLxtnB77a0j6jKYVxi/+JtIaeXqCoyI/Il1lLI7XFLrgV/+3i zVYM67MZYAXrXet56T8VDRk/INY/5cjRjpERWDtLuQfcOVuIktN94ZcwkEcDb3tzISACqyGCu aDwJ+njopPDra7fnqlT605fl7cPdu+ZdlaGr3LNCiN0Zw0L/f2d2wREFo/YnIYsZGrf/GUSWm yDsk+xsZzR28Y6lX6MiMlM4CSCyE6jq31n+26320MbU2j5G8u/zxFVSz2W7fvqohwoXDNKbQt iU8OC8f+311nSY931uCakvR609xq3IVnFsw2ef+4ojoRgKhCJ91OyG8apSu4bsb1A6EyQMWW9 RHm+rD6YInIJZFR+noHjvTX826vDsYX1zF5/+4hEQ0DPYGorBxXGWAR4IOnCOIeyyurlAI1Q2 wDJLTMTIEievIOg== X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Jon, Hi Martin, Thanks for your answer, comments inline: Am 16.10.23 um 17:28 schrieb Jon Turney: > On 22/09/2023 12:12, Johannes Thoma via Cygwin wrote: >> Hi Martin, >> >> Thanks for your answer, comments inline: >> >> Am 22.09.23 um 07:54 schrieb Martin Wege via Cygwin: >>> On Tue, Sep 19, 2023 at 5:24 PM Johannes Thoma via Cygwin >>> wrote: >>>> >>>> Hi, >>>> >>>> As I understood the reason for not being able to statically link >>>> the cygwin1.dll in to a binary and distribute that is because of >>>> licensing issues. >>> >>> Do you have any references for that? >> I read that in the Cygwin FAQ: >> >> https://cygwin.com/faq/faq.html#faq.programming.static-linking >> >> I read through the licensing options and IMHO linking statically >> against cygwin (which is GPL) from a program (like WinDRBD) that >> is also GPL should be allowed. But I am not a lawyer ... > > That FAQ probably needs clarifying. > > The two sentences are probably intended to be taken separately. > > So, to be clear, there are technical reasons why the cygwin DLL is not also made available as a static library. > >>>> Are there any technical issues that would make >>>> it impossible to link with cygwin statically? >>>> >>>> The reason I am asking is I am working on a GPL project >>>> (WinDRBD: https://github.com/LINBIT/windrbd) and am currently >>>> delivering the cygwin1.dll along with the binary. It would be >>>> desireable to have the cygwin1.dll statically linked (for example >>>> to avoid version clashes) instead. Is that technically possible? >>>> If necessary I am ready to compile cygwin (at least the needed >>>> files) on my own. >>> >>> Interesting. >>> But how (from a developers perspective) do you link cygwin1.dll >>> statically into a binary? >>> >> I would build my own cygwin1.lib or cygwin1.a and statically link >> against it. > > If you do work out how to do this, patches would be welcome... > You are right it is far from trivial. I am working on it, not sure now if it will be possible or how long it takes (my main project is WinDRBD, so unfortunately I cannot spend full time on getting static linking work). Right now, I can compile cygwin on my own and digged a little bit in the program startup code (lib subdir), I will keep you updated once I go along. Best regards, - Johannes