diff --git a/config/comp_libs/picolibc.in b/config/comp_libs/picolibc.in index cb7a1e4f..99f0e452 100644 --- a/config/comp_libs/picolibc.in +++ b/config/comp_libs/picolibc.in @@ -62,7 +62,7 @@ config LIBC_PICOLIBC_GLOBAL_ATEXIT prompt "Enable atexit data structure as global variable" help Enable atexit data structure as global variable, instead - of being thread-local. + of being thread-local. config LIBC_PICOLIBC_LITE_EXIT bool diff --git a/scripts/build/arch/sparc.sh b/scripts/build/arch/sparc.sh index 97c9b9df..22d98e4a 100644 --- a/scripts/build/arch/sparc.sh +++ b/scripts/build/arch/sparc.sh @@ -4,31 +4,31 @@ CT_DoArchTupleValues() { CT_TARGET_ARCH="sparc${target_bits_64}${CT_ARCH_SUFFIX}" if [ "${CT_KERNEL}" = "linux" -a -z "${CT_ARCH_CPU}" ]; then - if [ "${CT_ARCH_64}" = "y" ]; then - # By default, sparc64-*-linux is configured with -mcpu=v9. However, - # according to https://sourceware.org/ml/libc-alpha/2005-12/msg00027.html, - # "There is no Linux sparc64 port that runs on non-UltraSPARC-I+ ISA CPUs." - # There is a patch that would change the default to -mcpu=ultrasparc for - # sparc64-*-linux configuration: https://patchwork.ozlabs.org/patch/409424/ - # but that patch has not been integrated (yet). One concern raised about - # this patch was that -mcpu=ultrasparc can suboptimally schedule instructions - # for newer SPARC CPUs. So, override to -mcpu=ultrasparc and warn the user. - CT_DoLog WARN "Setting CPU to UltraSPARC-I for sparc64-linux. Set CT_ARCH_CPU if a different CPU is desired." - CT_ARCH_WITH_CPU="--with-cpu=ultrasparc" - if [ -n "${CT_ARCH_SUPPORTS_WITH_32_64}" -a -n "${CT_MULTILIB}" ]; then - CT_ARCH_WITH_CPU_32="--with-cpu-32=ultrasparc" - CT_ARCH_WITH_CPU_64="--with-cpu-64=ultrasparc" - fi - else - # Similarly, sparc-*-linux defaults to v7. GLIBC 2.31 started to reject - # pre-v8 configurations with 2.31, and default v8 fails a subsequent test for - # using atomics (which are presumably, only available on some v8 CPUs). - # Therefore, default to v9. - if [ -z "${CT_GLIBC_SPARC_ALLOW_V7}" ]; then - CT_DoLog WARN "Setting CPU to V9 for sparc-linux. Set CT_ARCH_CPU if a different CPU is desired." - CT_ARCH_WITH_CPU="--with-cpu=v9" - fi - fi + if [ "${CT_ARCH_64}" = "y" ]; then + # By default, sparc64-*-linux is configured with -mcpu=v9. However, + # according to https://sourceware.org/ml/libc-alpha/2005-12/msg00027.html, + # "There is no Linux sparc64 port that runs on non-UltraSPARC-I+ ISA CPUs." + # There is a patch that would change the default to -mcpu=ultrasparc for + # sparc64-*-linux configuration: https://patchwork.ozlabs.org/patch/409424/ + # but that patch has not been integrated (yet). One concern raised about + # this patch was that -mcpu=ultrasparc can suboptimally schedule instructions + # for newer SPARC CPUs. So, override to -mcpu=ultrasparc and warn the user. + CT_DoLog WARN "Setting CPU to UltraSPARC-I for sparc64-linux. Set CT_ARCH_CPU if a different CPU is desired." + CT_ARCH_WITH_CPU="--with-cpu=ultrasparc" + if [ -n "${CT_ARCH_SUPPORTS_WITH_32_64}" -a -n "${CT_MULTILIB}" ]; then + CT_ARCH_WITH_CPU_32="--with-cpu-32=ultrasparc" + CT_ARCH_WITH_CPU_64="--with-cpu-64=ultrasparc" + fi + else + # Similarly, sparc-*-linux defaults to v7. GLIBC 2.31 started to reject + # pre-v8 configurations with 2.31, and default v8 fails a subsequent test for + # using atomics (which are presumably, only available on some v8 CPUs). + # Therefore, default to v9. + if [ -z "${CT_GLIBC_SPARC_ALLOW_V7}" ]; then + CT_DoLog WARN "Setting CPU to V9 for sparc-linux. Set CT_ARCH_CPU if a different CPU is desired." + CT_ARCH_WITH_CPU="--with-cpu=v9" + fi + fi fi } diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 0b41c29e..ab66f413 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -337,14 +337,14 @@ do_gcc_core_backend() { ;; libstdcxx) CT_DoLog EXTRA "Configuring libstdc++ for ${libstdcxx_name}" - if [ "${header_dir}" = "" ]; then - header_dir="${CT_PREFIX_DIR}/${libstdcxx_name}/include" - fi - if [ "${exec_prefix}" = "" ]; then - exec_prefix="${CT_PREFIX_DIR}/${libstdcxx_name}" - fi + if [ "${header_dir}" = "" ]; then + header_dir="${CT_PREFIX_DIR}/${libstdcxx_name}/include" + fi + if [ "${exec_prefix}" = "" ]; then + exec_prefix="${CT_PREFIX_DIR}/${libstdcxx_name}" + fi extra_config+=( "${CT_CC_SYSROOT_ARG[@]}" ) - extra_config+=( "--with-headers=${header_dir}" ) + 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 @@ -356,7 +356,7 @@ do_gcc_core_backend() { esac if [ "${exec_prefix}" = "" ]; then - exec_prefix="${prefix}" + exec_prefix="${prefix}" fi case "${mode}" in @@ -654,7 +654,7 @@ do_gcc_core_backend() { --host=${host} \ --target=${CT_TARGET} \ --prefix="${prefix}" \ - --exec_prefix="${exec_prefix}" \ + --exec_prefix="${exec_prefix}" \ --with-local-prefix="${CT_SYSROOT_DIR}" \ "${extra_config[@]}" \ --enable-languages="${lang_list}" \ @@ -726,11 +726,11 @@ do_gcc_core_backend() { core_targets_all=all core_targets_install=install ;; - libstdcxx) - core_targets=( target-libstdc++-v3 ) - core_targets_all="${core_targets[@]/#/all-}" - core_targets_install="${core_targets[@]/#/install-}" - ;; + libstdcxx) + core_targets=( target-libstdc++-v3 ) + core_targets_all="${core_targets[@]/#/all-}" + core_targets_install="${core_targets[@]/#/install-}" + ;; esac CT_DoLog EXTRA "Building ${log_txt}" @@ -807,9 +807,9 @@ do_cc_for_build() { # lack of such a compiler, but better safe than sorry... build_final_opts+=( "mode=baremetal" ) build_final_opts+=( "build_libgcc=yes" ) - if [ "${CT_LIBC_NONE}" != "y" ]; then + if [ "${CT_LIBC_NONE}" != "y" ]; then build_final_opts+=( "build_libstdcxx=yes" ) - fi + fi build_final_opts+=( "build_libgfortran=yes" ) if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then build_final_opts+=( "build_staticlinked=yes" ) @@ -898,9 +898,9 @@ do_cc_for_host() { if [ "${CT_BARE_METAL}" = "y" ]; then final_opts+=( "mode=baremetal" ) final_opts+=( "build_libgcc=yes" ) - if [ "${CT_LIBC_NONE}" != "y" ]; then + if [ "${CT_LIBC_NONE}" != "y" ]; then final_opts+=( "build_libstdcxx=yes" ) - fi + fi final_opts+=( "build_libgfortran=yes" ) if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then final_opts+=( "build_staticlinked=yes" ) @@ -969,7 +969,7 @@ do_gcc_backend() { done if [ "${exec_prefix}" = "" ]; then - exec_prefix="${prefix}" + exec_prefix="${prefix}" fi # This function gets called for final gcc and libstdcxx. @@ -1280,7 +1280,7 @@ do_gcc_backend() { --host=${host} \ --target=${CT_TARGET} \ --prefix="${prefix}" \ - --exec_prefix="${exec_prefix}" \ + --exec_prefix="${exec_prefix}" \ ${CT_CC_SYSROOT_ARG} \ "${extra_config[@]}" \ --with-local-prefix="${CT_SYSROOT_DIR}" \ diff --git a/scripts/build/companion_libs/340-picolibc.sh b/scripts/build/companion_libs/340-picolibc.sh index cb96e716..e879005d 100644 --- a/scripts/build/companion_libs/340-picolibc.sh +++ b/scripts/build/companion_libs/340-picolibc.sh @@ -32,18 +32,18 @@ do_cc_libstdcxx_picolibc() if [ "${CT_LIBC_PICOLIBC_GCC_LIBSTDCXX}" = "y" ]; then final_opts+=( "host=${CT_HOST}" ) - final_opts+=( "libstdcxx_name=picolibc" ) + final_opts+=( "libstdcxx_name=picolibc" ) final_opts+=( "prefix=${CT_PREFIX_DIR}" ) final_opts+=( "complibs=${CT_HOST_COMPLIBS_DIR}" ) final_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) final_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" ) final_opts+=( "lang_list=c,c++" ) final_opts+=( "build_step=libstdcxx" ) - final_opts+=( "extra_config+=('--enable-stdio=stdio_pure')" ) - final_opts+=( "extra_config+=('--disable-wchar_t')" ) - if [ "${CT_LIBC_PICOLIBC_ENABLE_TARGET_OPTSPACE}" = "y" ]; then - final_opts+=( "enable_optspace=yes" ) - fi + final_opts+=( "extra_config+=('--enable-stdio=stdio_pure')" ) + final_opts+=( "extra_config+=('--disable-wchar_t')" ) + if [ "${CT_LIBC_PICOLIBC_ENABLE_TARGET_OPTSPACE}" = "y" ]; then + final_opts+=( "enable_optspace=yes" ) + fi if [ "${CT_BARE_METAL}" = "y" ]; then final_opts+=( "mode=baremetal" ) @@ -107,7 +107,7 @@ RETARGETABLE_LOCKING:newlib-retargetable-locking done [ "${CT_USE_SYSROOT}" = "y" ] && \ - picolibc_opts+=( "-Dsysroot-install=true" ) + picolibc_opts+=( "-Dsysroot-install=true" ) [ "${CT_LIBC_PICOLIBC_EXTRA_SECTIONS}" = "y" ] && \ CT_LIBC_PICOLIBC_TARGET_CFLAGS="${CT_LIBC_PICOLIBC_TARGET_CFLAGS} -ffunction-sections -fdata-sections" @@ -122,11 +122,11 @@ RETARGETABLE_LOCKING:newlib-retargetable-locking # build : not used # host : the machine building picolibc # target : the machine picolibc runs on - meson_cflags="" - for cflag in ${cflags_for_target}; do - meson_cflags="${meson_cflags} '${cflag}'," - done - cat << EOF > picolibc-cross.txt + meson_cflags="" + for cflag in ${cflags_for_target}; do + meson_cflags="${meson_cflags} '${cflag}'," + done + cat << EOF > picolibc-cross.txt [binaries] c = '${CT_TARGET}-gcc' ar = '${CT_TARGET}-ar' @@ -149,9 +149,9 @@ EOF meson \ --cross-file picolibc-cross.txt \ --prefix="${CT_PREFIX_DIR}" \ - -Dincludedir=picolibc/include \ - -Dlibdir=picolibc/${CT_TARGET}/lib \ - -Dspecsdir="${CT_SYSROOT_DIR}"/lib \ + -Dincludedir=picolibc/include \ + -Dlibdir=picolibc/${CT_TARGET}/lib \ + -Dspecsdir="${CT_SYSROOT_DIR}"/lib \ "${CT_SRC_DIR}/picolibc" \ "${picolibc_opts[@]}" \ "${CT_LIBC_PICOLIBC_EXTRA_CONFIG_ARRAY[@]}" diff --git a/scripts/build/companion_libs/350-newlib_nano.sh b/scripts/build/companion_libs/350-newlib_nano.sh index f521be12..ad6ea9a1 100644 --- a/scripts/build/companion_libs/350-newlib_nano.sh +++ b/scripts/build/companion_libs/350-newlib_nano.sh @@ -57,16 +57,16 @@ do_cc_libstdcxx_newlib_nano() if [ "${CT_NEWLIB_NANO_GCC_LIBSTDCXX}" = "y" ]; then final_opts+=( "host=${CT_HOST}" ) - final_opts+=( "libstdcxx_name=newlib-nano" ) + final_opts+=( "libstdcxx_name=newlib-nano" ) final_opts+=( "prefix=${CT_PREFIX_DIR}" ) final_opts+=( "complibs=${CT_HOST_COMPLIBS_DIR}" ) final_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" ) final_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" ) final_opts+=( "lang_list=c,c++" ) final_opts+=( "build_step=libstdcxx" ) - if [ "${CT_LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE}" = "y" ]; then - final_opts+=( "enable_optspace=yes" ) - fi + if [ "${CT_LIBC_NEWLIB_NANO_ENABLE_TARGET_OPTSPACE}" = "y" ]; then + final_opts+=( "enable_optspace=yes" ) + fi if [ -n "${CT_NEWLIB_NANO_GCC_LIBSTDCXX_TARGET_CXXFLAGS}" ]; then final_opts+=( "extra_cxxflags_for_target=${CT_NEWLIB_NANO_GCC_LIBSTDCXX_TARGET_CXXFLAGS}" ) fi @@ -185,8 +185,8 @@ ENABLE_TARGET_OPTSPACE:target-optspace --host=${CT_BUILD} \ --target=${CT_TARGET} \ --prefix=${CT_PREFIX_DIR} \ - --exec-prefix=${CT_PREFIX_DIR}/newlib-nano \ - --libdir=${CT_PREFIX_DIR}/newlib-nano/${CT_TARGET}/lib \ + --exec-prefix=${CT_PREFIX_DIR}/newlib-nano \ + --libdir=${CT_PREFIX_DIR}/newlib-nano/${CT_TARGET}/lib \ "${newlib_opts[@]}" \ "${CT_LIBC_NEWLIB_NANO_EXTRA_CONFIG_ARRAY[@]}" diff --git a/scripts/build/companion_tools/050-make.sh b/scripts/build/companion_tools/050-make.sh index aecea1ab..df77d5ba 100644 --- a/scripts/build/companion_tools/050-make.sh +++ b/scripts/build/companion_tools/050-make.sh @@ -72,7 +72,7 @@ do_make_backend() "${CT_SRC_DIR}/make/configure" \ --host="${host}" \ --prefix="${prefix}" \ - "${extra_config[@]}" + "${extra_config[@]}" CT_DoLog EXTRA "Building make" CT_DoExecLog ALL make diff --git a/scripts/build/companion_tools/510-bison.sh b/scripts/build/companion_tools/510-bison.sh index 9379ea82..90bf9ec7 100644 --- a/scripts/build/companion_tools/510-bison.sh +++ b/scripts/build/companion_tools/510-bison.sh @@ -56,7 +56,7 @@ do_bison_backend() "${CT_SRC_DIR}/bison/configure" \ --host="${host}" \ --prefix="${prefix}" \ - "${extra_config[@]}" + "${extra_config[@]}" CT_DoLog EXTRA "Building bison" CT_DoExecLog ALL make