From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 135853857718 for ; Fri, 14 Apr 2023 21:51:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 135853857718 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.99,198,1677571200"; d="scan'208";a="2782468" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 14 Apr 2023 13:51:57 -0800 IronPort-SDR: /XU3QIm43kylkky5M/j9gHmQZ91mCQMkuDR1ZfUJxrrC43zAb3Yq0TuUCGnSRxPJUhWWKpL20p jUEMqnpN4uN7VR++EIz0TaajaYRSWzlmNGkX2iWd+zTef7jPpTwDNBX89+OlRUGuRuJcsEWwXi H0lnLA8F4CnFPOIg51+NL68Kkuosgm0uYuOi7Wpzu6hTiuyZjad67sZSFOK6qBmFWeFXYttOmg iIDReaqc9SbtRFSW4WFpl15sXkTuYsWYSbguSPMwMP3f250g784DE79Gh7529k0jB13URrgIoW jdw= From: Thomas Schwinge To: Mike Frysinger CC: Subject: Re: [PATCH] newlib: stop clobbering LDFLAGS with non-standard $ldflags In-Reply-To: <20220121045152.21131-1-vapier@gentoo.org> References: <20220121045152.21131-1-vapier@gentoo.org> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Fri, 14 Apr 2023 23:51:39 +0200 Message-ID: <87sfd2cetw.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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! On 2022-01-20T23:51:52-0500, Mike Frysinger wrote: > It's unclear why this was added originally, but assuming it was needed > 20 years ago, it shouldn't be explicitly required nowadays. Current > versions of autotools already take care of exporting LDFLAGS to the > Makefile as needed (things are actually getting linked). That's why > the configure diffs show LDFLAGS still here, but shifted to a diff > place in the output list. A few dirs stop exporting LDFLAGS, but > that's because they don't do any linking, only compiling, so it's > correct. > > As for the use of $ldflags instead of the standard $LDFLAGS, I can't > really explain that at all. Just use the right name so users don't > have to dig into why their setting isn't respected, and then use a > non-standard name instead. I can't comment on all that off-hand, but this change here: > Adjust the testsuite to match. > --- a/newlib/testsuite/lib/newlib.exp > +++ b/newlib/testsuite/lib/newlib.exp > @@ -66,13 +66,13 @@ proc newlib_target_compile { source dest type options= } { > [target_info needs_status_wrapper] !=3D "0" && \ > [info exists gluefile] } { > lappend options "libs=3D$gluefile" > - lappend options "ldflags=3D$wrap_flags" > + lappend options "LDFLAGS=3D$wrap_flags" > } > > if [string match $host_triplet $target_triplet] then { > if [string match "i686-pc-linux-gnu" $host_triplet] then { > lappend options "libs=3D$objdir/crt0.o -lc -lgcc" > - lappend options "ldflags=3D-nostdlib -L$objdir/.libs [newlib_in= clude_flags]" > + lappend options "LDFLAGS=3D-nostdlib -L$objdir/.libs [newlib_in= clude_flags]" > } > } ..., is that really correct? As far as I know, DejaGnu only looks for the lower-case 'ldflags' in 'options', as documented in '[...]/share/dejagnu/target.exp'. (I just noticed this while looking for something else; I don't have any toolchains exercising the code paths you've changed.) Gr=C3=BC=C3=9Fe Thomas > newlib/acinclude.m4 | 3 --- > newlib/configure | 9 +++------ > newlib/iconvdata/configure | 9 +++------ > newlib/libc/configure | 9 +++------ > newlib/libc/machine/a29k/Makefile.in | 1 - > newlib/libc/machine/a29k/configure | 4 ---- > newlib/libc/machine/aarch64/Makefile.in | 1 - > newlib/libc/machine/aarch64/configure | 4 ---- > newlib/libc/machine/amdgcn/Makefile.in | 1 - > newlib/libc/machine/amdgcn/configure | 4 ---- > newlib/libc/machine/arc/Makefile.in | 1 - > newlib/libc/machine/arc/configure | 4 ---- > newlib/libc/machine/arm/Makefile.in | 1 - > newlib/libc/machine/arm/configure | 4 ---- > newlib/libc/machine/bfin/Makefile.in | 1 - > newlib/libc/machine/bfin/configure | 4 ---- > newlib/libc/machine/configure | 9 +++------ > newlib/libc/machine/cr16/Makefile.in | 1 - > newlib/libc/machine/cr16/configure | 4 ---- > newlib/libc/machine/cris/Makefile.in | 1 - > newlib/libc/machine/cris/configure | 4 ---- > newlib/libc/machine/crx/Makefile.in | 1 - > newlib/libc/machine/crx/configure | 4 ---- > newlib/libc/machine/csky/Makefile.in | 1 - > newlib/libc/machine/csky/configure | 4 ---- > newlib/libc/machine/d10v/Makefile.in | 1 - > newlib/libc/machine/d10v/configure | 4 ---- > newlib/libc/machine/d30v/Makefile.in | 1 - > newlib/libc/machine/d30v/configure | 4 ---- > newlib/libc/machine/epiphany/Makefile.in | 1 - > newlib/libc/machine/epiphany/configure | 4 ---- > newlib/libc/machine/fr30/Makefile.in | 1 - > newlib/libc/machine/fr30/configure | 4 ---- > newlib/libc/machine/frv/Makefile.in | 1 - > newlib/libc/machine/frv/configure | 4 ---- > newlib/libc/machine/ft32/Makefile.in | 1 - > newlib/libc/machine/ft32/configure | 4 ---- > newlib/libc/machine/h8300/Makefile.in | 1 - > newlib/libc/machine/h8300/configure | 4 ---- > newlib/libc/machine/h8500/Makefile.in | 1 - > newlib/libc/machine/h8500/configure | 4 ---- > newlib/libc/machine/hppa/Makefile.in | 1 - > newlib/libc/machine/hppa/configure | 4 ---- > newlib/libc/machine/i386/configure | 9 +++------ > newlib/libc/machine/i960/Makefile.in | 1 - > newlib/libc/machine/i960/configure | 4 ---- > newlib/libc/machine/iq2000/Makefile.in | 1 - > newlib/libc/machine/iq2000/configure | 4 ---- > newlib/libc/machine/lm32/Makefile.in | 1 - > newlib/libc/machine/lm32/configure | 4 ---- > newlib/libc/machine/m32c/Makefile.in | 1 - > newlib/libc/machine/m32c/configure | 4 ---- > newlib/libc/machine/m32r/Makefile.in | 1 - > newlib/libc/machine/m32r/configure | 4 ---- > newlib/libc/machine/m68hc11/Makefile.in | 1 - > newlib/libc/machine/m68hc11/configure | 4 ---- > newlib/libc/machine/m68k/Makefile.in | 1 - > newlib/libc/machine/m68k/configure | 4 ---- > newlib/libc/machine/m88k/Makefile.in | 1 - > newlib/libc/machine/m88k/configure | 4 ---- > newlib/libc/machine/mep/Makefile.in | 1 - > newlib/libc/machine/mep/configure | 4 ---- > newlib/libc/machine/microblaze/Makefile.in | 1 - > newlib/libc/machine/microblaze/configure | 4 ---- > newlib/libc/machine/mips/Makefile.in | 1 - > newlib/libc/machine/mips/configure | 4 ---- > newlib/libc/machine/mn10200/Makefile.in | 1 - > newlib/libc/machine/mn10200/configure | 4 ---- > newlib/libc/machine/mn10300/Makefile.in | 1 - > newlib/libc/machine/mn10300/configure | 4 ---- > newlib/libc/machine/moxie/Makefile.in | 1 - > newlib/libc/machine/moxie/configure | 4 ---- > newlib/libc/machine/msp430/Makefile.in | 1 - > newlib/libc/machine/msp430/configure | 4 ---- > newlib/libc/machine/mt/Makefile.in | 1 - > newlib/libc/machine/mt/configure | 4 ---- > newlib/libc/machine/nds32/configure | 5 +---- > newlib/libc/machine/necv70/Makefile.in | 1 - > newlib/libc/machine/necv70/configure | 4 ---- > newlib/libc/machine/nios2/Makefile.in | 1 - > newlib/libc/machine/nios2/configure | 4 ---- > newlib/libc/machine/nvptx/Makefile.in | 1 - > newlib/libc/machine/nvptx/configure | 4 ---- > newlib/libc/machine/or1k/Makefile.in | 1 - > newlib/libc/machine/or1k/configure | 4 ---- > newlib/libc/machine/powerpc/Makefile.in | 1 - > newlib/libc/machine/powerpc/configure | 4 ---- > newlib/libc/machine/pru/Makefile.in | 1 - > newlib/libc/machine/pru/configure | 4 ---- > newlib/libc/machine/riscv/Makefile.in | 1 - > newlib/libc/machine/riscv/configure | 4 ---- > newlib/libc/machine/rl78/Makefile.in | 1 - > newlib/libc/machine/rl78/configure | 4 ---- > newlib/libc/machine/rx/Makefile.in | 1 - > newlib/libc/machine/rx/configure | 4 ---- > newlib/libc/machine/sh/configure | 5 +---- > newlib/libc/machine/sparc/Makefile.in | 1 - > newlib/libc/machine/sparc/configure | 4 ---- > newlib/libc/machine/spu/Makefile.in | 1 - > newlib/libc/machine/spu/configure | 4 ---- > newlib/libc/machine/tic4x/Makefile.in | 1 - > newlib/libc/machine/tic4x/configure | 4 ---- > newlib/libc/machine/tic6x/Makefile.in | 1 - > newlib/libc/machine/tic6x/configure | 4 ---- > newlib/libc/machine/tic80/Makefile.in | 1 - > newlib/libc/machine/tic80/configure | 4 ---- > newlib/libc/machine/v850/Makefile.in | 1 - > newlib/libc/machine/v850/configure | 4 ---- > newlib/libc/machine/visium/Makefile.in | 1 - > newlib/libc/machine/visium/configure | 4 ---- > newlib/libc/machine/w65/Makefile.in | 1 - > newlib/libc/machine/w65/configure | 4 ---- > newlib/libc/machine/x86_64/Makefile.in | 1 - > newlib/libc/machine/x86_64/configure | 4 ---- > newlib/libc/machine/xc16x/Makefile.in | 1 - > newlib/libc/machine/xc16x/configure | 4 ---- > newlib/libc/machine/xscale/Makefile.in | 1 - > newlib/libc/machine/xscale/configure | 4 ---- > newlib/libc/machine/xstormy16/Makefile.in | 1 - > newlib/libc/machine/xstormy16/configure | 4 ---- > newlib/libc/machine/z8k/Makefile.in | 1 - > newlib/libc/machine/z8k/configure | 4 ---- > newlib/libc/sys/a29khif/Makefile.in | 1 - > newlib/libc/sys/a29khif/configure | 4 ---- > newlib/libc/sys/amdgcn/Makefile.in | 1 - > newlib/libc/sys/amdgcn/configure | 4 ---- > newlib/libc/sys/arm/Makefile.in | 1 - > newlib/libc/sys/arm/configure | 4 ---- > newlib/libc/sys/configure | 9 +++------ > newlib/libc/sys/d10v/Makefile.in | 1 - > newlib/libc/sys/d10v/configure | 4 ---- > newlib/libc/sys/decstation/Makefile.in | 1 - > newlib/libc/sys/decstation/configure | 4 ---- > newlib/libc/sys/epiphany/Makefile.in | 1 - > newlib/libc/sys/epiphany/configure | 4 ---- > newlib/libc/sys/h8300hms/Makefile.in | 1 - > newlib/libc/sys/h8300hms/configure | 4 ---- > newlib/libc/sys/h8500hms/Makefile.in | 1 - > newlib/libc/sys/h8500hms/configure | 4 ---- > newlib/libc/sys/linux/configure | 9 +++------ > newlib/libc/sys/linux/linuxthreads/configure | 9 +++------ > newlib/libc/sys/linux/linuxthreads/machine/configure | 9 +++------ > .../libc/sys/linux/linuxthreads/machine/i386/configure | 9 +++------ > newlib/libc/sys/linux/machine/configure | 9 +++------ > newlib/libc/sys/linux/machine/i386/configure | 9 +++------ > newlib/libc/sys/m88kbug/Makefile.in | 1 - > newlib/libc/sys/m88kbug/configure | 4 ---- > newlib/libc/sys/mmixware/Makefile.in | 1 - > newlib/libc/sys/mmixware/configure | 4 ---- > newlib/libc/sys/netware/Makefile.in | 1 - > newlib/libc/sys/netware/configure | 4 ---- > newlib/libc/sys/or1k/Makefile.in | 1 - > newlib/libc/sys/or1k/configure | 4 ---- > newlib/libc/sys/phoenix/Makefile.in | 1 - > newlib/libc/sys/phoenix/configure | 4 ---- > newlib/libc/sys/phoenix/machine/Makefile.in | 1 - > newlib/libc/sys/phoenix/machine/arm/Makefile.in | 1 - > newlib/libc/sys/phoenix/machine/arm/configure | 4 ---- > newlib/libc/sys/phoenix/machine/configure | 4 ---- > newlib/libc/sys/rdos/Makefile.in | 1 - > newlib/libc/sys/rdos/configure | 4 ---- > newlib/libc/sys/rtems/Makefile.in | 1 - > newlib/libc/sys/rtems/configure | 4 ---- > newlib/libc/sys/sh/Makefile.in | 1 - > newlib/libc/sys/sh/configure | 4 ---- > newlib/libc/sys/sparc64/Makefile.in | 1 - > newlib/libc/sys/sparc64/configure | 4 ---- > newlib/libc/sys/sun4/Makefile.in | 1 - > newlib/libc/sys/sun4/configure | 4 ---- > newlib/libc/sys/sysmec/Makefile.in | 1 - > newlib/libc/sys/sysmec/configure | 4 ---- > newlib/libc/sys/sysnec810/Makefile.in | 1 - > newlib/libc/sys/sysnec810/configure | 4 ---- > newlib/libc/sys/sysnecv850/Makefile.in | 1 - > newlib/libc/sys/sysnecv850/configure | 4 ---- > newlib/libc/sys/sysvi386/Makefile.in | 1 - > newlib/libc/sys/sysvi386/configure | 4 ---- > newlib/libc/sys/sysvnecv70/Makefile.in | 1 - > newlib/libc/sys/sysvnecv70/configure | 4 ---- > newlib/libc/sys/tic80/Makefile.in | 1 - > newlib/libc/sys/tic80/configure | 4 ---- > newlib/libc/sys/tirtos/Makefile.in | 1 - > newlib/libc/sys/tirtos/configure | 4 ---- > newlib/libc/sys/w65/Makefile.in | 1 - > newlib/libc/sys/w65/configure | 4 ---- > newlib/libc/sys/z8ksim/Makefile.in | 1 - > newlib/libc/sys/z8ksim/configure | 4 ---- > newlib/libm/configure | 9 +++------ > newlib/libm/machine/aarch64/Makefile.in | 1 - > newlib/libm/machine/aarch64/configure | 4 ---- > newlib/libm/machine/arm/Makefile.in | 1 - > newlib/libm/machine/arm/configure | 4 ---- > newlib/libm/machine/configure | 9 +++------ > newlib/libm/machine/i386/configure | 9 +++------ > newlib/libm/machine/mips/Makefile.in | 1 - > newlib/libm/machine/mips/configure | 4 ---- > newlib/libm/machine/nds32/configure | 5 +---- > newlib/libm/machine/powerpc/Makefile.in | 1 - > newlib/libm/machine/powerpc/configure | 4 ---- > newlib/libm/machine/pru/Makefile.in | 1 - > newlib/libm/machine/pru/configure | 4 ---- > newlib/libm/machine/riscv/Makefile.in | 1 - > newlib/libm/machine/riscv/configure | 4 ---- > newlib/libm/machine/sparc/Makefile.in | 1 - > newlib/libm/machine/sparc/configure | 4 ---- > newlib/libm/machine/spu/Makefile.in | 1 - > newlib/libm/machine/spu/configure | 4 ---- > newlib/libm/machine/x86_64/configure | 9 +++------ > newlib/testsuite/lib/newlib.exp | 4 ++-- > 209 files changed, 53 insertions(+), 583 deletions(-) > > diff --git a/newlib/acinclude.m4 b/newlib/acinclude.m4 > index 1a5dc60dbbbd..755f6e1165f0 100644 > --- a/newlib/acinclude.m4 > +++ b/newlib/acinclude.m4 > @@ -214,9 +214,6 @@ AC_SUBST(NEWLIB_CFLAGS) > NO_INCLUDE_LIST=3D${noinclude} > AC_SUBST(NO_INCLUDE_LIST) > > -LDFLAGS=3D${ldflags} > -AC_SUBST(LDFLAGS) > - > AM_CONDITIONAL(ELIX_LEVEL_0, test x[$]{newlib_elix_level} =3D x0) > AM_CONDITIONAL(ELIX_LEVEL_1, test x[$]{newlib_elix_level} =3D x1) > AM_CONDITIONAL(ELIX_LEVEL_2, test x[$]{newlib_elix_level} =3D x2) > diff --git a/newlib/libc/sys/phoenix/machine/Makefile.in b/newlib/libc/sy= s/phoenix/machine/Makefile.in > index 76b7a6545db4..8c380bc36498 100644 > --- a/newlib/libc/sys/phoenix/machine/Makefile.in > +++ b/newlib/libc/sys/phoenix/machine/Makefile.in > @@ -187,7 +187,6 @@ INSTALL_DATA =3D @INSTALL_DATA@ > INSTALL_PROGRAM =3D @INSTALL_PROGRAM@ > INSTALL_SCRIPT =3D @INSTALL_SCRIPT@ > INSTALL_STRIP_PROGRAM =3D @INSTALL_STRIP_PROGRAM@ > -LDFLAGS =3D @LDFLAGS@ > LIBOBJS =3D @LIBOBJS@ > LIBS =3D @LIBS@ > LTLIBOBJS =3D @LTLIBOBJS@ > diff --git a/newlib/libc/sys/phoenix/machine/arm/Makefile.in b/newlib/lib= c/sys/phoenix/machine/arm/Makefile.in > index d86ce691d312..bc9ae6e26503 100644 > --- a/newlib/libc/sys/phoenix/machine/arm/Makefile.in > +++ b/newlib/libc/sys/phoenix/machine/arm/Makefile.in > @@ -202,7 +202,6 @@ INSTALL_DATA =3D @INSTALL_DATA@ > INSTALL_PROGRAM =3D @INSTALL_PROGRAM@ > INSTALL_SCRIPT =3D @INSTALL_SCRIPT@ > INSTALL_STRIP_PROGRAM =3D @INSTALL_STRIP_PROGRAM@ > -LDFLAGS =3D @LDFLAGS@ > LIBOBJS =3D @LIBOBJS@ > LIBS =3D @LIBS@ > LTLIBOBJS =3D @LTLIBOBJS@ > diff --git a/newlib/testsuite/lib/newlib.exp b/newlib/testsuite/lib/newli= b.exp > index f1df40e52618..8b43d2e5d3a0 100644 > --- a/newlib/testsuite/lib/newlib.exp > +++ b/newlib/testsuite/lib/newlib.exp > @@ -66,13 +66,13 @@ proc newlib_target_compile { source dest type options= } { > [target_info needs_status_wrapper] !=3D "0" && \ > [info exists gluefile] } { > lappend options "libs=3D$gluefile" > - lappend options "ldflags=3D$wrap_flags" > + lappend options "LDFLAGS=3D$wrap_flags" > } > > if [string match $host_triplet $target_triplet] then { > if [string match "i686-pc-linux-gnu" $host_triplet] then { > lappend options "libs=3D$objdir/crt0.o -lc -lgcc" > - lappend options "ldflags=3D-nostdlib -L$objdir/.libs [newlib_in= clude_flags]" > + lappend options "LDFLAGS=3D-nostdlib -L$objdir/.libs [newlib_in= clude_flags]" > } > } > > -- > 2.34.1 ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955