aboutsummaryrefslogtreecommitdiff
path: root/scripts/build/companion_libs/140-mpc.sh
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2022-12-13 21:16:22 +0100
committerChris Packham <judge.packham@gmail.com>2022-12-18 21:20:50 +1300
commitcdae8d0559d41f9464ab54e2967e23a0ee06a358 (patch)
tree7245c112b1e1999ec2c8f715aeff4facf6de6cb5 /scripts/build/companion_libs/140-mpc.sh
parent500fe136547598da727970383cefe6280c09a658 (diff)
downloadcrosstool-ng-cdae8d0559d41f9464ab54e2967e23a0ee06a358.tar.gz
crosstool-ng-cdae8d0559d41f9464ab54e2967e23a0ee06a358.tar.bz2
crosstool-ng-cdae8d0559d41f9464ab54e2967e23a0ee06a358.zip
Enable support for building libgccjit
libgccjit is still under development and, despite its name, may also be used for ahead-of-time compilation. Documentation can be found on the gcc website: https://gcc.gnu.org/onlinedocs/jit/internals/index.html https://gcc.gnu.org/wiki/JIT With this change it's possible to enable the building of the libgccjit. It's enabled as a language (with --enable-languages=jit) even if not a language frontend at all. The main changes are related to the requirement of having everything host side built as Position Independent Code (PIC) with --enable-host-shared. GCC has the needed logic for building its dependencies (mpc, gmp, mpfr, ...) correctly when built "in-tree", which is not the case with crosstool-ng (see https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=05048fc29f0) Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Diffstat (limited to 'scripts/build/companion_libs/140-mpc.sh')
-rw-r--r--scripts/build/companion_libs/140-mpc.sh12
1 files changed, 12 insertions, 0 deletions
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}" \