From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9175 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] fix wrapper auto detection in configure Date: Fri, 22 Jan 2016 22:56:03 +0100 Message-ID: <20160122215603.GG9621@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1453499784 2127 80.91.229.3 (22 Jan 2016 21:56:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Jan 2016 21:56:24 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9188-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jan 22 22:56:24 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aMjgt-0002JF-2X for gllmg-musl@m.gmane.org; Fri, 22 Jan 2016 22:56:23 +0100 Original-Received: (qmail 28545 invoked by uid 550); 22 Jan 2016 21:56:19 -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 28504 invoked from network); 22 Jan 2016 21:56:15 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:9175 Archived-At: the libc header based test is wrong if there are no such headers on the system only a free standing cc, which should be enough for a musl build. check for *-musl* in the target triplet instead. --- configure | 60 ++++++++++++++++++++++++++++-------------------------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/configure b/configure index 5b97f71..a629290 100755 --- a/configure +++ b/configure @@ -255,15 +255,38 @@ fi echo "$cc_family" # +# Find the target architecture +# +printf "checking target system type... " +test -n "$target" || target=$($CC -dumpmachine 2>/dev/null) || target=unknown +printf "%s\n" "$target" + +# +# Convert to just ARCH +# +case "$target" in +# Catch these early to simplify matching for 32-bit archs +mips64*|powerpc64*) fail "$0: unsupported target \"$target\"" ;; +arm*) ARCH=arm ;; +aarch64*) ARCH=aarch64 ;; +i?86*) ARCH=i386 ;; +x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;; +x86_64*) ARCH=x86_64 ;; +mips*) ARCH=mips ;; +microblaze*) ARCH=microblaze ;; +or1k*) ARCH=or1k ;; +powerpc*) ARCH=powerpc ;; +sh[1-9bel-]*|sh|superh*) ARCH=sh ;; +unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;; +*) fail "$0: unknown or unsupported target \"$target\"" ;; +esac + +# # Figure out toolchain wrapper to build # if test "$wrapper" = auto -o "$wrapper" = detect ; then -echo "#include " > "$tmpc" -echo "#if ! __GLIBC__" >> "$tmpc" -echo "#error no" >> "$tmpc" -echo "#endif" >> "$tmpc" printf "checking for toolchain wrapper to build... " -if test "$wrapper" = auto && ! $CC -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then +if test "$wrapper" = auto && fnmatch '*-musl*' "$target" ; then echo "none" elif test "$cc_family" = gcc ; then gcc_wrapper=yes @@ -288,33 +311,6 @@ tools="$tools obj/musl-clang obj/ld.musl-clang" fi # -# Find the target architecture -# -printf "checking target system type... " -test -n "$target" || target=$($CC -dumpmachine 2>/dev/null) || target=unknown -printf "%s\n" "$target" - -# -# Convert to just ARCH -# -case "$target" in -# Catch these early to simplify matching for 32-bit archs -mips64*|powerpc64*) fail "$0: unsupported target \"$target\"" ;; -arm*) ARCH=arm ;; -aarch64*) ARCH=aarch64 ;; -i?86*) ARCH=i386 ;; -x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;; -x86_64*) ARCH=x86_64 ;; -mips*) ARCH=mips ;; -microblaze*) ARCH=microblaze ;; -or1k*) ARCH=or1k ;; -powerpc*) ARCH=powerpc ;; -sh[1-9bel-]*|sh|superh*) ARCH=sh ;; -unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;; -*) fail "$0: unknown or unsupported target \"$target\"" ;; -esac - -# # Try to get a conforming C99 freestanding environment # tryflag CFLAGS_C99FSE -std=c99 -- 2.7.0