aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/arch/bpf.sh7
-rw-r--r--scripts/build/arch/loongarch.sh5
-rw-r--r--scripts/build/binutils/binutils.sh5
-rw-r--r--scripts/build/cc/gcc.sh51
-rw-r--r--scripts/build/companion_libs/050-zlib.sh4
-rw-r--r--scripts/build/companion_libs/100-gmp.sh6
-rw-r--r--scripts/build/companion_libs/110-mpfr.sh14
-rw-r--r--scripts/build/companion_libs/121-isl.sh4
-rw-r--r--scripts/build/companion_libs/130-cloog.sh4
-rw-r--r--scripts/build/companion_libs/140-mpc.sh12
-rw-r--r--scripts/build/libc/glibc.sh6
-rwxr-xr-xscripts/config.guess56
-rwxr-xr-xscripts/config.sub45
-rw-r--r--scripts/crosstool-NG.sh10
-rw-r--r--scripts/functions5
15 files changed, 179 insertions, 55 deletions
diff --git a/scripts/build/arch/bpf.sh b/scripts/build/arch/bpf.sh
new file mode 100644
index 00000000..de427283
--- /dev/null
+++ b/scripts/build/arch/bpf.sh
@@ -0,0 +1,7 @@
+# Compute BPF-specific values
+
+CT_DoArchTupleValues() {
+ CT_TARGET_ARCH=bpf
+ CT_TARGET_VENDOR=unknown
+ CT_TARGET_SYS=none
+}
diff --git a/scripts/build/arch/loongarch.sh b/scripts/build/arch/loongarch.sh
new file mode 100644
index 00000000..2e981888
--- /dev/null
+++ b/scripts/build/arch/loongarch.sh
@@ -0,0 +1,5 @@
+# Compute LoongArch-specific values
+
+CT_DoArchTupleValues() {
+ CT_TARGET_ARCH="loongarch${CT_ARCH_BITNESS}"
+}
diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh
index b16be904..fdec508f 100644
--- a/scripts/build/binutils/binutils.sh
+++ b/scripts/build/binutils/binutils.sh
@@ -310,8 +310,9 @@ do_binutils_for_target() {
local -a install_targets
local t
- [ "${CT_BINUTILS_FOR_TARGET_IBERTY}" = "y" ] && targets+=("libiberty")
- [ "${CT_BINUTILS_FOR_TARGET_BFD}" = "y" ] && targets+=("bfd")
+ [ "${CT_BINUTILS_FOR_TARGET_IBERTY}" = "y" ] && targets+=("libiberty")
+ [ "${CT_BINUTILS_FOR_TARGET_BFD}" = "y" ] && targets+=("bfd")
+ [ "${CT_BINUTILS_FOR_TARGET_OPCODES}" = "y" ] && targets+=("opcodes")
for t in "${targets[@]}"; do
build_targets+=("all-${t}")
install_targets+=("install-${t}")
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index eb7efd25..18558533 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -45,6 +45,7 @@ cc_gcc_lang_list() {
[ "${CT_CC_LANG_ADA}" = "y" ] && lang_list+=",ada"
[ "${CT_CC_LANG_D}" = "y" ] && lang_list+=",d"
[ "${CT_CC_LANG_JAVA}" = "y" ] && lang_list+=",java"
+ [ "${CT_CC_LANG_JIT}" = "y" ] && lang_list+=",jit"
[ "${CT_CC_LANG_OBJC}" = "y" ] && lang_list+=",objc"
[ "${CT_CC_LANG_OBJCXX}" = "y" ] && lang_list+=",obj-c++"
[ "${CT_CC_LANG_GOLANG}" = "y" ] && lang_list+=",go"
@@ -288,14 +289,13 @@ do_gcc_core_backend() {
;;
libstdcxx)
CT_DoLog EXTRA "Configuring libstdc++ for ${libstdcxx_name}"
- if [ "${header_dir}" = "" ]; then
+ if [ -z "${header_dir}" ]; then
header_dir="${CT_PREFIX_DIR}/${libstdcxx_name}/include"
fi
- if [ "${exec_prefix}" = "" ]; then
+ if [ -z "${exec_prefix}" ]; then
exec_prefix="${CT_PREFIX_DIR}/${libstdcxx_name}"
fi
extra_config+=( "${CT_CC_SYSROOT_ARG[@]}" )
- extra_config+=( "--with-headers=${header_dir}" )
extra_user_config=( "${CT_CC_GCC_EXTRA_CONFIG_ARRAY[@]}" )
log_txt="libstdc++ ${libstdcxx_name} library"
# to inhibit the libiberty and libgcc tricks later on
@@ -306,7 +306,7 @@ do_gcc_core_backend() {
;;
esac
- if [ "${exec_prefix}" = "" ]; then
+ if [ -z "${exec_prefix}" ]; then
exec_prefix="${prefix}"
fi
@@ -344,6 +344,10 @@ do_gcc_core_backend() {
extra_config+=("--enable-newlib-nano-formatted-io")
fi
+ if [ "${CT_CC_LANG_JIT}" = "y" ]; then
+ extra_config+=("--enable-host-shared")
+ fi
+
if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then
extra_config+=("--enable-__cxa_atexit")
else
@@ -380,6 +384,7 @@ do_gcc_core_backend() {
case "${CT_CC_GCC_LIBSTDCXX_VERBOSE}" in
y) extra_config+=("--enable-libstdcxx-verbose");;
+ m) ;;
"") extra_config+=("--disable-libstdcxx-verbose");;
esac
@@ -435,6 +440,10 @@ do_gcc_core_backend() {
extra_config+=("--with-host-libstdcxx=${host_libstdcxx_flags[*]}")
fi
+ if [ "${CT_CC_GCC_ENABLE_DEFAULT_PIE}" = "y" ]; then
+ extra_config+=("--enable-default-pie")
+ fi
+
if [ "${CT_CC_GCC_ENABLE_TARGET_OPTSPACE}" = "y" ] || \
[ "${enable_optspace}" = "yes" ]; then
extra_config+=("--enable-target-optspace")
@@ -549,6 +558,13 @@ do_gcc_core_backend() {
fi
fi
+ # Add an extra system include dir if we have one. This is especially useful
+ # when building libstdc++ with a libc other than the system libc (e.g.
+ # picolibc)
+ if [ -n "${header_dir}" ]; then
+ cflags_for_target="${cflags_for_target} -idirafter ${header_dir}"
+ fi
+
# For non-sysrooted toolchain, GCC doesn't search except at the installation
# prefix; in core stage we use a temporary installation prefix - but
# we may have installed something into the final prefix. This is less than ideal:
@@ -799,7 +815,7 @@ gcc_movelibs()
# Move only files, directories are for other multilibs. We're looking inside
# GCC's directory structure, thus use unmangled multi_os_dir that GCC reports.
- gcc_dir="${CT_PREFIX_DIR}/${CT_TARGET}/lib/${multi_os_dir_gcc}"
+ gcc_dir="${canon_prefix}/${CT_TARGET}/lib/${multi_os_dir_gcc}"
if [ ! -d "${gcc_dir}" ]; then
# GCC didn't install anything outside of sysroot
return
@@ -812,7 +828,7 @@ gcc_movelibs()
dst_dir="${canon_root}/lib/${multi_os_dir}"
fi
CT_SanitizeVarDir dst_dir gcc_dir
- rel=$( echo "${gcc_dir#${CT_PREFIX_DIR}/}" | sed 's#[^/]\{1,\}#..#g' )
+ rel=$( echo "${gcc_dir#${canon_prefix}/}" | sed 's#[^/]\{1,\}#..#g' )
ls "${gcc_dir}" | while read f; do
case "${f}" in
@@ -906,7 +922,6 @@ do_gcc_backend() {
local extra_cxxflags_for_target
local ldflags
local build_manuals
- local exec_prefix
local header_dir
local libstdcxx_name
local -a host_libstdcxx_flags
@@ -921,7 +936,7 @@ do_gcc_backend() {
eval "${arg// /\\ }"
done
- if [ "${exec_prefix}" = "" ]; then
+ if [ -z "${exec_prefix}" ]; then
exec_prefix="${prefix}"
fi
@@ -1004,11 +1019,11 @@ do_gcc_backend() {
extra_config+=(--disable-libquadmath-support)
fi
- if [ "${CT_CC_GCC_LIBSANITIZER}" = "y" ]; then
- extra_config+=(--enable-libsanitizer)
- else
- extra_config+=(--disable-libsanitizer)
- fi
+ case "${CT_CC_GCC_LIBSANITIZER}" in
+ y) extra_config+=(--enable-libsanitizer);;
+ m) ;;
+ "") extra_config+=(--disable-libsanitizer);;
+ esac
if [ "${CT_CC_GCC_HAS_LIBMPX}" = "y" ]; then
if [ "${CT_CC_GCC_LIBMPX}" = "y" ]; then
@@ -1020,6 +1035,7 @@ do_gcc_backend() {
case "${CT_CC_GCC_LIBSTDCXX_VERBOSE}" in
y) extra_config+=("--enable-libstdcxx-verbose");;
+ m) ;;
"") extra_config+=("--disable-libstdcxx-verbose");;
esac
@@ -1195,6 +1211,13 @@ do_gcc_backend() {
fi
fi
+ # Add an extra system include dir if we have one. This is especially useful
+ # when building libstdc++ with a libc other than the system libc (e.g.
+ # picolibc)
+ if [ -n "${header_dir}" ]; then
+ cflags_for_target="${cflags_for_target} -idirafter ${header_dir}"
+ fi
+
# Assume '-O2' by default for building target libraries.
cflags_for_target="-g -O2 ${cflags_for_target}"
@@ -1227,7 +1250,7 @@ do_gcc_backend() {
--target=${CT_TARGET} \
--prefix="${prefix}" \
--exec_prefix="${exec_prefix}" \
- ${CT_CC_SYSROOT_ARG} \
+ "${CT_CC_SYSROOT_ARG[@]}" \
"${extra_config[@]}" \
--with-local-prefix="${CT_SYSROOT_DIR}" \
--enable-long-long \
diff --git a/scripts/build/companion_libs/050-zlib.sh b/scripts/build/companion_libs/050-zlib.sh
index 8c6a0f6f..07c95496 100644
--- a/scripts/build/companion_libs/050-zlib.sh
+++ b/scripts/build/companion_libs/050-zlib.sh
@@ -80,6 +80,10 @@ do_zlib_backend() {
eval "${arg// /\\ }"
done
+ if [ "${CT_CC_LANG_JIT}" = "y" ]; then
+ cflags="${cflags} -fPIC"
+ fi
+
case "${host}" in
*-mingw32)
# zlib treats mingw host differently and requires using a different
diff --git a/scripts/build/companion_libs/100-gmp.sh b/scripts/build/companion_libs/100-gmp.sh
index 8afa5aec..28deff97 100644
--- a/scripts/build/companion_libs/100-gmp.sh
+++ b/scripts/build/companion_libs/100-gmp.sh
@@ -109,7 +109,7 @@ do_gmp_backend() {
CT_DoLog EXTRA "Configuring GMP"
- # To avoind “illegal text-relocation” linking error against
+ # To avoid “illegal text-relocation” linking error against
# the static library, see:
# https://github.com/Homebrew/homebrew-core/pull/25470
case "${host}" in
@@ -118,6 +118,10 @@ do_gmp_backend() {
;;
esac
+ if [ "${CT_CC_LANG_JIT}" = "y" ]; then
+ extra_config+=("--with-pic")
+ fi
+
# GMP's configure script doesn't respect the host parameter
# when not cross-compiling, ie when build == host so set
# CC_FOR_BUILD and CPP_FOR_BUILD.
diff --git a/scripts/build/companion_libs/110-mpfr.sh b/scripts/build/companion_libs/110-mpfr.sh
index d2cb9f68..3a1916c5 100644
--- a/scripts/build/companion_libs/110-mpfr.sh
+++ b/scripts/build/companion_libs/110-mpfr.sh
@@ -94,6 +94,7 @@ do_mpfr_backend() {
local cflags
local ldflags
local arg
+ local -a extra_config
for arg in "$@"; do
eval "${arg// /\\ }"
@@ -101,12 +102,16 @@ do_mpfr_backend() {
# Under Cygwin, we can't build a thread-safe library
case "${CT_HOST}" in
- *cygwin*) mpfr_opts+=( --disable-thread-safe );;
- *mingw*) mpfr_opts+=( --disable-thread-safe );;
- *darwin*) mpfr_opts+=( --disable-thread-safe );;
- *) mpfr_opts+=( --enable-thread-safe );;
+ *cygwin*) extra_config+=( --disable-thread-safe );;
+ *mingw*) extra_config+=( --disable-thread-safe );;
+ *darwin*) extra_config+=( --disable-thread-safe );;
+ *) extra_config+=( --enable-thread-safe );;
esac
+ if [ "${CT_CC_LANG_JIT}" = "y" ]; then
+ extra_config+=("--with-pic")
+ fi
+
CT_DoLog EXTRA "Configuring MPFR"
CT_DoExecLog CFG \
CC="${host}-gcc" \
@@ -117,6 +122,7 @@ do_mpfr_backend() {
--build=${CT_BUILD} \
--host=${host} \
--prefix="${prefix}" \
+ "${extra_config[@]}" \
--with-gmp="${prefix}" \
--disable-shared \
--enable-static
diff --git a/scripts/build/companion_libs/121-isl.sh b/scripts/build/companion_libs/121-isl.sh
index 3577b756..d7f69256 100644
--- a/scripts/build/companion_libs/121-isl.sh
+++ b/scripts/build/companion_libs/121-isl.sh
@@ -82,6 +82,10 @@ do_isl_backend() {
eval "${arg// /\\ }"
done
+ if [ "${CT_CC_LANG_JIT}" = "y" ]; then
+ extra_config+=("--with-pic")
+ fi
+
CT_DoLog EXTRA "Configuring ISL"
CT_DoExecLog CFG \
diff --git a/scripts/build/companion_libs/130-cloog.sh b/scripts/build/companion_libs/130-cloog.sh
index 9ee897ab..5170b53b 100644
--- a/scripts/build/companion_libs/130-cloog.sh
+++ b/scripts/build/companion_libs/130-cloog.sh
@@ -83,6 +83,10 @@ do_cloog_backend() {
cloog_opts+=( --with-isl=system --with-isl-prefix="${prefix}" )
cloog_opts+=( --without-osl )
+ if [ "${CT_CC_LANG_JIT}" = "y" ]; then
+ cloog_opts+=("--with-pic")
+ fi
+
CT_DoLog EXTRA "Configuring CLooG"
CT_DoExecLog CFG \
diff --git a/scripts/build/companion_libs/140-mpc.sh b/scripts/build/companion_libs/140-mpc.sh
index 2166ef1b..2bbba2d9 100644
--- a/scripts/build/companion_libs/140-mpc.sh
+++ b/scripts/build/companion_libs/140-mpc.sh
@@ -38,6 +38,11 @@ do_mpc_for_build() {
mpc_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
mpc_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
mpc_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
+
+ if [ "${CT_CC_LANG_JIT}" = "y" ]; then
+ mpc_opts+=("--with-pic")
+ fi
+
do_mpc_backend "${mpc_opts[@]}"
CT_Popd
@@ -73,11 +78,17 @@ do_mpc_backend() {
local cflags
local ldflags
local arg
+ local -a extra_config
for arg in "$@"; do
eval "${arg// /\\ }"
done
+ if [ "${CT_CC_LANG_JIT}" = "y" ]; then
+ extra_config+=("--with-pic")
+ fi
+
+
CT_DoLog EXTRA "Configuring MPC"
CT_DoExecLog CFG \
@@ -87,6 +98,7 @@ do_mpc_backend() {
"${CT_SRC_DIR}/mpc/configure" \
--build=${CT_BUILD} \
--host=${host} \
+ "${extra_config[@]}" \
--prefix="${prefix}" \
--with-gmp="${prefix}" \
--with-mpfr="${prefix}" \
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 2afefd41..e400b219 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -131,8 +131,12 @@ glibc_backend_once()
# Pre-seed the configparms file with values from the config option
printf "%s\n" "${CT_GLIBC_CONFIGPARMS}" > configparms
+ if [ "${CT_GLIBC_ENABLE_DEBUG}" = "y" ]; then
+ glibc_cflags+=" -g"
+ fi
+
# glibc can't be built without -O2 (reference needed!)
- glibc_cflags+=" -g -O2"
+ glibc_cflags+=" -O2"
if [ "${CT_GLIBC_ENABLE_COMMON_FLAG}" = "y" ]; then
glibc_cflags+=" -fcommon"
diff --git a/scripts/config.guess b/scripts/config.guess
index e81d3ae7..980b0208 100755
--- a/scripts/config.guess
+++ b/scripts/config.guess
@@ -1,14 +1,14 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2021 Free Software Foundation, Inc.
+# Copyright 1992-2022 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
-timestamp='2021-06-03'
+timestamp='2022-09-17'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -60,7 +60,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2021 Free Software Foundation, Inc.
+Copyright 1992-2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -437,7 +437,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
# This test works for both compilers.
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH=x86_64
@@ -929,6 +929,9 @@ EOF
i*:PW*:*)
GUESS=$UNAME_MACHINE-pc-pw32
;;
+ *:SerenityOS:*:*)
+ GUESS=$UNAME_MACHINE-pc-serenity
+ ;;
*:Interix*:*)
case $UNAME_MACHINE in
x86)
@@ -963,6 +966,12 @@ EOF
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
;;
+ x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
+ GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
+ ;;
+ *:[Mm]anagarm:*:*)
+ GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
+ ;;
*:Minix:*:*)
GUESS=$UNAME_MACHINE-unknown-minix
;;
@@ -1033,7 +1042,7 @@ EOF
k1om:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
- loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+ loongarch32:Linux:*:* | loongarch64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
m32r*:Linux:*:*)
@@ -1148,16 +1157,27 @@ EOF
;;
x86_64:Linux:*:*)
set_cc_for_build
+ CPU=$UNAME_MACHINE
LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then
- if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_X32 >/dev/null
- then
- LIBCABI=${LIBC}x32
- fi
+ ABI=64
+ sed 's/^ //' << EOF > "$dummy.c"
+ #ifdef __i386__
+ ABI=x86
+ #else
+ #ifdef __ILP32__
+ ABI=x32
+ #endif
+ #endif
+EOF
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
+ eval "$cc_set_abi"
+ case $ABI in
+ x86) CPU=i686 ;;
+ x32) LIBCABI=${LIBC}x32 ;;
+ esac
fi
- GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
+ GUESS=$CPU-pc-linux-$LIBCABI
;;
xtensa*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
@@ -1364,8 +1384,11 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
GUESS=i586-pc-haiku
;;
- x86_64:Haiku:*:*)
- GUESS=x86_64-unknown-haiku
+ ppc:Haiku:*:*) # Haiku running on Apple PowerPC
+ GUESS=powerpc-apple-haiku
+ ;;
+ *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
+ GUESS=$UNAME_MACHINE-unknown-haiku
;;
SX-4:SUPER-UX:*:*)
GUESS=sx4-nec-superux$UNAME_RELEASE
@@ -1522,6 +1545,9 @@ EOF
i*86:rdos:*:*)
GUESS=$UNAME_MACHINE-pc-rdos
;;
+ i*86:Fiwix:*:*)
+ GUESS=$UNAME_MACHINE-pc-fiwix
+ ;;
*:AROS:*:*)
GUESS=$UNAME_MACHINE-unknown-aros
;;
diff --git a/scripts/config.sub b/scripts/config.sub
index d74fb6de..baf1512b 100755
--- a/scripts/config.sub
+++ b/scripts/config.sub
@@ -1,14 +1,14 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2021 Free Software Foundation, Inc.
+# Copyright 1992-2022 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
-timestamp='2021-08-14'
+timestamp='2022-09-17'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -76,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2021 Free Software Foundation, Inc.
+Copyright 1992-2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -145,7 +145,7 @@ case $1 in
nto-qnx* | linux-* | uclinux-uclibc* \
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
- | storm-chaos* | os2-emx* | rtmk-nova*)
+ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*)
basic_machine=$field1
basic_os=$maybe_os
;;
@@ -1020,6 +1020,11 @@ case $cpu-$vendor in
;;
# Here we normalize CPU types with a missing or matching vendor
+ armh-unknown | armh-alt)
+ cpu=armv7l
+ vendor=alt
+ basic_os=${basic_os:-linux-gnueabihf}
+ ;;
dpx20-unknown | dpx20-bull)
cpu=rs6000
vendor=bull
@@ -1121,7 +1126,7 @@ case $cpu-$vendor in
xscale-* | xscalee[bl]-*)
cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
- arm64-*)
+ arm64-* | aarch64le-*)
cpu=aarch64
;;
@@ -1202,7 +1207,7 @@ case $cpu-$vendor in
| k1om \
| le32 | le64 \
| lm32 \
- | loongarch32 | loongarch64 | loongarchx32 \
+ | loongarch32 | loongarch64 \
| m32c | m32r | m32rle \
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
@@ -1304,7 +1309,7 @@ esac
if test x$basic_os != x
then
-# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
+# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
# set os.
case $basic_os in
gnu/linux*)
@@ -1336,6 +1341,10 @@ EOF
kernel=linux
os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
;;
+ managarm*)
+ kernel=managarm
+ os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
+ ;;
*)
kernel=
os=$basic_os
@@ -1748,7 +1757,8 @@ case $os in
| skyos* | haiku* | rdos* | toppers* | drops* | es* \
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
- | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*)
+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
+ | fiwix* | mlibc* )
;;
# This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
@@ -1756,6 +1766,9 @@ case $os in
;;
none)
;;
+ kernel* )
+ # Restricted further below
+ ;;
*)
echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
exit 1
@@ -1766,16 +1779,26 @@ esac
# (given a valid OS), if there is a kernel.
case $kernel-$os in
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
- | linux-musl* | linux-relibc* | linux-uclibc* )
+ | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* )
;;
uclinux-uclibc* )
;;
- -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
+ managarm-mlibc* | managarm-kernel* )
+ ;;
+ -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
# These are just libc implementations, not actual OSes, and thus
# require a kernel.
echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
exit 1
;;
+ -kernel* )
+ echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ *-kernel* )
+ echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2
+ exit 1
+ ;;
kfreebsd*-gnu* | kopensolaris*-gnu*)
;;
vxworks-simlinux | vxworks-simwindows | vxworks-spe)
diff --git a/scripts/crosstool-NG.sh b/scripts/crosstool-NG.sh
index ea3bd686..383de66d 100644
--- a/scripts/crosstool-NG.sh
+++ b/scripts/crosstool-NG.sh
@@ -345,8 +345,8 @@ if [ -z "${CT_RESTART}" ]; then
CT_HEADERS_DIR="${CT_SYSROOT_DIR}/usr/include"
CT_SanitizeVarDir CT_SYSROOT_DIR CT_DEBUGROOT_DIR CT_HEADERS_DIR
CT_BINUTILS_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}"
- CT_CC_CORE_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}"
- CT_CC_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}"
+ CT_CC_CORE_SYSROOT_ARG=("--with-sysroot=${CT_SYSROOT_DIR}")
+ CT_CC_SYSROOT_ARG=("--with-sysroot=${CT_SYSROOT_DIR}")
# glibc's prefix must be exactly /usr, else --with-sysroot'd gcc will get
# confused when $sysroot/usr/include is not present.
# Note: --prefix=/usr is magic!
@@ -363,8 +363,8 @@ if [ -z "${CT_RESTART}" ]; then
CT_BINUTILS_SYSROOT_ARG="--with-sysroot=${CT_SYSROOT_DIR}"
# Use --with-headers, else final gcc will define disable_glibc while
# building libgcc, and you'll have no profiling
- CT_CC_CORE_SYSROOT_ARG="--without-headers"
- CT_CC_SYSROOT_ARG="--with-headers=${CT_HEADERS_DIR}"
+ CT_CC_CORE_SYSROOT_ARG=("--without-headers")
+ CT_CC_SYSROOT_ARG=("--with-headers=${CT_HEADERS_DIR}")
fi
CT_DoExecLog ALL mkdir -p "${CT_SYSROOT_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_DEBUGROOT_DIR}"
@@ -437,7 +437,7 @@ if [ -z "${CT_RESTART}" ]; then
t="${!r}-"
fi
- for tool in ar as dlltool gcc g++ gcj gnatbind gnatmake ld libtool nm objcopy objdump ranlib strip windres; do
+ for tool in ar as dlltool gcc g++ gcj gnatbind gdc gnatmake ld libtool nm objcopy objdump ranlib strip windres; do
# First try with prefix + suffix
# Then try with prefix only
# Then try with suffix only, but only for BUILD, and HOST iff REAL_BUILD == REAL_HOST
diff --git a/scripts/functions b/scripts/functions
index c2c1493c..09fa29af 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -1806,7 +1806,7 @@ CT_Mirrors()
'')
# Ignore, this happens before .config is fully evaluated
;;
- [345].*)
+ [3456].*)
echo "https://cdn.kernel.org/pub/linux/kernel/v${version%%.*}.x"
;;
2.6.*)
@@ -2283,10 +2283,11 @@ CT_DoExtractPatch()
CT_DoExecLog ALL rm -f "${src_dir}/.${basename}".*
fi
- if [ -f "${src_dir}/.${basename}.extracted" ]; then
+ if [ -f "${src_dir}/.${basename}.extracted" -a -d "${src_dir}/${basename}" ]; then
CT_DoLog DEBUG "Already extracted ${basename}"
else
CT_DoLog EXTRA "Extracting ${basename}"
+ CT_DoExecLog ALL rm -f "${src_dir}/.${basename}".*
CT_DoExecLog ALL touch "${src_dir}/.${basename}.extracting"
if [ "${src_release}" = "y" ]; then
archive="${archive_filename}"