aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan S. Arnold <ryan.arnold@linaro.org>2014-07-02 23:14:37 +0100
committerRyan S. Arnold <ryan.arnold@linaro.org>2014-07-02 23:57:31 +0100
commitd70c1d00f7bed22900d446530f2854dece630285 (patch)
treedae7bff165885dd5347c15cafca578a63e145723
parentdbe743b1aa1e4ec196ce2c3be5b0f156b93c4738 (diff)
Make eglibc default. The gcc.conf file shouldn't set the clibrary.
The clibrary should be set in cbuild2.sh so that it can be overridden and the values compared against expectations. This includes automatic setting of newlib for baremetal targets. Change-Id: Ifb468099162a6e48a43d82a82d5204d11348604a
-rwxr-xr-xcbuild2.sh23
-rw-r--r--config/gcc.conf5
-rw-r--r--lib/globals.sh2
-rwxr-xr-xtest.sh52
4 files changed, 59 insertions, 23 deletions
diff --git a/cbuild2.sh b/cbuild2.sh
index 2107c807..5e0a8895 100755
--- a/cbuild2.sh
+++ b/cbuild2.sh
@@ -45,16 +45,16 @@ crosscheck_clibrary_target()
local test_clibrary=$1
local test_target=$2
case ${test_target} in
- arm*-eabi|aarch64*-*elf|i686*-mingw32|x86_64*-mingw32)
- # Bare metal targets only support newlib.
- if test x"${test_clibrary}" != x"newlib"; then
- error "${test_target} is only compatible with newlib."
- return 1
- fi
- ;;
- *)
- # No specified target, or non-baremetal targets.
- ;;
+ arm*-eabi|aarch64*-*elf|*-mingw32)
+ # Bare metal targets only support newlib.
+ if test x"${test_clibrary}" != x"newlib"; then
+ error "${test_target} is only compatible with newlib."
+ return 1
+ fi
+ ;;
+ *)
+ # No specified target, or non-baremetal targets.
+ ;;
esac
return 0
}
@@ -644,7 +644,8 @@ while test $# -gt 0; do
# user might try to override this with --set libc={glibc|eglibc}
# or {glibc|eglibc}=<foo> but that will be caught elsewhere.
case ${target} in
- arm*-eabi|aarch64*-*elf|i686*-mingw32|x86_64*-mingw32)
+ arm*-eabi|aarch64*-*elf|*-mingw32)
+ echo "MARK"
clibrary="newlib"
;;
*)
diff --git a/config/gcc.conf b/config/gcc.conf
index d769eb34..d3da2856 100644
--- a/config/gcc.conf
+++ b/config/gcc.conf
@@ -65,7 +65,6 @@ if test x"${build}" != x"${target}"; then
stage1_flags="--disable-libssp --disable-libquadmath --disable-threads --without-headers --with-newlib --disable-libmudflap --disable-bootstrap --disable-decimal-float --disable-libgomp --disable-libatomic --disable-libsanitizer --disable-plugins --disable-libitm MAKEINFO=echo --enable-languages=c"
# Add platform specific flags
- clibrary="eglibc" # eglibc is still the default till glibc bugs are fixed
case ${target} in
arm-*linux-gnueabi)
default_configure_flags="${default_configure_flags} --with-fpu=neon --with-float=softfp"
@@ -86,7 +85,6 @@ if test x"${build}" != x"${target}"; then
# bare metal targets don't support threads.
arm*-eabi)
default_configure_flags="${default_configure_flags} --enable-threads=no"
- clibrary=newlib
need_qemu=yes
languages="c,c++,lto"
;;
@@ -95,7 +93,6 @@ if test x"${build}" != x"${target}"; then
default_configure_flags="${default_configure_flags} -with-arch=armv8-a" # LDFLAGS_FOR_TARGET=-static
languages="c,c++,lto"
need_qemu=yes
- clibrary=newlib
;;
aarch64*-linux-gnu)
default_configure_flags="${default_configure_flags} -with-arch=armv8-a" # LDFLAGS_FOR_TARGET=-static
@@ -107,11 +104,9 @@ if test x"${build}" != x"${target}"; then
# Cygwin doesn't support GCC plugins
# default_configure_flags="`echo ${default_configure_flags} | sed -e 's:--enable-plugin ::`"
need_qemu=no
- clibrary=newlib
;;
*)
default_configure_flags="${default_configure_flags}"
- clibrary=newlib
need_qemu=no
;;
esac
diff --git a/lib/globals.sh b/lib/globals.sh
index 590323b5..edda8918 100644
--- a/lib/globals.sh
+++ b/lib/globals.sh
@@ -28,7 +28,7 @@ gcc="`which gcc`"
host_gcc_version="`${gcc} -v 2>&1 | tail -1`"
binutils="default"
# This is the default clibrary and can be overridden on the command line.
-clibrary="glibc"
+clibrary="eglibc"
snapshots="default"
configfile="default"
dbuser="default"
diff --git a/test.sh b/test.sh
index 591a5207..c9a1a80c 100755
--- a/test.sh
+++ b/test.sh
@@ -278,12 +278,6 @@ cb_commands="--dryrun --target arm-none-linux-gnueabihf --checkout all"
match=''
test_pass "${cb_commands}" "${match}"
-libc="glibc"
-target="aarch64-none-elf"
-cb_commands="--target ${target} --set libc=${libc}"
-match="crosscheck_clibrary_target"
-test_failure "${cb_commands}" "${match}"
-
cb_commands="--set=libc=glibc"
match="A space is expected"
test_failure "${cb_commands}" "${match}"
@@ -325,6 +319,52 @@ match=''
test_pass "${cb_commands}" "${match}"
target="aarch64-none-elf"
+# A baremetal target should pick the right clibrary (newlib)
+cb_commands="--target ${target} --dump"
+match='newlib'
+test_pass "${cb_commands}" "${match}"
+
+target="armeb-none-linux-gnueabihf"
+# A baremetal target should pick the right clibrary (newlib)
+cb_commands="--target ${target} --dump"
+match='eglibc'
+test_pass "${cb_commands}" "${match}"
+
+target="armeb-linux-gnueabihf"
+# A baremetal target should pick the right clibrary (newlib)
+cb_commands="--target ${target} --dump"
+match='eglibc'
+test_pass "${cb_commands}" "${match}"
+
+target="armeb-none-linux-gnueabi"
+cb_commands="--target ${target} --dump"
+match='eglibc'
+test_pass "${cb_commands}" "${match}"
+
+target="armeb-linux-gnueabi"
+cb_commands="--target ${target} --dump"
+match='eglibc'
+test_pass "${cb_commands}" "${match}"
+
+target="armeb-none-linux-gnueabi"
+# A baremetal target should pick the right clibrary (newlib)
+cb_commands="--target ${target} --dump"
+match='eglibc'
+test_pass "${cb_commands}" "${match}"
+
+target="armeb-none-eabi"
+# A baremetal target should pick the right clibrary (newlib)
+cb_commands="--target ${target} --dump"
+match='newlib'
+test_pass "${cb_commands}" "${match}"
+
+target="arm-none-eabi"
+# A baremetal target should pick the right clibrary (newlib)
+cb_commands="--target ${target} --dump"
+match='newlib'
+test_pass "${cb_commands}" "${match}"
+
+target="aarch64-none-elf"
libc="newlib"
cb_commands="--target ${target} --set libc=${libc}"
match=''