From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14355 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] configure: make AR and RANLIB customizable Date: Wed, 3 Jul 2019 16:37:15 -0400 Message-ID: <20190703203715.GA20298@brightrain.aerifal.cx> References: <20190517153537.teffxwvopvhs36fe@gmail.com> <20190517164342.GB23599@brightrain.aerifal.cx> <20190703085312.oxm3kiqjx4dmid3o@gmail.com> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="124193"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-14371-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 03 22:37:31 2019 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.89) (envelope-from ) id 1him0R-000W6E-Jm for gllmg-musl@m.gmane.org; Wed, 03 Jul 2019 22:37:31 +0200 Original-Received: (qmail 1982 invoked by uid 550); 3 Jul 2019 20:37:28 -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 1964 invoked from network); 3 Jul 2019 20:37:28 -0000 Content-Disposition: inline In-Reply-To: <20190703085312.oxm3kiqjx4dmid3o@gmail.com> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14355 Archived-At: On Wed, Jul 03, 2019 at 08:53:12AM +0000, Fangrui Song wrote: > New patch attached. > > > With 2 local llvm/clang patches, I am able to build musl powerpc64le with the following command: > > .../configure --target=powerpc64le AR=~/llvm/Release/bin/llvm-ar RANLIB=true CC=~/llvm/Release/bin/clang CFLAGS='-target powerpc64le-linux -mlong-double-64' LDFLAGS=-fuse-ld=lld --enable-debug > > # "-linux" in "powerpc64le-linux" is important. > # If -target powerpc64le is used instead, clang will invoke gcc instead of itself in the linker stage, which will not work. > >From 4415adea632ca0fee80e10b6cd73b590417a2266 Mon Sep 17 00:00:00 2001 > From: Fangrui Song > Date: Thu, 27 Jun 2019 08:10:04 +0000 > Subject: [PATCH] configure: make AR and RANLIB customizable > > --- > Makefile | 2 -- > configure | 4 ++++ > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index b46f8ca4..6842983b 100644 > --- a/Makefile > +++ b/Makefile > @@ -51,8 +51,6 @@ CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS) > > LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS) > > -AR = $(CROSS_COMPILE)ar > -RANLIB = $(CROSS_COMPILE)ranlib > INSTALL = $(srcdir)/tools/install.sh I think you can omit the changes to Makefile. They break running make with an existing config.mak not updated by new configure, and since the assignments are before "include config.mak", the ones from config.mak will override if present. > ARCH_INCLUDES = $(wildcard $(srcdir)/arch/$(ARCH)/bits/*.h) > diff --git a/configure b/configure > index 60e0b1fc..86801281 100755 > --- a/configure > +++ b/configure > @@ -172,6 +172,8 @@ case "$arg" in > --host=*|--target=*) target=${arg#*=} ;; > --build=*) build=${arg#*=} ;; > -* ) echo "$0: unknown option $arg" ;; > +AR=*) AR=${arg#*=} ;; > +RANLIB=*) RANLIB=${arg#*=} ;; > CC=*) CC=${arg#*=} ;; > CFLAGS=*) CFLAGS=${arg#*=} ;; > CPPFLAGS=*) CPPFLAGS=${arg#*=} ;; > @@ -734,6 +736,8 @@ cat << EOF > # This version of config.mak was generated by: > # $cmdline > # Any changes made here will be lost if configure is re-run > +AR = ${AR:-\$(CROSS_COMPILE)ar} > +RANLIB = ${RANLIB:-\$(CROSS_COMPILE)ranlib} > ARCH = $ARCH > SUBARCH = $SUBARCH > ASMSUBARCH = $ASMSUBARCH > -- > 2.22.0 > Looks ok otherwise. Would you like me to apply with the above change? Rich