X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02E863857C69 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1608395960; bh=l5eEPo6b8iDE/mkNmcRAsokTGBAxtdlJMz8NE+8TwLU=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Ca3ZFwq1g1Ce/WEMijzLM21E4GNB4QI8WuVFwMNQ2JpJLa6LtrpdzEnkCJ3cAM8o3 Sx05EpsewdM9Qb1dMWG76oE8qffymXGCTR5javSQlJKhi7vgyPkao6IghzmFXlmA/8 V116rjWuHjFl3gn+jghZshq90i+wZ2k9uY2SW4FY= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 104AF3858004 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=grEakPJ3q38e/aJd7gOynvO6xp17XJGlQaZGOmYC+epxjUlU9rQLF8J8GZ8L4n1T+2SnxZdW8l1wjEmzijYa4ciFUY9qC5hI4Icby1hZXYUGyG4JPjTK7mDRob4XpaIeKdSFdW8D3hZdfqRK2vbJKcWuHLFZDusCSOGEPttGmLD4oEi3iMxA4dTb7fZYbRPS09fVu1qAcNh6LTnZwsucF8uzRu9eyMew7WrjKNQq2htFl7K9qkaP2IBpI83MSz3q8DlZ8d4dreE3WQ2ham9tF6rAA+vhPLPdt31ToQefRaFBTpNaHDqbTebHYH5nWj0EQfM0BsGd2w++my4n3jhFSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9vERaulGv2Oh//bNWCv29MC4x9Zeclio3vUrkAE5R+k=; b=HNG+3Sb9l3C7pjXd5Q0857zLyz+DnhDLxZieTjxbCHIC1JgfRXmRJi+F20mn2x1pk1fhTQBpUjAw6AQwIOp+KviaUINJInGV4BxA7ANpsZQtljHIzkY6Dlzi+WZVAjbD+ynurHOFXlPa6+bWJbpLIrM7WadHNNkPY29lIvBZc3yMpUYXPQf52NGOs8Vw7sqUp5VCAWluqWaG1RggyGAg3xtAmKur27/9VWRrhuK6v90dNsNcD/C2Y0kvF0+FLdXJhDnLzkAgFCHbmmF/PFRHCd5S1diltjqEzoeHKIiRpivsAipOXj6fAx3GZChqgIfe+G5bPc8yNOfw75eoD6oDTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none Subject: Re: why does i686-w64-mingw32-gcc -static fail? To: cygwin AT cygwin DOT com References: <73846a6f-a908-f135-69ec-bc1eeb5b145c AT SystematicSw DOT ab DOT ca> Message-ID: <707899e0-4252-11e1-a0ee-7b7056e911f7@cornell.edu> Date: Sat, 19 Dec 2020 11:39:14 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 In-Reply-To: Content-Language: en-US X-Originating-IP: [65.112.130.200] X-ClientProxiedBy: BN6PR11CA0008.namprd11.prod.outlook.com (2603:10b6:405:2::18) To MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.13.22.3] (65.112.130.200) by BN6PR11CA0008.namprd11.prod.outlook.com (2603:10b6:405:2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.28 via Frontend Transport; Sat, 19 Dec 2020 16:39:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8cd4e64d-ea0a-4dcd-5bfa-08d8a43c9f5c X-MS-TrafficTypeDiagnostic: MN2PR04MB5664: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I8qCjICcGNYi6xu9rqzSCpnEmTBp+7MynyAVe408YGolusv3zs8t8LaEW9MyP/qONodPAB57S9Js/SpzSbNF0unfHIIDTZ5tThTb5+bGO+S9DlQKxoQBhMdsTtOt003d3QRX3rmZ7GEJxW05zIOuhRe37+v8ZsrEC+q6KnegHNdeqg2MMXWSQ7yaDG52pFCNnAuKOQRlts8mzISa2T4f0clvF3ZEmTDbgcN/3BPhe+Y/ZUVMO7kgAo+gbvCWMbEK60imYJbTz0qyEVmPo0rQoG24WYpMOtiP+cxWaOtDrn0GbGUb3IloEhnKcX5UoXN02h37mlqbaPY+rKRmvnrHoEWvN1Z+vIZ0VWO3++1v4x97gMnvLfURQqXFAIkK7GvOuJjvQXwn7JmTy4EfBtJ5EC65MYCYm6nCRwHVEQGQ05acCIjUCqp2kPQMeLbklC8sPiy/Mjtkq485PflVXUGesNMgmPsenW4WzOmvGmW2TQC/7H+0ElZrNWY8VUC2PpUF1ZUE0MMcgzUOR7RXGX4Dj405FwPbXCGQMW9uuVBqncQVCXtY/aLbn39OX2jC9gCg+uqcWUvnu+TwoFtRQAym9A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR04MB6176.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(39860400002)(366004)(136003)(376002)(396003)(16526019)(966005)(6916009)(8936002)(31686004)(956004)(36756003)(6486002)(52116002)(75432002)(8676002)(26005)(31696002)(478600001)(186003)(2616005)(66556008)(66476007)(16576012)(66946007)(316002)(4001150100001)(786003)(53546011)(5660300002)(2906002)(83380400001)(86362001)(43740500002)(45980500001)(460985005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?Windows-1252?Q?Vnc2Ebc0uWjtsbG1KX7sO9v79gN7xFLFIu96ub5W+TIcIANs6MQERs3m?= =?Windows-1252?Q?TtkOqamCAbWzP/xJp0s4J6qVhEoAe46osEMGJG9bmi+ugI1CwOIhdh4q?= =?Windows-1252?Q?8p4NhAANtPI52gQp1BrU257/ZfUdxTUqLD561zXQfu3chBT6ftmMFvxo?= =?Windows-1252?Q?GIzRIHm/Egzg4KeRugCr/NfkaodhkfmWHKdK62H1pgWfLh1IdWmvoj43?= =?Windows-1252?Q?bH6IKKg1GPuqFQF/ZzVtiKJFuuVGi5Xm+jNOZKOmyU0aX2OmQcu16tfe?= =?Windows-1252?Q?NZ9L0Da3OspBVzW/HO9CDOhAExSQwR1mVz1vTNqS916l6XOULxcAqJy9?= =?Windows-1252?Q?maPDFvmgABkzJNCTHHPLDviTZWiKDqPKE9+muARyLC1nPOcDLnqFxbN7?= =?Windows-1252?Q?tm3akhvSrum0J5x/udbqR/aU+EQldv94AEcMvKJasUCqOZZ9P+v5dtdP?= =?Windows-1252?Q?G8ZrTe5cD1CgQcC3lfbQjNzV9g0dKPeHl34z/8FaUdS/hDvFoqkER3P/?= =?Windows-1252?Q?UjNaSOVVLdVardTd9iist6xNRdwuNab7wO8qiPX/oDPcQx60KH9okM7B?= =?Windows-1252?Q?/HQCaq1eAgSIh+mYJBA0JEgKm7gNNzOEuXYQHHbCTEi9ptn64bvSnaeV?= =?Windows-1252?Q?RyjHue4KhmNy1MGb6zJDZB7AFEOD4OzkgnpplL/u4+30nfCbOky4O0KT?= =?Windows-1252?Q?ML8uKTW9qJ0dkmwDfKezGtn1F1hPIvx5pLVKXH90d9wwvyt8js6o2e7Z?= =?Windows-1252?Q?emr5yHkggqpi6DQvfZYQwr/DroY758OcegPCwMyQ1KRXjk1uMLZdnbPx?= =?Windows-1252?Q?cJVixL9f/5C7bDmvIdGraTxdPC90kHET5ryc25DWoyzytgTQLsL/3nWQ?= =?Windows-1252?Q?IdbUeZd8DX8Tin/Lfb0CUaMvZaAs3xPfxQs6WmxzFaerT0+luDav2ukn?= =?Windows-1252?Q?6PK5hIhxm9Dc6pfUKXB9IsvvxyNF11tFHPo/4vObhfKs8Qn45UmPNF3D?= =?Windows-1252?Q?jQUlc7Qw5Tl829gKhyezqmNDA5pED1Z8fhLnda83wgGykQ9HsfgjGzS+?= =?Windows-1252?Q?v/AH6dl1JocNDzwM?= X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2020 16:39:15.0469 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1 X-MS-Exchange-CrossTenant-Network-Message-Id: 8cd4e64d-ea0a-4dcd-5bfa-08d8a43c9f5c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wSHOIU+TfH0p/iN0hvnZGacDUtV6DBDMMFhPV+05VGd+CzUBzh4WwYGb4k6ggjlni/JKqU4WE6HqSLpqizsYYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5664 X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Ken Brown via Cygwin Reply-To: Ken Brown Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" On 12/19/2020 2:37 AM, Lee via Cygwin wrote: > On 12/18/20, Brian Inglis wrote: >> On 2020-12-17 20:45, Lee via Cygwin wrote: >>> Would someone please explain why adding "-static" makes >>> i686-w64-mingw32-gcc fail? >>> >>> This works (or at least the compiler doesn't complain) >>> >>> $ i686-w64-mingw32-gcc -o a.exe conftest-pcre.c -lpcreposix >>> -lpcre >>> >>> This does not work >>> >>> $ i686-w64-mingw32-gcc -o a.exe -static conftest-pcre.c -lpcreposix >>> -lpcre >>> /usr/lib/gcc/i686-w64-mingw32/10/../../../../i686-w64-mingw32/bin/ld: >>> cannot find -lpcreposix >>> /usr/lib/gcc/i686-w64-mingw32/10/../../../../i686-w64-mingw32/bin/ld: >>> cannot find -lpcre >>> collect2: error: ld returned 1 exit status >>> >>> Why does adding "-static" make it fail? >> >> Because the mingw64-*86*-pcre/2 packages provide only dynamic libraries and >> their linkage archives: > <.. snip list of libpcre*.dll and .dll.a files ..> >> where others provide both dynamic and static libraries e.g. >> mingw64-i686-zstd: >> >> usr/i686-w64-mingw32/sys-root/mingw/bin/libzstd-1.dll >> usr/i686-w64-mingw32/sys-root/mingw/lib/libzstd.a >> usr/i686-w64-mingw32/sys-root/mingw/lib/libzstd.dll.a >> >> possibly where the size of useful library members are reasonably small >> enough, >> and unlikely to need significantly updated, to be statically linked into an >> standalone executable or embedded system component, that itself may be >> regularly >> updated, rather than requiring large chunks of a framework to be linked that >> may need regular updates. > > Thanks for the explanation :) > > I went looking to see how the mingw pcre package was built and ended up here: > https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/mingw64-i686-pcre.git;a=summary > > If that's correct and the latest then it looks to be a bit out of > date; the current release is 8.44 > https://ftp.pcre.org/pub/pcre/ The maintainer has retired from Cygwin package maintenance, so it's not likely to be updated until someone volunteers to take over. > Looking at the latest cygport info > https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/mingw64-i686-pcre.git;a=blob;f=mingw64-i686-pcre.cygport;h=7456c41e6c45aad8403303aee413144fcf5d1b58;hb=3200774765aabbdda5cf4e5e9934c3d25e6e7196 > > and going off the current pcre doc included with the 8.44 tarball: > The Autotools PCRE building process uses libtool to build both shared > and static libraries by default. You can suppress one of these by > adding one of > > --disable-shared > --disable-static > > to the configure command, as required. > > The cygport info doesn't have "--disable-static" so maybe not having > static libraries wasn't an intentional omission?? No, it's intentional. cygport itself supplies "--disable-static". See /usr/share/cygport/cygclass/autotools.cygclass:715: confargs+=" --enable-shared --disable-static" The cygport user (i.e., the package maintainer) would have to add "--enable-static" to override this. Ken -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple