diff options
Diffstat (limited to 'scripts/build/cc')
-rw-r--r-- | scripts/build/cc/gcc.sh | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index d75ad986..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 @@ -554,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: @@ -911,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 @@ -926,7 +936,7 @@ do_gcc_backend() { eval "${arg// /\\ }" done - if [ "${exec_prefix}" = "" ]; then + if [ -z "${exec_prefix}" ]; then exec_prefix="${prefix}" fi @@ -1201,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}" |