From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0D3D63858C83 for ; Wed, 11 Jan 2023 20:25:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D3D63858C83 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673468735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1G6bioypS8w6bW7B7Z1KnHdVMf2LvFtRs2TMIyF4XDE=; b=abjh7AI3RTAfRGMy6r69ocsfRYehyWr/4ABaoiqdikqw/Q1+/aGSXt12uCjFgNJYAu/W6E kVO/eE+c4Go+J8t78kk26l/Db6UZoxFnCikGUQ8xtq90e482FPe76ruMsoksUgRyIcoFt6 fbgnSxy0BmIE1RZgb3QypWzZoF+i8Ys= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-619-GtvUYdLaOKmpmm04nBvNDA-1; Wed, 11 Jan 2023 15:25:34 -0500 X-MC-Unique: GtvUYdLaOKmpmm04nBvNDA-1 Received: by mail-il1-f197.google.com with SMTP id o10-20020a056e02102a00b003006328df7bso11744418ilj.17 for ; Wed, 11 Jan 2023 12:25:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1G6bioypS8w6bW7B7Z1KnHdVMf2LvFtRs2TMIyF4XDE=; b=I/GltTeHjxs6Y58no7HX4wNX/wZa2takoTxOg/RAJ5RrAzBJPzt6h6dPBiVl7LkQM2 Dv6jOSAauix7keU1DixNTXDSkwN83gh7PuYO02hLyQrXbh04xFOe/oVZtFPnqLmSx+1i 87qmnA7uE9gRqgyrdNcJQgh9IVf2i/JbNfwhG4VbFxim5/jmfSKgRvwfNHxWJSUCyWrm A0CxEVOQ+e1xDp/pLKzeRsTjlQkwidnDFB+EnZdLmO3JV71oW/B5mlbVX04qr0PSxg7k 6QOVhu5g7CheEbAuIX7m2twJc9vZpu6qEbLrVL0Gfw3kuwwHvMZjxxem5daXFYvxIkyX bfsQ== X-Gm-Message-State: AFqh2kqnPK0SEJOXPxnEMvX5I2pGxLpg4lrhHQBa+4PkwSUuj5om/lBl FyV75XFXvpzo0f5VCiEHKTmJfPPYR+5lQnssCKjC5pDpfGTkt3LU77tIS+W9UmhH2JBiO/MvYyg kcb9+OQyvRU3y6R7duKq2 X-Received: by 2002:a6b:4101:0:b0:6df:e4f7:8c20 with SMTP id n1-20020a6b4101000000b006dfe4f78c20mr52268646ioa.14.1673468733578; Wed, 11 Jan 2023 12:25:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXtczv4NVZRaRhdpzEf28aoXKV3g7RZytUsajxGLZ4DCfy88ehNOWJ/vH5KDE7iONv5mrG690w== X-Received: by 2002:a6b:4101:0:b0:6df:e4f7:8c20 with SMTP id n1-20020a6b4101000000b006dfe4f78c20mr52268641ioa.14.1673468733343; Wed, 11 Jan 2023 12:25:33 -0800 (PST) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id y4-20020a056638228400b0038a416931edsm4788863jas.91.2023.01.11.12.25.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jan 2023 12:25:32 -0800 (PST) Message-ID: <2097ff19-d38a-af35-1d22-7cb2acbf2bb6@redhat.com> Date: Wed, 11 Jan 2023 15:25:31 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v2 1/3] configure: Allow user override LD, AR, OBJCOPY, and GPROF To: Adhemerval Zanella , libc-alpha@sourceware.org, Vineet Gupta , =?UTF-8?Q?Ludovic_Court=c3=a8s?= References: <20221206160243.455627-1-adhemerval.zanella@linaro.org> <20221206160243.455627-2-adhemerval.zanella@linaro.org> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20221206160243.455627-2-adhemerval.zanella@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: On 12/6/22 11:02, Adhemerval Zanella wrote: > 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 > --- > 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 OK. Override from env first, then use $CC second. > +if test -z "$AR"; then > + AR=`$CC -print-prog-name=ar` > +fi OK. Likewise. > AC_SUBST(AR) > -OBJCOPY=`$CC -print-prog-name=objcopy` > +if test -z "$OBJCOPY"; then > + OBJCOPY=`$CC -print-prog-name=objcopy` > +fi OK. Likewise. > AC_SUBST(OBJCOPY) > -GPROF=`$CC -print-prog-name=gprof` > +if test -z "$GPROF"; then > + GPROF=`$CC -print-prog-name=gprof` OK. Likewise. > +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 9292a0d3ff..887ef7b6d5 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'), OK. Cleanup bmg usage to use $CC provided tools. > 'OBJDUMP=%s' % glibc.tool_name('objdump'), > 'RANLIB=%s' % glibc.tool_name('ranlib'), > 'READELF=%s' % glibc.tool_name('readelf'), -- Cheers, Carlos.