mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Fangrui Song <i@maskray.me>
To: musl@lists.openwall.com
Subject: [PATCH] config.mak: add AR/RANLIB and delete ASMSUBARCH
Date: Fri, 17 May 2019 23:35:37 +0800	[thread overview]
Message-ID: <20190517153537.teffxwvopvhs36fe@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 968 bytes --]

By default, if I specify --target=aarch64, AR=aarch64-ar is used, which is apparently not available.

With this patch, I am able to build an aarch64 musl with:

  ../configure --target=aarch64 AR=llvm-ar RANLIB=true CC=clang CFLAGS=--target=aarch64-linux-musl LDFLAGS="-fuse-ld=lld -L/path/to/aarch64/libgcc.a/and/libgcc_eh.a" --enable-debug

ASMSUBARCH is no longer in use as of commit 0f814a4e57e80d2512934820b878211e9d71c93e.

You may also delete the following line

  test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt

because compiler-rt (part of which is nearly a replacement of libgcc) is something like:

  /home/ray/llvm/Release/lib/clang/9.0.0/lib/linux/libclang_rt.builtins-x86_64.a

not libcompiler_rt.a

  % clang -print-resource-dir
  /home/ray/llvm/Release/lib/clang/9.0.0
  % clang -rtlib=compiler-rt -print-libgcc-file-name
  /home/ray/llvm/Release/lib/clang/9.0.0/lib/linux/libclang_rt.builtins-x86_64.a

BTW, I am not sure if libgcc_eh.a is needed.

[-- Attachment #2: musl.patch --]
[-- Type: text/x-diff, Size: 1336 bytes --]

From 1a9f27d0a311210829a021384eb36332bc7456d0 Mon Sep 17 00:00:00 2001
From: Fangrui Song <i@maskray.me>
Date: Fri, 17 May 2019 08:15:52 -0700
Subject: [PATCH] config.mak: add AR/RANLIB and delete ASMSUBARCH

---
 configure | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 2123ddce..2c866955 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#*=} ;;
@@ -680,11 +682,6 @@ fi
 test "$SUBARCH" \
 && printf "configured for %s variant: %s\n" "$ARCH" "$ARCH$SUBARCH"
 
-case "$ARCH$SUBARCH" in
-arm) ASMSUBARCH=el ;;
-*) ASMSUBARCH=$SUBARCH ;;
-esac
-
 #
 # Some archs (powerpc) have different possible long double formats
 # that the compiler can be configured for. The logic for whether this
@@ -728,9 +725,10 @@ 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
+RANLIB = $RANLIB
 ARCH = $ARCH
 SUBARCH = $SUBARCH
-ASMSUBARCH = $ASMSUBARCH
 srcdir = $srcdir
 prefix = $prefix
 exec_prefix = $exec_prefix
-- 
2.21.0


             reply	other threads:[~2019-05-17 15:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 15:35 Fangrui Song [this message]
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
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=20190517153537.teffxwvopvhs36fe@gmail.com \
    --to=i@maskray.me \
    --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).