projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PPC port cleaned up, static linking works well now.
[musl]
/
configure
diff --git
a/configure
b/configure
index
93518a7
..
288d65d
100755
(executable)
--- a/
configure
+++ b/
configure
@@
-58,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" >/dev/null 2>&1
; then
printf "yes\n"
eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }"
printf "yes\n"
eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }"
@@
-72,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" >/dev/null 2>&1
; then
printf "yes\n"
eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }"
printf "yes\n"
eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }"
@@
-170,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
@@
-191,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"
#
@@
-202,6
+202,8
@@
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 ;;
+powerpc-*) ARCH=powerpc ;;
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
@@
-246,6
+248,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
#
@@
-261,8
+270,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
@@
-291,6
+300,8
@@
shared=no
# Find compiler runtime library
test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
# Find compiler runtime library
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` \
+ && tryldflag LIBCC "$try_libcc"
printf "using compiler runtime libraries: %s\n" "$LIBCC"
printf "using compiler runtime libraries: %s\n" "$LIBCC"