![]() |
|
Message-ID: <20250305021533.GW1827@brightrain.aerifal.cx> Date: Tue, 4 Mar 2025 21:15:34 -0500 From: Rich Felker <dalias@...c.org> To: Sertonix <sertonix@...teo.net> Cc: musl@...ts.openwall.com Subject: Re: configure: LIBCC auto detection not using {C,LD}FLAGS On Tue, Mar 04, 2025 at 10:01:09PM +0000, Sertonix wrote: > On Tue Mar 4, 2025 at 9:25 PM CET, Rich Felker wrote: > > On Tue, Mar 04, 2025 at 08:15:16PM +0000, Sertonix wrote: > >> Hi, > >> > >> I noticed that the autodetection of LIBCC doesn't use the > >> CFLAGS/LDFLAGS variables. This means that the result of the auto > >> detection might be incorrect when --sysroot is set through CFLAGS/LDFLAGS > >> and not CC. Would it be may be better to use $LDFLAGS (or similar) in > >> tryldflag? > > > > You can't put things that change the *identity* of the compiler > > toolchain in CFLAGS or LDFLAGS. --sysroot has to go as part of CC, > > defining a different compiler. > > Oh, I haven't seen such a rule before but I understand why. Is there any > any doc/spec that this is mentioned in (as a reference)? I'm not sure, but it's at least our policy and I think it makes sense. For example if configure needs to probe something about the selected CC, but it's not actually compiling or linking anything, should it use CFLAGS? LDFLAGS? Both? Neither? One good example is using an x86_64 targeting compiler to build x32 musl. It wouldn't make sense to have the option for that in CFLAGS or LDFLAGS, because it's changing what target the compiler driver is for. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.