summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/arch/arc.sh36
-rw-r--r--scripts/build/binutils/binutils.sh5
-rw-r--r--scripts/build/companion_tools/500-dtc.sh6
-rw-r--r--scripts/build/libc/musl.sh3
-rw-r--r--scripts/build/libc/newlib.sh5
5 files changed, 52 insertions, 3 deletions
diff --git a/scripts/build/arch/arc.sh b/scripts/build/arch/arc.sh
index b13ef0e..d15f73f 100644
--- a/scripts/build/arch/arc.sh
+++ b/scripts/build/arch/arc.sh
@@ -29,3 +29,39 @@ CT_DoArchUClibcCflags()
esac
done
}
+
+# Multilib: Adjust configure arguments for GLIBC
+# Usage: CT_DoArchGlibcAdjustConfigure <configure-args-array-name> <cflags>
+#
+# From GCC's standpoint ARC's multilib items are defined by "mcpu" values
+# which we have quite a few and for all of them might be built optimized
+# cross-toolchain.
+#
+# From Glibc's standpoint multilib is multi-ABI and so very limited
+# versions are supposed to co-exist.
+#
+# Here we force Glibc to install libraries in per-multilib folder to create
+# a universal cross-toolchain that has libs optimized for multiple CPU types.
+CT_DoArchGlibcAdjustConfigure() {
+ local -a add_args
+ local array="${1}"
+ local cflags="${2}"
+ local opt
+ local mcpu
+
+ # If building for multilib, set proper installation paths
+ if [ "${CT_MULTILIB}" = "y" ]; then
+ for opt in ${cflags}; do
+ case "${opt}" in
+ -mcpu=*)
+ mcpu="${opt#*=}"
+ add_args+=( "libc_cv_rtlddir=/lib/${mcpu}" )
+ add_args+=( "libc_cv_slibdir=/lib/${mcpu}" )
+ add_args+=( "--libdir=/usr/lib/${mcpu}" )
+ ;;
+ esac
+ done
+ fi
+
+ eval "${array}+=( \"\${add_args[@]}\" )"
+}
diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh
index 2a738de..a79bb7e 100644
--- a/scripts/build/binutils/binutils.sh
+++ b/scripts/build/binutils/binutils.sh
@@ -153,11 +153,14 @@ do_binutils_backend() {
if [ "${CT_BINUTILS_PLUGINS}" = "y" ]; then
extra_config+=( --enable-plugins )
fi
- if [ "${CT_BINUTILES_RELRO}" = "y" ]; then
+ if [ "${CT_BINUTILS_RELRO}" = "y" ]; then
extra_config+=( --enable-relro )
elif [ "${CT_BINUTILS_RELRO}" != "m" ]; then
extra_config+=( --disable-relro )
fi
+ if [ "${CT_BINUTILS_DETERMINISTIC_ARCHIVES}" = "y" ]; then
+ extra_config+=( --enable-deterministic-archives )
+ fi
if [ "${CT_BINUTILS_HAS_PKGVERSION_BUGURL}" = "y" ]; then
[ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
[ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}")
diff --git a/scripts/build/companion_tools/500-dtc.sh b/scripts/build/companion_tools/500-dtc.sh
index ce0b303..a16ff62 100644
--- a/scripts/build/companion_tools/500-dtc.sh
+++ b/scripts/build/companion_tools/500-dtc.sh
@@ -48,11 +48,17 @@ do_dtc_backend()
eval "${arg// /\\ }"
done
+ # Override PKG_CONFIG: if pkg-config is not installed, DTC's makefile
+ # misinterprets the error code and tries to enable YAML support while
+ # not linking against libyaml. NO_YAML=1 is sufficient to make the build
+ # pass; PKG_CONFIG=/bin/true just suppresses some scary error messages.
extra_opts=( \
CC="${host}-gcc" \
AR="${host}-ar" \
PREFIX="${prefix}" \
+ PKG_CONFIG=/bin/true \
NO_PYTHON=1 \
+ NO_YAML=1 \
BIN=dtc \
)
if [ -n "${CT_DTC_VERBOSE}" ]; then
diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh
index 807b3bd..05da1d4 100644
--- a/scripts/build/libc/musl.sh
+++ b/scripts/build/libc/musl.sh
@@ -98,7 +98,8 @@ musl_backend_once() {
# host : same as --target
# target : the machine musl runs on
CT_DoExecLog CFG \
- CFLAGS="${extra_cflags[*]}" \
+ CFLAGS="${CT_TARGET_CFLAGS} ${extra_cflags[*]}" \
+ LDFLAGS="${CT_TARGET_LDFLAGS}" \
CROSS_COMPILE="${CT_TARGET}-" \
${CONFIG_SHELL} \
${src_dir}/configure \
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index 95ab791..ddecdb1 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -55,7 +55,7 @@ newlib_main()
yn_args="IO_POS_ARGS:newlib-io-pos-args
IO_C99FMT:newlib-io-c99-formats
IO_LL:newlib-io-long-long
-NEWLIB_REGISTER_FINI:newlib-register-fini
+REGISTER_FINI:newlib-register-fini
NANO_MALLOC:newlib-nano-malloc
NANO_FORMATTED_IO:newlib-nano-formatted-io
ATEXIT_DYNAMIC_ALLOC:newlib-atexit-dynamic-alloc
@@ -63,7 +63,10 @@ GLOBAL_ATEXIT:newlib-global-atexit
LITE_EXIT:lite-exit
REENT_SMALL:newlib-reent-small
MULTITHREAD:newlib-multithread
+RETARGETABLE_LOCKING:newlib-retargetable-locking
WIDE_ORIENT:newlib-wide-orient
+FSEEK_OPTIMIZATION:newlib-fseek-optimization
+FVWRITE_IN_STREAMIO:newlib-fvwrite-in-streamio
UNBUF_STREAM_OPT:newlib-unbuf-stream-opt
ENABLE_TARGET_OPTSPACE:target-optspace
"