From patchwork Thu Jan 19 11:22:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 63396 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 583793858434 for ; Thu, 19 Jan 2023 11:22:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 583793858434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674127378; bh=dzmgSyD/jEzOV0UzlCGJdnpAG9iqiNugqiLYiyrL4S8=; h=Date:To:cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=WmTMks+ZNbb5wsgHnIPXZs10ik+iKdIG+gFZIFfemoxEVO0Inb+5DxJdVDvgXqxDC H1/whq7/xPll4Ka4QGuYrpOSmL4HLYsClzVFH8nQqzzH630QtlhOxBo5cALaK9AtZm XjMguZeBtF3X+EjjnXfEfm053phm6NNfoFCz3Yag= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id B42273858416 for ; Thu, 19 Jan 2023 11:22:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B42273858416 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BA07538373; Thu, 19 Jan 2023 11:22:28 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A1ADC134F5; Thu, 19 Jan 2023 11:22:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /bY5JvQnyWPsOgAAMHmgww (envelope-from ); Thu, 19 Jan 2023 11:22:28 +0000 Date: Thu, 19 Jan 2023 12:22:28 +0100 (CET) To: gcc-patches@gcc.gnu.org cc: gaiusmod2@gmail.com Subject: [PATCH] modula2/108144 - fix --enable-version-specific-runtime-libs MIME-Version: 1.0 Message-Id: <20230119112228.A1ADC134F5@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The following fixes --enable-version-specific-runtime-libs for the modula2 target libraries. The issue is that the install happens via for example toolexeclib_LTLIBRARIES = libm2cor.la and toolexeclibdir is set to $(toolexecdir)/$(gcc_version)$(MULTISUBDIR) but the Makefile.am do not define $(gcc_version) but instead $(version) which is used locally to define libsubdir. The fix is to consistently define and use $(gcc_version), also properly supporting --with-gcc-major-version-only Built and installed on x86_64-unknown-linux-gnu with --enable-version-specific-runtime-libs and --with-gcc-major-version-only. OK? Thanks, Richard. PR modula2/108144 libgm2/ * configure.ac: Add GCC_BASE_VER. * configure: Re-generate. * Makefile.am: Use @get_gcc_base_ver@ for gcc_version. * libm2cor/Makefile.am: Likewise. Use gcc_version instead of version. * libm2iso/Makefile.am: Likewise. * libm2log/Makefile.am: Likewise. * libm2min/Makefile.am: Likewise. * libm2pim/Makefile.am: Likewise. * Makefile.in: Re-generate. * libm2cor/Makefile.in: Likewise. * libm2iso/Makefile.in: Likewise. * libm2log/Makefile.in: Likewise. * libm2min/Makefile.in: Likewise. * libm2pim/Makefile.in: Likewise. --- libgm2/Makefile.am | 2 +- libgm2/Makefile.in | 3 ++- libgm2/configure | 23 +++++++++++++++++++++-- libgm2/configure.ac | 3 +++ libgm2/libm2cor/Makefile.am | 4 ++-- libgm2/libm2cor/Makefile.in | 5 +++-- libgm2/libm2iso/Makefile.am | 4 ++-- libgm2/libm2iso/Makefile.in | 5 +++-- libgm2/libm2log/Makefile.am | 4 ++-- libgm2/libm2log/Makefile.in | 5 +++-- libgm2/libm2min/Makefile.am | 4 ++-- libgm2/libm2min/Makefile.in | 5 +++-- libgm2/libm2pim/Makefile.am | 4 ++-- libgm2/libm2pim/Makefile.in | 5 +++-- 14 files changed, 52 insertions(+), 24 deletions(-) diff --git a/libgm2/Makefile.am b/libgm2/Makefile.am index 88d12ee325e..524ea6c7124 100644 --- a/libgm2/Makefile.am +++ b/libgm2/Makefile.am @@ -32,7 +32,7 @@ MAKEOVERRIDES= AM_CFLAGS = -I $(srcdir)/../libgcc -I $(MULTIBUILDTOP)../../gcc/include -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) TOP_GCCDIR := $(shell cd $(top_srcdir) && cd .. && pwd) GCC_DIR = $(TOP_GCCDIR)/gcc diff --git a/libgm2/Makefile.in b/libgm2/Makefile.in index ec9094b345d..ac01eafe45c 100644 --- a/libgm2/Makefile.in +++ b/libgm2/Makefile.in @@ -264,6 +264,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -336,7 +337,7 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Multilib support. MAKEOVERRIDES = AM_CFLAGS = -I $(srcdir)/../libgcc -I $(MULTIBUILDTOP)../../gcc/include -gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) TOP_GCCDIR := $(shell cd $(top_srcdir) && cd .. && pwd) GCC_DIR = $(TOP_GCCDIR)/gcc GM2_SRC = $(GCC_DIR)/m2 diff --git a/libgm2/configure b/libgm2/configure index 922b0715964..8b2c28cb163 100755 --- a/libgm2/configure +++ b/libgm2/configure @@ -634,6 +634,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +get_gcc_base_ver TARGET_DARWIN_FALSE TARGET_DARWIN_TRUE BUILD_LOGLIB_FALSE @@ -805,6 +806,7 @@ with_pic enable_fast_install with_gnu_ld enable_libtool_lock +with_gcc_major_version_only ' ac_precious_vars='build_alias host_alias @@ -1464,6 +1466,8 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-gcc-major-version-only + use only GCC major number in filesystem paths Some influential environment variables: CC C compiler command @@ -12700,7 +12704,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12703 "configure" +#line 12707 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12806,7 +12810,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12809 "configure" +#line 12813 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19696,6 +19700,21 @@ else fi +# Determine what GCC version number to use in filesystem paths. + + get_gcc_base_ver="cat" + +# Check whether --with-gcc-major-version-only was given. +if test "${with_gcc_major_version_only+set}" = set; then : + withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then + get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'" + fi + +fi + + + + ac_config_files="$ac_config_files Makefile libm2min/Makefile libm2pim/Makefile libm2iso/Makefile libm2cor/Makefile libm2log/Makefile" diff --git a/libgm2/configure.ac b/libgm2/configure.ac index 2f7fe0d9e08..c2732943c21 100644 --- a/libgm2/configure.ac +++ b/libgm2/configure.ac @@ -381,6 +381,9 @@ AM_CONDITIONAL([BUILD_CORLIB], [test x$BUILD_CORLIB = xtrue]) AM_CONDITIONAL([BUILD_LOGLIB], [test x$BUILD_LOGLIB = xtrue]) AM_CONDITIONAL([TARGET_DARWIN], [test x$M2_TARGET_OS = xdarwin]) +# Determine what GCC version number to use in filesystem paths. +GCC_BASE_VER + AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_FILES([Makefile libm2min/Makefile libm2pim/Makefile libm2iso/Makefile libm2cor/Makefile libm2log/Makefile]) diff --git a/libgm2/libm2cor/Makefile.am b/libgm2/libm2cor/Makefile.am index 076ac08cc30..3f4b5085d1a 100644 --- a/libgm2/libm2cor/Makefile.am +++ b/libgm2/libm2cor/Makefile.am @@ -24,10 +24,10 @@ VPATH = . @srcdir@ @srcdir@/../../gcc/m2/gm2-libs-coroutines # Multilib support. MAKEOVERRIDES= -version := $(shell $(CC) -dumpversion) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) # Used to install the shared libgcc. slibdir = @slibdir@ diff --git a/libgm2/libm2cor/Makefile.in b/libgm2/libm2cor/Makefile.in index cef367e008f..2820a8a6f96 100644 --- a/libgm2/libm2cor/Makefile.in +++ b/libgm2/libm2cor/Makefile.in @@ -340,6 +340,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -387,10 +388,10 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Multilib support. MAKEOVERRIDES = -version := $(shell $(CC) -dumpversion) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory) MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory) MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi) diff --git a/libgm2/libm2iso/Makefile.am b/libgm2/libm2iso/Makefile.am index fc0e4f5bd1a..90917bbba7b 100644 --- a/libgm2/libm2iso/Makefile.am +++ b/libgm2/libm2iso/Makefile.am @@ -24,10 +24,10 @@ VPATH = . @srcdir@ @srcdir@/../../gcc/m2/gm2-libs-iso # Multilib support. MAKEOVERRIDES= -version := $(shell $(CC) -dumpversion) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) # Used to install the shared libgcc. # was slibdir = @slibdir@ slibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR) diff --git a/libgm2/libm2iso/Makefile.in b/libgm2/libm2iso/Makefile.in index e628dd33631..fe77b9d3697 100644 --- a/libgm2/libm2iso/Makefile.in +++ b/libgm2/libm2iso/Makefile.in @@ -364,6 +364,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -412,10 +413,10 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Multilib support. MAKEOVERRIDES = -version := $(shell $(CC) -dumpversion) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory) MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory) MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi) diff --git a/libgm2/libm2log/Makefile.am b/libgm2/libm2log/Makefile.am index f8261b9dc5a..915438e3ec9 100644 --- a/libgm2/libm2log/Makefile.am +++ b/libgm2/libm2log/Makefile.am @@ -24,10 +24,10 @@ VPATH = . @srcdir@ @srcdir@/../../gcc/m2/gm2-libs-pim # Multilib support. MAKEOVERRIDES= -version := $(shell $(CC) -dumpversion) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) # Used to install the shared libgcc. slibdir = @slibdir@ diff --git a/libgm2/libm2log/Makefile.in b/libgm2/libm2log/Makefile.in index 15e0a5fc2c6..47a980c771a 100644 --- a/libgm2/libm2log/Makefile.in +++ b/libgm2/libm2log/Makefile.in @@ -329,6 +329,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -376,10 +377,10 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Multilib support. MAKEOVERRIDES = -version := $(shell $(CC) -dumpversion) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory) MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory) MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi) diff --git a/libgm2/libm2min/Makefile.am b/libgm2/libm2min/Makefile.am index 4d7726662e7..b2f145a63be 100644 --- a/libgm2/libm2min/Makefile.am +++ b/libgm2/libm2min/Makefile.am @@ -24,10 +24,10 @@ VPATH = . @srcdir@/../../gcc/m2/gm2-libs-min # Multilib support. MAKEOVERRIDES= -version := $(shell $(CC) -dumpversion) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) # Used to install the shared libgcc. slibdir = @slibdir@ diff --git a/libgm2/libm2min/Makefile.in b/libgm2/libm2min/Makefile.in index f8319959988..efbfe09b0a8 100644 --- a/libgm2/libm2min/Makefile.in +++ b/libgm2/libm2min/Makefile.in @@ -319,6 +319,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -366,10 +367,10 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Multilib support. MAKEOVERRIDES = -version := $(shell $(CC) -dumpversion) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory) MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory) MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi) diff --git a/libgm2/libm2pim/Makefile.am b/libgm2/libm2pim/Makefile.am index 98c9ca14579..c1a189adb91 100644 --- a/libgm2/libm2pim/Makefile.am +++ b/libgm2/libm2pim/Makefile.am @@ -24,10 +24,10 @@ VPATH = . @srcdir@ @srcdir@/../../gcc/m2/gm2-libs # Multilib support. MAKEOVERRIDES= -version := $(shell $(CC) -dumpversion) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) # Used to install the shared libgcc. slibdir = @slibdir@ diff --git a/libgm2/libm2pim/Makefile.in b/libgm2/libm2pim/Makefile.in index ab05ca9fb49..44ee4e28426 100644 --- a/libgm2/libm2pim/Makefile.in +++ b/libgm2/libm2pim/Makefile.in @@ -354,6 +354,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +get_gcc_base_ver = @get_gcc_base_ver@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -401,10 +402,10 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../config # Multilib support. MAKEOVERRIDES = -version := $(shell $(CC) -dumpversion) +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(version) +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory) MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory) MULTIOSSUBDIR := $(shell if test x$(MULTIOSDIR) != x.; then echo /$(MULTIOSDIR); fi)