mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] configure: make AR and RANLIB customizable
Date: Wed, 3 Jul 2019 16:37:15 -0400	[thread overview]
Message-ID: <20190703203715.GA20298@brightrain.aerifal.cx> (raw)
In-Reply-To: <20190703085312.oxm3kiqjx4dmid3o@gmail.com>

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 <i@maskray.me>
> 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


  reply	other threads:[~2019-07-03 20:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 15:35 [PATCH] config.mak: add AR/RANLIB and delete ASMSUBARCH Fangrui Song
2019-05-17 16:43 ` Rich Felker
2019-07-03  8:53   ` [PATCH] configure: make AR and RANLIB customizable Fangrui Song
2019-07-03 20:37     ` Rich Felker [this message]
2019-07-04  4:38       ` Fangrui Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190703203715.GA20298@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).