From: Matthias Klose Date: Thu, 13 Mar 2025 06:22:02 +0000 (+0100) Subject: Allow to build libgccjit with a soname bound to the GCC major version X-Git-Tag: basepoints/gcc-16~1535 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1baee38ffe044ab0a7ecbacad965bbeafae7fc4;p=thirdparty%2Fgcc.git Allow to build libgccjit with a soname bound to the GCC major version When configuring GCC with --program-suffix=-$(BASE_VERSION) to allow installation multiple GCC versions in parallel, the executable of the driver (gcc-$(BASE_VERSION)) gets recorded in the libgccjit.so.0 library. Assuming, that you only install the libgccjit.so.0 library from the newest GCC, you have a libgccjit installed, which always calls back to the newest installed version of GCC. I'm not saying that the ABI is changing, but I'd like to see the libgccjit calling out to the corresponding compiler, and therefore installing a libgccjit with a soname that matches the GCC major version. The downside is having to rebuild packages built against libgccjit with each major GCC version, but looking at the reverse dependencies, at least for package builds, only emacs is using libgccjit. My plan to use this feature is to build a libgccjit0 using the default GCC (e.g. gcc-14), and a libgccjit15, when building a newer GCC. When changing the GCC default to 15, building a libgccjit0 from gcc-15, and a libgccjit14 from gcc-14. When configuring without --enable-versioned-jit, the behavior is unchanged. 2025-03-13 Matthias Klose gcc/ * configure.ac: Add option --enable-versioned-jit. * configure: Regenerate. * Makefile.in: Move from jit/Make-lang.in, setting value from configure.ac. * doc/install.texi: Document option --enable-versioned-jit. gcc/jit/ * Make-lang.in (LIBGCCJIT_VERSION_NUM): Move to ../Makefile.in. --- diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 5477aea882a..9ca389a9c61 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1218,6 +1218,7 @@ LANG_CONFIGUREFRAGS = @all_lang_configurefrags@ LANG_MAKEFRAGS = @all_lang_makefrags@ # Used by gcc/jit/Make-lang.in +LIBGCCJIT_VERSION_NUM = @libgccjit_version@ LD_VERSION_SCRIPT_OPTION = @ld_version_script_option@ LD_SONAME_OPTION = @ld_soname_option@ @ENABLE_DARWIN_AT_RPATH_TRUE@DARWIN_RPATH = @rpath diff --git a/gcc/configure b/gcc/configure index 86a5c75a146..a34ae586d90 100755 --- a/gcc/configure +++ b/gcc/configure @@ -636,6 +636,7 @@ CET_HOST_FLAGS LD_PICFLAG PICFLAG enable_default_pie +libgccjit_version enable_host_bind_now LIBGDIAGNOSTICS enable_libgdiagnostics @@ -1059,6 +1060,7 @@ enable_libquadmath_support with_linker_hash_style with_diagnostics_color with_diagnostics_urls +enable_versioned_jit enable_default_pie enable_cet enable_s390_excess_float_precision @@ -1834,6 +1836,7 @@ Optional Features: --enable-host-bind-now link host code as BIND_NOW --disable-libquadmath-support disable libquadmath support for Fortran + --enable-versioned-jit enable versioned libgccjit build --enable-default-pie enable Position Independent Executable as default --enable-cet enable Intel CET in host libraries [default=auto] --enable-s390-excess-float-precision @@ -21477,7 +21480,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 21480 "configure" +#line 21483 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -21583,7 +21586,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 21586 "configure" +#line 21589 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -34428,6 +34431,23 @@ cat > gcc-driver-name.h < gcc-driver-name.h <