From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 165473857835; Wed, 11 Jan 2023 21:09:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 165473857835 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673471384; bh=c+beBN8s4mOy10ZhJ8UVPeQxFUJ3f1ExQBQyGNrIP3o=; h=From:To:Subject:Date:From; b=dXMY1wmiSmQEevKLPZpYkq+uMtzROjgmnZrjyvIZ8CbA9XtwdAxKWFcq32Ussi3uS zWrQq55/9ZKnFX833lURMKTLD/u/7M0KrIIhpTaVVxuZNyCnn4r8gib/a0gMgANXy3 R7wWSOgIUFX++PESPrIlOYa/jMSqhImxq/0O0nu4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/main] configure: Allow user override LD, AR, OBJCOPY, and GPROF X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/main X-Git-Oldrev: 30546ac2d1d64adff07d317e3041ec0fc6e32f6d X-Git-Newrev: 2d2d7e1a8f2e62b442ae8978f0a6c17f385575c4 Message-Id: <20230111210944.165473857835@sourceware.org> Date: Wed, 11 Jan 2023 21:09:44 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2d2d7e1a8f2e62b442ae8978f0a6c17f385575c4 commit 2d2d7e1a8f2e62b442ae8978f0a6c17f385575c4 Author: Adhemerval Zanella Date: Tue Dec 6 13:02:41 2022 -0300 configure: Allow user override LD, AR, OBJCOPY, and GPROF The only way to override LD, AR, OBJCOPY, and GPROF is through --with-binutils (setting the environments variables on configure is overridden by LIBC_PROG_BINUTILS). The build-many-glibcs.py (bmg) glibcs option generates a working config, but not fully concise (some tools will be set from environment variable, while other will be set from $CC --print-prog-name). So remove the environment variable set to always use the "$CC --print-prog-name". Reviewed-by: Carlos O'Donell Diff: --- aclocal.m4 | 16 ++++++++++++---- configure | 16 ++++++++++++---- scripts/build-many-glibcs.py | 3 --- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 7ab8ac023b..cbe3c4698a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -118,12 +118,20 @@ case "$CC" in *fuse-ld=lld*) LDNAME=ld.lld;; *) LDNAME=ld;; esac -LD=`$CC -print-prog-name=$LDNAME` -AR=`$CC -print-prog-name=ar` +if test -z "$LD"; then + LD=`$CC -print-prog-name=$LDNAME` +fi +if test -z "$AR"; then + AR=`$CC -print-prog-name=ar` +fi AC_SUBST(AR) -OBJCOPY=`$CC -print-prog-name=objcopy` +if test -z "$OBJCOPY"; then + OBJCOPY=`$CC -print-prog-name=objcopy` +fi AC_SUBST(OBJCOPY) -GPROF=`$CC -print-prog-name=gprof` +if test -z "$GPROF"; then + GPROF=`$CC -print-prog-name=gprof` +fi AC_SUBST(GPROF) ]) diff --git a/configure b/configure index 62c2581cb0..8f91bb6e11 100755 --- a/configure +++ b/configure @@ -4145,12 +4145,20 @@ case "$CC" in *fuse-ld=lld*) LDNAME=ld.lld;; *) LDNAME=ld;; esac -LD=`$CC -print-prog-name=$LDNAME` -AR=`$CC -print-prog-name=ar` +if test -z "$LD"; then + LD=`$CC -print-prog-name=$LDNAME` +fi +if test -z "$AR"; then + AR=`$CC -print-prog-name=ar` +fi -OBJCOPY=`$CC -print-prog-name=objcopy` +if test -z "$OBJCOPY"; then + OBJCOPY=`$CC -print-prog-name=objcopy` +fi -GPROF=`$CC -print-prog-name=gprof` +if test -z "$GPROF"; then + GPROF=`$CC -print-prog-name=gprof` +fi diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index f23c2d374b..cb91797e76 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -1521,10 +1521,7 @@ class GlibcPolicyDefault(object): '--host=%s' % glibc.triplet, 'CC=%s' % glibc.tool_name('gcc'), 'CXX=%s' % glibc.tool_name('g++'), - 'AR=%s' % glibc.tool_name('ar'), - 'LD=%s' % glibc.tool_name('ld'), 'NM=%s' % glibc.tool_name('nm'), - 'OBJCOPY=%s' % glibc.tool_name('objcopy'), 'OBJDUMP=%s' % glibc.tool_name('objdump'), 'RANLIB=%s' % glibc.tool_name('ranlib'), 'READELF=%s' % glibc.tool_name('readelf'),