X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=configure;h=41a73b46ef7e5d1d43b68c854605d67a6aed0b9c;hb=51fc77c7c03fa0b300e9a609b18f11f0e4db065a;hp=0cff13d236f8d544b0ffe1207483a8366002e3e5;hpb=d79b27785fb2476017225b13d24e4b8d408f61c6;p=musl diff --git a/configure b/configure index 0cff13d2..41a73b46 100755 --- a/configure +++ b/configure @@ -111,6 +111,7 @@ fi CFLAGS_C99FSE= CFLAGS_AUTO= CFLAGS_MEMOPS= +CFLAGS_NOSSP= LDFLAGS_AUTO= OPTIMIZE_GLOBS= prefix=/usr/local/musl @@ -204,7 +205,7 @@ fi # musl-gcc wrapper, and for critical bug detection in some gcc versions. # printf "checking whether compiler is gcc... " -if fnmatch '*gcc\ version*' "$($CC -v 2>&1)" ; then +if fnmatch '*gcc\ version*' "$(LC_ALL=C $CC -v 2>&1)" ; then cc_is_gcc=yes else cc_is_gcc=no @@ -245,11 +246,13 @@ 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=..." ;; @@ -288,6 +291,13 @@ printf "yes\n" CFLAGS_C99FSE="$CFLAGS_C99FSE -D__may_alias__=" fi +# +# Check for options to disable stack protector, which needs to be +# disabled for a few early-bootstrap translation units. If not found, +# this is not an error; we assume the toolchain does not do ssp. +# +tryflag CFLAGS_NOSSP -fno-stack-protector + # # Check for options that may be needed to prevent the compiler from # generating self-referential versions of memcpy,, memmove, memcmp, @@ -298,12 +308,9 @@ fi tryflag CFLAGS_MEMOPS -fno-tree-loop-distribute-patterns # -# If debugging is explicitly enabled, don't auto-enable optimizations +# Enable debugging if requessted. # -if test "$debug" = yes ; then -CFLAGS_AUTO=-g -test "$optimize" = auto && optimize=no -fi +test "$debug" = yes && CFLAGS_AUTO=-g # # Possibly add a -O option to CFLAGS and select modules to optimize with @@ -409,7 +416,6 @@ tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast fi # Some patched GCC builds have these defaults messed up... -tryflag CFLAGS_AUTO -fno-stack-protector tryldflag LDFLAGS_AUTO -Wl,--hash-style=both test "$shared" = "no" || { @@ -442,6 +448,10 @@ trycppif __ARMEB__ "$t" && SUBARCH=${SUBARCH}eb trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf fi +if test "$ARCH" = "aarch64" ; then +trycppif __AARCH64EB__ "$t" && SUBARCH=${SUBARCH}_be +fi + if test "$ARCH" = "mips" ; then trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf @@ -498,27 +508,6 @@ printf "no\n" fail "$0: error: unsupported long double type" fi -# -# Check for known bug in GCC 4.9.0 that results in a broken libc. -# -if test "$cc_is_gcc" = yes ; then -printf "checking for gcc constant folding bug with weak aliases... " -echo 'static int x = 0;' > "$tmpc" -echo 'extern int y __attribute__((__weak__, __alias__("x")));' >> "$tmpc" -echo 'extern int should_appear;' >> "$tmpc" -echo 'int foo() { return y ? should_appear : 0; }' >> "$tmpc" -case "$($CC $CFLAGS_C99FSE -I./arch/$ARCH -I./include \ - $CPPFLAGS $CFLAGS_AUTO $CFLAGS -S -o - "$tmpc" 2>/dev/null)" in -*should_appear*) -printf "no\n" -;; -*) -printf "yes\n" -fail "$0: error: broken compiler; try CFLAGS=-fno-toplevel-reorder" -;; -esac -fi - printf "creating config.mak... " cmdline=$(quote "$0") @@ -544,6 +533,7 @@ CC = $CC CFLAGS = $CFLAGS_AUTO $CFLAGS CFLAGS_C99FSE = $CFLAGS_C99FSE CFLAGS_MEMOPS = $CFLAGS_MEMOPS +CFLAGS_NOSSP = $CFLAGS_NOSSP CPPFLAGS = $CPPFLAGS LDFLAGS = $LDFLAGS_AUTO $LDFLAGS CROSS_COMPILE = $CROSS_COMPILE