summaryrefslogtreecommitdiff
path: root/scripts/build/libc
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build/libc')
-rw-r--r--scripts/build/libc/avr-libc.sh4
-rw-r--r--scripts/build/libc/glibc.sh29
-rw-r--r--scripts/build/libc/mingw.sh4
-rw-r--r--scripts/build/libc/musl.sh4
-rw-r--r--scripts/build/libc/newlib.sh4
-rw-r--r--scripts/build/libc/none.sh4
-rw-r--r--scripts/build/libc/uClibc.sh32
7 files changed, 10 insertions, 71 deletions
diff --git a/scripts/build/libc/avr-libc.sh b/scripts/build/libc/avr-libc.sh
index b73f990..3dc91a4 100644
--- a/scripts/build/libc/avr-libc.sh
+++ b/scripts/build/libc/avr-libc.sh
@@ -18,10 +18,6 @@ do_libc_extract() {
CT_Patch "avr-libc" "${CT_LIBC_VERSION}"
}
-do_libc_check_config() {
- :
-}
-
do_libc_configure() {
CT_DoLog EXTRA "Configuring C library"
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index dcd9e15..a08ed97 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -41,10 +41,6 @@ do_libc_extract() {
CT_Popd
}
-do_libc_check_config() {
- :
-}
-
# Build and install headers and start files
do_libc_start_files() {
# Start files and Headers should be configured the same way as the
@@ -123,30 +119,9 @@ do_libc_backend() {
multi_os_dir=$( "${CT_TARGET}-gcc" -print-multi-os-directory ${multi_flags} )
multi_root=$( "${CT_TARGET}-gcc" -print-sysroot ${multi_flags} )
+ # Adjust target tuple according to CFLAGS + any GLIBC quirks
target=$( CT_DoMultilibTarget "${CT_TARGET}" ${extra_flags} )
- 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
- ;;
- # x86 quirk: architecture name is i386, but glibc expects i[4567]86 - to
- # indicate the desired optimization. If it was a multilib variant of x86_64,
- # then it targets at least NetBurst a.k.a. i786, but we'll follow arch/x86.sh
- # and set the optimization to i686. Otherwise, replace with the most
- # conservative choice, i486.
- i386-*)
- if [ "${CT_TARGET_ARCH}" = "x86_64" ]; then
- target=${target/#i386-/i686-}
- else
- target=${target/#i386-/i486-}
- fi
- ;;
- esac
-
+ target=$( CT_DoArchGlibcAdjustTuple "${target}" )
CT_DoStep INFO "Building for multilib '${multi_flags}'"
# Ensure sysroot (with suffix, if applicable) exists
diff --git a/scripts/build/libc/mingw.sh b/scripts/build/libc/mingw.sh
index 964a11d..44ca008 100644
--- a/scripts/build/libc/mingw.sh
+++ b/scripts/build/libc/mingw.sh
@@ -23,10 +23,6 @@ do_libc_extract() {
CT_Popd
}
-do_libc_check_config() {
- :
-}
-
do_set_mingw_install_prefix(){
MINGW_INSTALL_PREFIX=/usr/${CT_TARGET}
if [[ ${CT_WINAPI_VERSION} == 2* ]]; then
diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh
index e0e9c63..e31d110 100644
--- a/scripts/build/libc/musl.sh
+++ b/scripts/build/libc/musl.sh
@@ -16,10 +16,6 @@ do_libc_extract() {
CT_Patch "musl" "${CT_LIBC_VERSION}"
}
-do_libc_check_config() {
- :
-}
-
# Build and install headers and start files
do_libc_start_files() {
# Start files and Headers should be configured the same way as the
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index e70b669..d9bda06 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -38,10 +38,6 @@ do_libc_extract() {
fi
}
-do_libc_check_config() {
- :
-}
-
do_libc_start_files() {
CT_DoStep INFO "Installing C library headers & start files"
CT_DoExecLog ALL cp -a "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/newlib/libc/include/." \
diff --git a/scripts/build/libc/none.sh b/scripts/build/libc/none.sh
index d4bf7dc..8537a8e 100644
--- a/scripts/build/libc/none.sh
+++ b/scripts/build/libc/none.sh
@@ -10,10 +10,6 @@ do_libc_extract() {
:
}
-do_libc_check_config() {
- :
-}
-
do_libc_start_files() {
:
}
diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh
index edd82f6..c59d5fa 100644
--- a/scripts/build/libc/uClibc.sh
+++ b/scripts/build/libc/uClibc.sh
@@ -51,26 +51,6 @@ do_libc_extract() {
return 0
}
-# Check that uClibc has been previously configured
-do_libc_check_config() {
- CT_DoStep INFO "Checking C library configuration"
-
- # Use the default config if the user did not provide one.
- if [ -z "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then
- CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/contrib/uClibc-defconfigs/${uclibc_name}.config"
- fi
-
- if ${grep} -E '^KERNEL_SOURCE=' "${CT_LIBC_UCLIBC_CONFIG_FILE}" >/dev/null 2>&1; then
- CT_DoLog WARN "Your uClibc version refers to the kernel _sources_, which is bad."
- CT_DoLog WARN "I can't guarantee that our little hack will work. Please try to upgrade."
- fi
-
- CT_DoLog EXTRA "Manage uClibc configuration"
- manage_uClibc_config "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${CT_CONFIG_DIR}/uClibc.config"
-
- CT_EndStep
-}
-
# Build and install headers and start files
do_libc_start_files() {
# Start files and Headers should be configured the same way as the
@@ -131,12 +111,17 @@ do_libc_backend() {
${CT_LIBC_UCLIBC_VERBOSITY} \
)
- # Retrieve the config file
- CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/uClibc.config" .config
-
# Force the date of the pregen locale data, as the
# newer ones that are referenced are not available
CT_DoLog EXTRA "Applying configuration"
+
+ # Use the default config if the user did not provide one.
+ if [ -z "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then
+ CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/contrib/uClibc-defconfigs/${uclibc_name}.config"
+ fi
+
+ manage_uClibc_config "${CT_LIBC_UCLIBC_CONFIG_FILE}" .config
+
CT_DoYes | CT_DoExecLog ALL ${make} "${make_args[@]}" oldconfig
if [ "${libc_mode}" = "startfiles" ]; then
@@ -347,7 +332,6 @@ manage_uClibc_config() {
# which is the correct value of ${PREFIX}/${TARGET}.
CT_KconfigSetOption "DEVEL_PREFIX" "\"/usr/\"" "${dst}"
CT_KconfigSetOption "RUNTIME_PREFIX" "\"/\"" "${dst}"
- CT_KconfigSetOption "SHARED_LIB_LOADER_PREFIX" "\"/lib/\"" "${dst}"
CT_KconfigSetOption "KERNEL_HEADERS" "\"${CT_HEADERS_DIR}\"" "${dst}"
# Locales support