X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=configure;h=a2728969fe8d03f9007b764be9b79efb924e8f7b;hb=086542fb5bc88f590547147365630b9a44df223b;hp=f940af9acc9c22146a6ca34e9cb4fa34e3e077ec;hpb=f81e44a0d96c88e052e51982f9fdd6fe0a212b46;p=musl diff --git a/configure b/configure index f940af9a..a2728969 100755 --- a/configure +++ b/configure @@ -31,7 +31,6 @@ Optional features: --enable-optimize=... optimize listed components for speed over size [auto] --enable-debug build with debugging information [disabled] --enable-warnings build with recommended warnings flags [disabled] - --enable-visibility use global visibility options to optimize PIC [no] --enable-wrapper=... build given musl toolchain wrapper [auto] --disable-shared inhibit building shared library [enabled] --disable-static inhibit building static library [enabled] @@ -135,7 +134,6 @@ target= optimize=auto debug=no warnings=no -visibility=no shared=auto static=yes wrapper=auto @@ -163,9 +161,6 @@ case "$arg" in --disable-debug|--enable-debug=no) debug=no ;; --enable-warnings|--enable-warnings=yes) warnings=yes ;; --disable-warnings|--enable-warnings=no) warnings=no ;; ---enable-visibility=auto) visibility=auto ;; ---enable-visibility|--enable-visibility=yes) visibility=yes ;; ---disable-visibility|--enable-visibility=no) visibility=no ;; --enable-wrapper|--enable-wrapper=yes) wrapper=detect ;; --enable-wrapper=all) wrapper=yes ; gcc_wrapper=yes ; clang_wrapper=yes ;; --enable-wrapper=gcc) wrapper=yes ; gcc_wrapper=yes ;; @@ -177,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#*=} ;; @@ -325,8 +322,9 @@ mips64*|mipsisa64*) ARCH=mips64 ;; mips*) ARCH=mips ;; microblaze*) ARCH=microblaze ;; or1k*) ARCH=or1k ;; -powerpc64*) ARCH=powerpc64 ;; -powerpc*) ARCH=powerpc ;; +powerpc64*|ppc64*) ARCH=powerpc64 ;; +powerpc*|ppc*) ARCH=powerpc ;; +riscv64*) ARCH=riscv64 ;; sh[1-9bel-]*|sh|superh*) ARCH=sh ;; s390x*) ARCH=s390x ;; unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;; @@ -512,7 +510,7 @@ tryflag CFLAGS_AUTO -Werror=pointer-arith # parameter to stop printing warnings about LDFLAGS passed during # compiling stage and CFLAGS passed during linking stage. # -tryflag CFLAGS_AUTO -Qunused-arguments +test "$cc_family" = clang && tryflag CFLAGS_AUTO -Qunused-arguments if test "x$warnings" = xyes ; then tryflag CFLAGS_AUTO -Wall @@ -525,39 +523,6 @@ tryflag CFLAGS_AUTO -Wno-unknown-pragmas tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast fi -if test "x$visibility" = xauto ; then -# This test checks toolchain support for several things: -# - the -include option -# - the attributes/pragmas used in vis.h -# - linking code that takes the address of protected symbols -# - gcc 3.x bug that wrongly claims declarations mismatch -printf "checking whether global visibility preinclude works... " -cat > "$tmpc" </dev/null 2>&1 ; then -visibility=yes -else -visibility=no -fi -printf "%s\n" "$visibility" -fi - -if test "x$visibility" = xyes ; then -CFLAGS_AUTO="$CFLAGS_AUTO -include vis.h" -CFLAGS_AUTO="${CFLAGS_AUTO# }" -fi - # Determine if the compiler produces position-independent code (PIC) # by default. If so, we don't need to compile separate object files # for libc.a and libc.so. @@ -611,12 +576,27 @@ printf "using compiler runtime libraries: %s\n" "$LIBCC" SUBARCH= t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS" +if test "$ARCH" = "i386" ; then +printf "checking whether compiler can use ebx in PIC asm constraints... " +cat > "$tmpc" </dev/null 2>&1 ; then +printf "yes\n" +else +printf "no\n" +CFLAGS_AUTO="$CFLAGS_AUTO -DBROKEN_EBX_ASM" +fi +fi + if test "$ARCH" = "x86_64" ; then trycppif __ILP32__ "$t" && ARCH=x32 fi if test "$ARCH" = "arm" ; then if trycppif __thumb2__ "$t" ; then +tryflag CFLAGS_AUTO -mimplicit-it=always tryflag CFLAGS_AUTO -Wa,-mimplicit-it=always tryflag CFLAGS_AUTO -Wa,-mthumb fi @@ -666,6 +646,15 @@ if test "$ARCH" = "powerpc" ; then trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \ "$0: error: compiler's floating point configuration is unsupported" trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf +printf "checking whether compiler can use 'd' constraint in asm... " +echo 'double f(double x) { __asm__ ("fabs %0, %1" : "=d"(x) : "d"(x)); return x; }' > "$tmpc" +if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then +printf "yes\n" +else +printf "no\n" +CFLAGS_AUTO="$CFLAGS_AUTO -DBROKEN_PPC_D_ASM" +CFLAGS_AUTO="${CFLAGS_AUTO# }" +fi fi test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \ @@ -677,6 +666,11 @@ trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le trycppif _SOFT_FLOAT "$t" && fail "$0: error: soft-float not supported on powerpc64" fi +if test "$ARCH" = "riscv64" ; then +trycppif __riscv_float_abi_soft "$t" && SUBARCH=${SUBARCH}-sf +trycppif __riscv_float_abi_single "$t" && SUBARCH=${SUBARCH}-sp +fi + if test "$ARCH" = "sh" ; then tryflag CFLAGS_AUTO -Wa,--isa=any trycppif __BIG_ENDIAN__ "$t" && SUBARCH=${SUBARCH}eb @@ -751,6 +745,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