From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12245 Path: news.gmane.org!.POSTED!not-for-mail From: Nicholas Wilson Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Use LDFLAGS when testing linker flags Date: Fri, 15 Dec 2017 12:42:21 +0000 Message-ID: References: ,<20171215043426.GI1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1513341758 4243 195.159.176.226 (15 Dec 2017 12:42:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 15 Dec 2017 12:42:38 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-12261-gllmg-musl=m.gmane.org@lists.openwall.com Fri Dec 15 13:42:34 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1ePpJx-0000qw-SH for gllmg-musl@m.gmane.org; Fri, 15 Dec 2017 13:42:33 +0100 Original-Received: (qmail 20078 invoked by uid 550); 15 Dec 2017 12:42:39 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 20057 invoked from network); 15 Dec 2017 12:42:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realvnc.onmicrosoft.com; s=selector1-realvnc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HdiFt4y82iwABY/d8MMwVn969qqq+Yc7v8wgKdIxGBA=; b=PNhQlM5JtOoph+MeaN2qgEHfxas6Q3JnV5UMg0J3raN81bkCCOGxKILGzkOp1SAwP0aEMUVSs0m8knLvBCfPbgxsk+v8BclOXBXmqwm3pPUDAKhw37NMhbr++eiJg5FkWAKWH/EJyF0StxSfoP/m77xUPlHBnUN56bhcd37uYXo= Thread-Topic: [musl] [PATCH] Use LDFLAGS when testing linker flags Thread-Index: AQHTb3S6mlSRGLsDz0GKusw8plB39aND3RAAgACCVCU= In-Reply-To: <20171215043426.GI1627@brightrain.aerifal.cx> Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=nicholas.wilson@realvnc.com; x-originating-ip: [2a02:390:a001:192:d6be:d9ff:fe9c:1892] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;HE1PR0502MB3884;6:ofwnk1GjiBO7mBKU/ZyuHA2v5WvSkrEBKocFhIJ2gm7wborM6BVrWhNjSd1qi83aEKWSfMoIx9wM1dDhku+LUJIhANJ56S5EoJxX3o4TxOHaDH3mcfhTQDgNmQiYKSEOK1ntTfsT0M7X4UOapyva+sKNgsHGbDAkaw5SI2JRJbGJWrYw1YBUn4oe5u/C/N5pY3lwUm/wB9sm8Ul3/2dRfUin8Rxglf4XgrI05XIfyZy4hqJxxjNWnHy17OjL1icHHd0sK11PJzny55zZ8ouvbmgXqYK1EBPLIQZmgYk4FB8Lte53lM6I6AMkfa63wwyylykEWMcLH8jzUEJ8PuKqjTZGSN3oYIVMonpMOAdw5Ts=;5:gh+OkMwVWGG08ypfX5G+WEec8UmxwoXEpyEItWB3AEfKo34rkzIdK+pYptlfM60VtICDOPfwuvF4JErrjUp8ZwCiSnmkiqTKak2Dfz+h8WCWL4xefIB5ODCUs0TRmOpw3f7bKZzTHapSHaOHcFXdnd6U2LHsT7/1I5r8PlxDUvY=;24:/FopOxKXnQVwCcfTg3/BRw1VdbouwkxIo3GKe7QXIYvqRwhg1AI948loczk3AYry6QX9hMTkhVBaHXlHgJHxMBJcgKDlOaVunssn4DITyYs=;7:Bca11XQ0Q1O8E6fI0IWlIO4z7pkG2xeKuPnAOAWivctGB4zQk1iO3iqbElDn+c81dUg9d+uM0IzDdJZsUlHaACgDwIv8 oy8s07TLM2Rql984ZNTYPHSzkzUSG51vu4dgXHkjy52l8DlVyUNm1ft+/kyL8McB7xrx3AXnmbkOn/GgQqdLoUS6OdNU5EW3PK x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 253dadec-2d52-40f9-4d3e-08d543b948fa x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4603075)(4627115)(201702281549075)(2017052603307);SRVR:HE1PR0502MB3884; x-ms-traffictypediagnostic: HE1PR0502MB3884: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(3231023)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123562025)(20161123564025)(20161123560025)(2016111802025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(6072148)(6043046)(201708071742011);SRVR:HE1PR0502MB3884;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:HE1PR0502MB3884; x-forefront-prvs: 05220145DE x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39840400004)(346002)(376002)(366004)(396003)(55674003)(199004)(24454002)(189003)(2900100001)(97736004)(6116002)(81166006)(1730700003)(81156014)(478600001)(8676002)(25786009)(102836003)(9686003)(5640700003)(8936002)(55016002)(53546011)(6506007)(53936002)(6436002)(6246003)(316002)(229853002)(76176011)(2906002)(86362001)(305945005)(7736002)(68736007)(7696005)(3660700001)(99286004)(2501003)(3280700002)(105586002)(33656002)(5660300001)(6916009)(106356001)(2351001)(14454004)(2950100002)(59450400001)(74316002)(5250100002)(21314002);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0502MB3884;H:HE1PR0502MB3883.eurprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: realvnc.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM X-MS-Exchange-CrossTenant-Network-Message-Id: 253dadec-2d52-40f9-4d3e-08d543b948fa X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2017 12:42:21.3917 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9ad766d3-c6a5-4458-8c58-244e7c118728 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3884 X-OriginatorOrg: realvnc.com Xref: news.gmane.org gmane.linux.lib.musl.general:12245 Archived-At: Hi Rich, On 15 December 2017 04:34, Rich Felker wrote: > I'm not sure this is a good idea. At make time, $(LDFLAGS) is applied > after the auto-added ldflags from the various "try"s. If it's applied > before when testing, the order in which things override will be > different and might cause wrong test results. > If there are flags that *need* to be passed in order for the toolchain > to work, they might belong as part of $CC rather than any *FLAGS > variable. But without seeing them it's hard to say. If this is needed > we probably need to flip around the above order, at least. It's sneaky to put some flags in $CC! That's actually how I'm bodging the l= ibcxx (C++ standard library) build at the moment. Unfortunately Musl's conf= igure script actually assumes you're not doing that. If you do "CC=3D'clang= -Wl,XXX' ./configure" then the check for whether the compiler accepts "-We= rror=3Dunused-command-line-argument" fails (because of course the linker fl= ag indeed isn't used). Given that the Clang does support that argument, it = would be good for the configure script not to detect it, which relies on no= t putting linker flags in $CC. The arguments I'm currently using are specified with "-Wl,..." to pass some= Wasm-specific linking paths. While we're developing the linker, the defaul= ts haven't all been ironed out! Ultimately I believe the goal is that the l= inker's defaults should be usable with Musl, but I think support for LDFLAG= S is a reasonable request in the meantime. The configure script already sup= ports use of LDFLAGS lower down. Thanks for your suggested improvement to put LDFLAGS at the end of the argu= ment list, so that the tested order matches the order used later. That chan= ge makes sense. I've tested it, and it works with our toolchain (the LDFLAG= S we're interested in can go in any order on the link-line). Nick