summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBryan Hundven <bryanhundven@gmail.com>2016-05-13 03:34:42 (GMT)
committerBryan Hundven <bryanhundven@gmail.com>2016-05-13 03:34:42 (GMT)
commitcd39285ff8247ad4b69e3143bfd16a47c0743fb0 (patch)
tree3ae728d11287459f4ddeb22251853279c8925f53 /scripts
parentcd6274dcadaf721cc7122d1f3a42f7c745d5474d (diff)
parent2162cbbdb7a425505e66f8b65f134c33302324f4 (diff)
Merge pull request #373 from stilor/unbreak-ppc-uclibc
Unbreak samples
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/debug/300-gdb.sh34
-rw-r--r--scripts/build/libc/glibc.sh19
-rw-r--r--scripts/crosstool-NG.sh.in2
3 files changed, 44 insertions, 11 deletions
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index 418e85c..ee4753e 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -69,7 +69,11 @@ do_debug_gdb_build() {
cross_extra_config=("${extra_config[@]}")
cross_extra_config+=("--with-expat")
- cross_extra_config+=("--with-libexpat-prefix=${CT_HOST_COMPLIBS_DIR}")
+ # NOTE: DO NOT USE --with-libexpat-prefix (until GDB configure is smarter)!!!
+ # It conflicts with a static build: GDB's configure script will find the shared
+ # version of expat and will attempt to link that, despite the -static flag.
+ # The link will fail, and configure will abort with "expat missing or unusable"
+ # message.
case "${CT_THREADS}" in
none) cross_extra_config+=("--disable-threads");;
*) cross_extra_config+=("--enable-threads");;
@@ -88,17 +92,24 @@ do_debug_gdb_build() {
cross_extra_config+=("--disable-nls")
fi
- CC_for_gdb=
- LD_for_gdb=
+ CC_for_gdb="${CT_HOST}-gcc ${CT_CFLAGS_FOR_HOST} ${CT_LDFLAGS_FOR_HOST}"
+ LD_for_gdb="${CT_HOST}-ld ${CT_LDFLAGS_FOR_HOST}"
if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then
- CC_for_gdb="${CT_HOST}-gcc -static"
- LD_for_gdb="${CT_HOST}-ld -static"
+ CC_for_gdb+=" -static"
+ LD_for_gdb+=" -static"
fi
- # Disable binutils options when building from the binutils-gdb repo.
- cross_extra_config+=("--disable-binutils")
- cross_extra_config+=("--disable-ld")
- cross_extra_config+=("--disable-gas")
+ # Fix up whitespace. Some older GDB releases (e.g. 6.8a) get confused if there
+ # are multiple consecutive spaces: sub-configure scripts replace them with a
+ # single space and then complain that $CC value changed from that in
+ # the master directory.
+ CC_for_gdb=`echo $CC_for_gdb`
+ LD_for_gdb=`echo $LD_for_gdb`
+
+ # Disable binutils options when building from the binutils-gdb repo.
+ cross_extra_config+=("--disable-binutils")
+ cross_extra_config+=("--disable-ld")
+ cross_extra_config+=("--disable-gas")
CT_DoLog DEBUG "Extra config passed: '${cross_extra_config[*]}'"
@@ -162,6 +173,11 @@ do_debug_gdb_build() {
fi
native_extra_config+=("--with-expat")
+ # NOTE: DO NOT USE --with-libexpat-prefix (until GDB configure is smarter)!!!
+ # It conflicts with a static build: GDB's configure script will find the shared
+ # version of expat and will attempt to link that, despite the -static flag.
+ # The link will fail, and configure will abort with "expat missing or unusable"
+ # message.
CT_DoLog EXTRA "Configuring native gdb"
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 0a09cbd..013c6eb 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -73,6 +73,7 @@ do_libc_backend() {
local multi_dir
local multi_flags
local extra_dir
+ local target
local libc_headers libc_startfiles libc_full
local hdr
local arg
@@ -136,11 +137,24 @@ do_libc_backend() {
CT_mkdir_pushd "${CT_BUILD_DIR}/build-libc-${libc_mode}${extra_dir//\//_}"
+ target=${CT_TARGET}
+ case "${target}" in
+ # SPARC quirk: glibc 2.23 and newer dropped support for SPARCv8 and
+ # earlier (corresponding pthread barrier code is missing). Until this
+ # support is reintroduced, configure as sparcv9.
+ sparc-*)
+ if [ "${CT_LIBC_GLIBC_2_23_or_later}" = y ]; then
+ target=${target/#sparc-/sparcv9-}
+ fi
+ ;;
+ esac
+
do_libc_backend_once extra_dir="${extra_dir}" \
extra_flags="${extra_flags}" \
libc_headers="${libc_headers}" \
libc_startfiles="${libc_startfiles}" \
- libc_full="${libc_full}"
+ libc_full="${libc_full}" \
+ target="${target}"
CT_Popd
@@ -192,6 +206,7 @@ do_libc_backend_once() {
local glibc_cflags
local float_extra
local endian_extra
+ local target
local arg
for arg in "$@"; do
@@ -341,7 +356,7 @@ do_libc_backend_once() {
"${src_dir}/configure" \
--prefix=/usr \
--build=${CT_BUILD} \
- --host=${CT_TARGET} \
+ --host=${target} \
--cache-file="$(pwd)/config.cache" \
--without-cvs \
--disable-profile \
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index 9297e3b..3c193c3 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -509,6 +509,8 @@ if [ -z "${CT_RESTART}" ]; then
CT_CFLAGS_FOR_HOST+=" ${CT_EXTRA_CFLAGS_FOR_HOST}"
CT_LDFLAGS_FOR_HOST=
CT_LDFLAGS_FOR_HOST+=" ${CT_EXTRA_LDFLAGS_FOR_HOST}"
+ CT_CFLAGS_FOR_HOST+=" -I${CT_HOST_COMPLIBS_DIR}/include"
+ CT_LDFLAGS_FOR_HOST+=" -L${CT_HOST_COMPLIBS_DIR}/lib"
CT_DoLog DEBUG "CFLAGS for host compiler: '${CT_CFLAGS_FOR_HOST}'"
CT_DoLog DEBUG "LDFLAGS for host compiler: '${CT_LDFLAGS_FOR_HOST}'"