projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use explicit visibility to optimize a few hot-path function calls
[musl]
/
configure
diff --git
a/configure
b/configure
index
4e3931c
..
327734a
100755
(executable)
--- a/
configure
+++ b/
configure
@@
-34,6
+34,7
@@
Some influential environment variables:
CC C compiler command [detected]
CFLAGS C compiler flags [-Os -pipe ...]
CROSS_COMPILE prefix for cross compiler and tools [none]
CC C compiler command [detected]
CFLAGS C compiler flags [-Os -pipe ...]
CROSS_COMPILE prefix for cross compiler and tools [none]
+ LIBCC compiler runtime library [detected]
Use these variables to override the choices made by configure.
Use these variables to override the choices made by configure.
@@
-57,7
+58,7
@@
else eval "fnmatch '*/' \"\${$1}\"" && eval "$1=\${$1%/}" ; fi
tryflag () {
printf "checking whether compiler accepts %s... " "$2"
echo "typedef int x;" > "$tmpc"
tryflag () {
printf "checking whether compiler accepts %s... " "$2"
echo "typedef int x;" > "$tmpc"
-if
"$CC"
"$2" -c -o /dev/null "$tmpc" 2>/dev/null ; then
+if
$CC
"$2" -c -o /dev/null "$tmpc" 2>/dev/null ; then
printf "yes\n"
eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }"
printf "yes\n"
eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }"
@@
-71,7
+72,7
@@
fi
tryldflag () {
printf "checking whether linker accepts %s... " "$2"
echo "typedef int x;" > "$tmpc"
tryldflag () {
printf "checking whether linker accepts %s... " "$2"
echo "typedef int x;" > "$tmpc"
-if
"$CC"
-nostdlib -shared "$2" -o /dev/null "$tmpc" 2>/dev/null ; then
+if
$CC
-nostdlib -shared "$2" -o /dev/null "$tmpc" 2>/dev/null ; then
printf "yes\n"
eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }"
printf "yes\n"
eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }"
@@
-128,6
+129,7
@@
CFLAGS=*) CFLAGS=${arg#*=} ;;
CPPFLAGS=*) CPPFLAGS=${arg#*=} ;;
LDFLAGS=*) LDFLAGS=${arg#*=} ;;
CROSS_COMPILE=*) CROSS_COMPILE=${arg#*=} ;;
CPPFLAGS=*) CPPFLAGS=${arg#*=} ;;
LDFLAGS=*) LDFLAGS=${arg#*=} ;;
CROSS_COMPILE=*) CROSS_COMPILE=${arg#*=} ;;
+LIBCC=*) LIBCC=${arg#*=} ;;
*=*) ;;
*) target=$arg ;;
esac
*=*) ;;
*) target=$arg ;;
esac
@@
-168,7
+170,7
@@
test -n "$CC" || { echo "$0: cannot find a C compiler" ; exit 1 ; }
#
if test -z "$wrapper" ; then
printf "checking whether compiler is gcc... "
#
if test -z "$wrapper" ; then
printf "checking whether compiler is gcc... "
-if fnmatch '*gcc\ version*' "$(
"$CC"
-v 2>&1)" ; then
+if fnmatch '*gcc\ version*' "$(
$CC
-v 2>&1)" ; then
echo yes
printf "checking whether to build musl-gcc wrapper... "
wrapper=yes
echo yes
printf "checking whether to build musl-gcc wrapper... "
wrapper=yes
@@
-189,7
+191,7
@@
fi
# Find the target architecture
#
printf "checking target system type... "
# Find the target architecture
#
printf "checking target system type... "
-test -n "$target" || target=$(
"$CC"
-dumpmachine 2>/dev/null) || target=unknown
+test -n "$target" || target=$(
$CC
-dumpmachine 2>/dev/null) || target=unknown
printf "%s\n" "$target"
#
printf "%s\n" "$target"
#
@@
-200,6
+202,7
@@
arm*) ARCH=arm ;;
i?86*) ARCH=i386 ;;
x86_64*) ARCH=x86_64 ;;
mips-*|mipsel-*) ARCH=mips ;;
i?86*) ARCH=i386 ;;
x86_64*) ARCH=x86_64 ;;
mips-*|mipsel-*) ARCH=mips ;;
+microblaze-*) ARCH=microblaze ;;
unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
*) fail "$0: unknown or unsupported target \"$target\"" ;;
esac
unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
*) fail "$0: unknown or unsupported target \"$target\"" ;;
esac
@@
-244,6
+247,13
@@
fi
tryflag CFLAGS_AUTO -fno-unwind-tables
tryflag CFLAGS_AUTO -fno-asynchronous-unwind-tables
tryflag CFLAGS_AUTO -fno-unwind-tables
tryflag CFLAGS_AUTO -fno-asynchronous-unwind-tables
+#
+# The GNU toolchain defaults to assuming unmarked files need an
+# executable stack, potentially exposing vulnerabilities in programs
+# linked with such object files. Fix this.
+#
+tryflag CFLAGS_AUTO -Wa,--noexecstack
+
#
# Some optimization levels add bloated alignment that hurt performance
#
#
# Some optimization levels add bloated alignment that hurt performance
#
@@
-259,8
+269,8
@@
tryflag CFLAGS_AUTO -falign-jumps=1
# work anyway (issues with atomic ops).
#
if test "$ARCH" = "i386" ; then
# work anyway (issues with atomic ops).
#
if test "$ARCH" = "i386" ; then
-fnmatch '-march=*|*\ -march=*' "$CFLAGS" || tryflag CFLAGS_AUTO -march=i486
-fnmatch '-mtune=*|*\ -mtune=*' "$CFLAGS" || tryflag CFLAGS_AUTO -mtune=generic
+fnmatch '-march=*|*\ -march=*' "$CFLAGS" || try
ld
flag CFLAGS_AUTO -march=i486
+fnmatch '-mtune=*|*\ -mtune=*' "$CFLAGS" || try
ld
flag CFLAGS_AUTO -mtune=generic
fi
if test "x$warnings" = xyes ; then
fi
if test "x$warnings" = xyes ; then
@@
-286,6
+296,10
@@
printf "warning: disabling dynamic linking support\n"
shared=no
}
shared=no
}
+# Find compiler runtime library
+test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
+test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
+printf "using compiler runtime libraries: %s\n" "$LIBCC"
printf "creating config.mak... "
printf "creating config.mak... "
@@
-309,6
+323,7
@@
CFLAGS_C99FSE = $CFLAGS_C99FSE
CPPFLAGS = $CPPFLAGS
LDFLAGS = $LDFLAGS_AUTO $LDFLAGS
CROSS_COMPILE = $CROSS_COMPILE
CPPFLAGS = $CPPFLAGS
LDFLAGS = $LDFLAGS_AUTO $LDFLAGS
CROSS_COMPILE = $CROSS_COMPILE
+LIBCC = $LIBCC
EOF
test "x$static" = xno && echo "STATIC_LIBS ="
test "x$shared" = xno && echo "SHARED_LIBS ="
EOF
test "x$static" = xno && echo "STATIC_LIBS ="
test "x$shared" = xno && echo "SHARED_LIBS ="