diff options
Diffstat (limited to 'scripts/build')
-rw-r--r-- | scripts/build/arch/bpf.sh | 7 | ||||
-rw-r--r-- | scripts/build/cc/gcc.sh | 29 | ||||
-rw-r--r-- | scripts/build/companion_libs/050-zlib.sh | 4 | ||||
-rw-r--r-- | scripts/build/companion_libs/100-gmp.sh | 6 | ||||
-rw-r--r-- | scripts/build/companion_libs/110-mpfr.sh | 14 | ||||
-rw-r--r-- | scripts/build/companion_libs/121-isl.sh | 4 | ||||
-rw-r--r-- | scripts/build/companion_libs/130-cloog.sh | 4 | ||||
-rw-r--r-- | scripts/build/companion_libs/140-mpc.sh | 12 |
8 files changed, 69 insertions, 11 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/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}" 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}" \ |