[gcc r15-8034] Honor prefix and suffix when installing cobol binaries and man page.

2025-03-13 Thread Matthias Klose via Gcc-cvs
https://gcc.gnu.org/g:c5e7cfc1d3dcfdbf9df871e16e9a6a447a32f271

commit r15-8034-gc5e7cfc1d3dcfdbf9df871e16e9a6a447a32f271
Author: Matthias Klose 
Date:   Thu Mar 13 15:38:53 2025 +0100

Honor prefix and suffix when installing cobol binaries and man page.

2025-03-13  Matthias Klose  

gcc/cobol/
* Make-lang.in (cobol.install-common, cobol.install-man): Honor
GCOBOL_INSTALL_NAME.

Diff:
---
 gcc/cobol/Make-lang.in | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/gcc/cobol/Make-lang.in b/gcc/cobol/Make-lang.in
index 9fa3b1cdfdb3..650b695e7ef5 100644
--- a/gcc/cobol/Make-lang.in
+++ b/gcc/cobol/Make-lang.in
@@ -34,8 +34,10 @@
 # - the compiler proper (eg: cc1plus)
 # - define the names for selecting the language in LANGUAGES.
 
-gcobol_INSTALL_NAME := $(shell echo gcobol|sed '$(program_transform_name)')
-gcobol_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcobol|sed 
'$(program_transform_name)')
+GCOBOL_INSTALL_NAME := $(shell echo gcobol|sed '$(program_transform_name)')
+GCOBOL_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcobol|sed 
'$(program_transform_name)')
+
+GCOBC_INSTALL_NAME := $(shell echo gcobc|sed '$(program_transform_name)')
 
 cobol: cobol1$(exeext)
 cobol.serial = cobol1$(exeext)
@@ -280,14 +282,14 @@ cobol.start.encap: gcobol$(exeext)
 cobol.rest.encap:
 
 cobol.install-common: installdirs
-   $(INSTALL_PROGRAM) gcobol$(exeext)  $(DESTDIR)$(bindir)/
+   $(INSTALL_PROGRAM) gcobol$(exeext)  
$(DESTDIR)$(bindir)/$(GCOBOL_INSTALL_NAME)$(exeext)
$(INSTALL_PROGRAM) cobol1$(exeext)  $(DESTDIR)$(libexecsubdir)/
-   $(INSTALL) -m 755 $(srcdir)/cobol/gcobc $(DESTDIR)$(bindir)/
+   $(INSTALL) -m 755 $(srcdir)/cobol/gcobc 
$(DESTDIR)$(bindir)/$(GCOBC_INSTALL_NAME)$(exeext)
mkdir -p $(DESTDIR)$(datadir)/gcobol/udf
$(INSTALL_DATA) $(srcdir)/cobol/udf/*   $(DESTDIR)$(datadir)/gcobol/udf/
 
 cobol.install-man: installdirs
-   $(INSTALL_DATA) $(srcdir)/cobol/gcobol.1 $(DESTDIR)$(man1dir)/
+   $(INSTALL_DATA) $(srcdir)/cobol/gcobol.1 
$(DESTDIR)$(man1dir)/$(GCOBOL_INSTALL_NAME)$(man1ext)
$(INSTALL_DATA) $(srcdir)/cobol/gcobol.3 $(DESTDIR)$(man3dir)/
 
 cobol.install-info:
@@ -332,7 +334,7 @@ gcobol-io.html: $(srcdir)/cobol/gcobol.3
 # "make uninstall" is not expected to work.  It's not clear how to name
 # the installed location of the cobol1 compiler.
 cobol.uninstall:
-   rm -rf  $(DESTDIR)$(bindir)/$(gcobol_INSTALL_NAME)$(exeext) \
+   rm -rf  $(DESTDIR)$(bindir)/$(GCOBOL_INSTALL_NAME)$(exeext) \
$(DESTDIR)$(bindir)/gcobc   \
$(DESTDIR)$(datadir)/gcobol/\
$(DESTDIR)$(man1dir)/gcobol.1   \


[gcc r15-8018] Allow to build libgccjit with a soname bound to the GCC major version

2025-03-12 Thread Matthias Klose via Gcc-cvs
https://gcc.gnu.org/g:f1baee38ffe044ab0a7ecbacad965bbeafae7fc4

commit r15-8018-gf1baee38ffe044ab0a7ecbacad965bbeafae7fc4
Author: Matthias Klose 
Date:   Thu Mar 13 07:22:02 2025 +0100

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:
---
 gcc/Makefile.in  |  1 +
 gcc/configure| 24 ++--
 gcc/configure.ac | 15 +++
 gcc/doc/install.texi |  4 
 gcc/jit/Make-lang.in |  2 +-
 5 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 5477aea882ab..9ca389a9c619 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 86a5c75a146b..a34ae586d908 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-pieenable Position Independent Executable as default
   --enable-cetenable 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 <

[gcc r15-8019] Remove extra argument from subst macro

2025-03-12 Thread Matthias Klose via Gcc-cvs
https://gcc.gnu.org/g:6fe63cc1958d15c28916dc0324da254cd843d8a3

commit r15-8019-g6fe63cc1958d15c28916dc0324da254cd843d8a3
Author: Matthias Klose 
Date:   Thu Mar 13 07:26:04 2025 +0100

Remove extra argument from subst macro

2025-03-13  Matthias Klose  

* config-ml.in (multi-do): Remove extra argument from subst macro.

Diff:
---
 config-ml.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/config-ml.in b/config-ml.in
index 645cac822fdc..7934a1ddf4bd 100644
--- a/config-ml.in
+++ b/config-ml.in
@@ -517,8 +517,7 @@ multi-do:
libsuffix_=`$${compiler} $${flags} --print-multi-os-directory`; 
\
if (cd ../$${dir}/$${lib}; $(MAKE) $(subst \
-B$(build_tooldir)/lib/, \
-   -B$(build_tooldir)/lib/$${libsuffix_}/ \
-   -B$(build_tooldir)/lib/, \
+   -B$(build_tooldir)/lib/$${libsuffix_}/, \
$(FLAGS_TO_PASS)) \
CFLAGS="$(CFLAGS) $${flags}" \
CCASFLAGS="$(CCASFLAGS) $${flags}" \


[gcc r15-8258] Build and install gcobol driver for the cross build

2025-04-05 Thread Matthias Klose via Gcc-cvs
https://gcc.gnu.org/g:d1fd9da39abc4e0430fed46d14ebd2360324f8b8

commit r15-8258-gd1fd9da39abc4e0430fed46d14ebd2360324f8b8
Author: Matthias Klose 
Date:   Tue Mar 18 16:12:37 2025 +0100

Build and install gcobol driver for the cross build

gcc/cobol/

2025-03-18  Matthias Klose  

* Make-lang.in (GCOBC_TARGET_INSTALL_NAME, gcobol-cross): New.
(cobol.all.cross): Depend on gcobol-cross.
(cobol.install-common): Adjust install for the cross build.
(cobol.uninstall): Use *_INSTALL_NAME for uninstall.

Diff:
---
 gcc/cobol/Make-lang.in | 26 ++
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/gcc/cobol/Make-lang.in b/gcc/cobol/Make-lang.in
index eccc1c43f23b..5b61ae912192 100644
--- a/gcc/cobol/Make-lang.in
+++ b/gcc/cobol/Make-lang.in
@@ -38,6 +38,7 @@ GCOBOL_INSTALL_NAME := $(shell echo gcobol|sed 
'$(program_transform_name)')
 GCOBOL_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcobol|sed 
'$(program_transform_name)')
 
 GCOBC_INSTALL_NAME := $(shell echo gcobc|sed '$(program_transform_name)')
+GCOBC_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcobc|sed 
'$(program_transform_name)')
 
 cobol: cobol1$(exeext)
 cobol.serial = cobol1$(exeext)
@@ -149,6 +150,11 @@ gcobol$(exeext): \
 $(GCOBOL_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a  \
 $(EXTRA_GCC_LIBS) $(LIBS)
 
+# Create a version of the gcobol driver which calls the cross-compiler.
+gcobol-cross$(exeext): gcobol$(exeext)
+   -rm -f gcobol-cross$(exeext)
+   cp gcobol$(exeext) gcobol-cross$(exeext)
+
 #
 # These control the build of the cobol1 source-to-GENERIC converter
 #
@@ -277,17 +283,29 @@ cobol1$(exeext): $(cobol1_OBJS) $(BACKEND) $(LIBDEPS) 
attribs.o $(cobol.prev)
  $(cobol1_OBJS) $(BACKEND) $(LIBS) $(BACKENDLIBS)
@$(call LINK_PROGRESS,$(INDEX.cobol),end)
 
-# FIXME
-cobol.all.cross:
+cobol.all.cross: gcobol-cross$(exeext)
 
 cobol.start.encap: gcobol$(exeext)
 
 cobol.rest.encap:
 
 cobol.install-common: installdirs
+   -rm -f $(DESTDIR)$(bindir)/$(GCOBOL_INSTALL_NAME)$(exeext)
+   -rm -f $(DESTDIR)$(bindir)/$(GCOBC_INSTALL_NAME)$(exeext)
$(INSTALL_PROGRAM) gcobol$(exeext)  
$(DESTDIR)$(bindir)/$(GCOBOL_INSTALL_NAME)$(exeext)
$(INSTALL_PROGRAM) cobol1$(exeext)  $(DESTDIR)$(libexecsubdir)/
$(INSTALL) -m 755 $(srcdir)/cobol/gcobc 
$(DESTDIR)$(bindir)/$(GCOBC_INSTALL_NAME)$(exeext)
+   -if test -f cobol1$(exeext); then \
+ if test -f gcobol-cross$(exeext); then \
+   :; \
+ else \
+   rm -f $(DESTDIR)$(bindir)/$(GCOBOL_TARGET_INSTALL_NAME)$(exeext); \
+   rm -f $(DESTDIR)$(bindir)/$(GCOBC_TARGET_INSTALL_NAME)$(exeext); \
+   ( cd $(DESTDIR)$(bindir) && \
+ $(LN) $(GCOBOL_INSTALL_NAME)$(exeext) 
$(GCOBOL_TARGET_INSTALL_NAME)$(exeext) ); \
+ $(LN) $(GCOBC_INSTALL_NAME)$(exeext) 
$(GCOBC_TARGET_INSTALL_NAME)$(exeext) ); \
+ fi; \
+   fi
mkdir -p $(DESTDIR)$(datadir)/gcobol/udf
$(INSTALL_DATA) $(srcdir)/cobol/udf/*   $(DESTDIR)$(datadir)/gcobol/udf/
 
@@ -338,9 +356,9 @@ gcobol-io.html: $(srcdir)/cobol/gcobol.3
 # the installed location of the cobol1 compiler.
 cobol.uninstall:
rm -rf  $(DESTDIR)$(bindir)/$(GCOBOL_INSTALL_NAME)$(exeext) \
-   $(DESTDIR)$(bindir)/gcobc   \
+   $(DESTDIR)$(bindir)/$(GCOBC_INSTALL_NAME)   \
$(DESTDIR)$(datadir)/gcobol/\
-   $(DESTDIR)$(man1dir)/gcobol.1   \
+   $(DESTDIR)$(man1dir)/$(GCOBOL_INSTALL_NAME).1   \
$(DESTDIR)$(man3dir)/gcobol.3
 
 cobol.man: