mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: musl@lists.openwall.com
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH 1/2] configure: Use -print-libgcc-file-name to detect compiler runtime
Date: Wed, 15 Mar 2017 22:22:06 -0700	[thread overview]
Message-ID: <20170316052207.32412-1-raj.khem@gmail.com> (raw)

This uses compiler to provide the path to its default runtime
library libgcc/compiler-rt, when using clang we can set

CC="clang --rtlib={compiler-rt|libgcc}" and it will find
the right compiler runtime when autodetecting it

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 configure | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index c2db298c..0c670dd8 100755
--- a/configure
+++ b/configure
@@ -587,6 +587,8 @@ tryldflag LDFLAGS_AUTO -Wl,--exclude-libs=ALL
 tryldflag LDFLAGS_AUTO -Wl,-Bsymbolic-functions
 
 # Find compiler runtime library
+test -z "$LIBCC" && try_libcc=`$CC -print-libgcc-file-name 2>/dev/null` \
+                 && tryldflag LIBCC "$try_libcc"
 test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
 test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
 test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \
-- 
2.12.0



             reply	other threads:[~2017-03-16  5:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16  5:22 Khem Raj [this message]
2017-03-16  5:22 ` [PATCH 2/2] configure: Remove -lgcc_eh from LIBCC Khem Raj
2017-03-25 18:11 ` [PATCH 1/2] configure: Use -print-libgcc-file-name to detect compiler runtime Dmitry Golovin

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=20170316052207.32412-1-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --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).