From 9090f54f4553648ea965cfbb3ba07538a5c3e0cd Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Tue, 13 Feb 2024 09:54:15 +0100 Subject: [PATCH] Re-added SHRLIB_SUFFIX change which avoids shared library version numbers for older RHEL7 versions because of backward compatibility problems with RPM. Remove the exception in CONFIG_SITE.Common.linuxCommon for release 7.0.8! Create links with full version shared library names to allow programs built against previous rpm version to run. --- configure/RULES_BUILD | 7 +++++++ configure/os/CONFIG.Common.RHEL7-x86_64 | 2 ++ configure/os/CONFIG.Common.RHEL7-x86_64-clang | 2 ++ configure/os/CONFIG.Common.RHEL8-x86_64 | 2 ++ configure/os/CONFIG.Common.RHEL8-x86_64-clang | 2 ++ configure/os/CONFIG.Common.RHEL9-x86_64 | 2 ++ configure/os/CONFIG.Common.RHEL9-x86_64-clang | 2 ++ configure/os/CONFIG.Common.linuxCommon | 6 +++++- configure/os/CONFIG_SITE.Common.linuxCommon | 6 ++++++ 9 files changed, 30 insertions(+), 1 deletion(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index e505b01c0..d49ea0e84 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -514,6 +514,13 @@ ifneq (,$(strip $(SHRLIB_VERSION))) @$(RM) $(subst $(SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE),$@) ln -s $< $(subst $(SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE),$@) endif # SHRLIB_VERSION +else # SHRLIB_SUFFIX +ifeq ($(BUILD_CLASS),HOST) +ifneq (,$(strip $(SHRLIB_VERSION))) + @$(RM) $@.$(SHRLIB_VERSION) + ln -s $< $@.$(SHRLIB_VERSION) +endif # HOST +endif # SHRLIB_VERSION endif # SHRLIB_SUFFIX ifneq ($(INSTALL_TCLLIB),$(INSTALL_BIN)) diff --git a/configure/os/CONFIG.Common.RHEL7-x86_64 b/configure/os/CONFIG.Common.RHEL7-x86_64 index 20853d74f..7960c4fa9 100644 --- a/configure/os/CONFIG.Common.RHEL7-x86_64 +++ b/configure/os/CONFIG.Common.RHEL7-x86_64 @@ -1,6 +1,8 @@ # Include definitions common to linux pentium targets include $(CONFIG)/os/CONFIG.Common.linux-x86_64 +BUILD_CLASS = HOST + TOOLSET_LOCATION = /opt/rh TOOLSET = devtoolset-12 STD_CXXFLAGS = -std=c++20 diff --git a/configure/os/CONFIG.Common.RHEL7-x86_64-clang b/configure/os/CONFIG.Common.RHEL7-x86_64-clang index fa50b4f9c..8653b569d 100644 --- a/configure/os/CONFIG.Common.RHEL7-x86_64-clang +++ b/configure/os/CONFIG.Common.RHEL7-x86_64-clang @@ -1 +1,3 @@ include $(CONFIG)/os/CONFIG.Common.linux-clang + +BUILD_CLASS = HOST diff --git a/configure/os/CONFIG.Common.RHEL8-x86_64 b/configure/os/CONFIG.Common.RHEL8-x86_64 index 5673dc729..2f1d4bc9e 100644 --- a/configure/os/CONFIG.Common.RHEL8-x86_64 +++ b/configure/os/CONFIG.Common.RHEL8-x86_64 @@ -1,6 +1,8 @@ # Include definitions common to linux pentium targets include $(CONFIG)/os/CONFIG.Common.linux-x86_64 +BUILD_CLASS = HOST + TOOLSET_LOCATION = /opt/rh TOOLSET = gcc-toolset-12 STD_CXXFLAGS = -std=c++20 diff --git a/configure/os/CONFIG.Common.RHEL8-x86_64-clang b/configure/os/CONFIG.Common.RHEL8-x86_64-clang index b93ce65ff..b07b8b65e 100644 --- a/configure/os/CONFIG.Common.RHEL8-x86_64-clang +++ b/configure/os/CONFIG.Common.RHEL8-x86_64-clang @@ -1,3 +1,5 @@ include $(CONFIG)/os/CONFIG.Common.linux-clang +BUILD_CLASS = HOST + STD_CXXFLAGS = -std=c++2a diff --git a/configure/os/CONFIG.Common.RHEL9-x86_64 b/configure/os/CONFIG.Common.RHEL9-x86_64 index 5673dc729..2f1d4bc9e 100644 --- a/configure/os/CONFIG.Common.RHEL9-x86_64 +++ b/configure/os/CONFIG.Common.RHEL9-x86_64 @@ -1,6 +1,8 @@ # Include definitions common to linux pentium targets include $(CONFIG)/os/CONFIG.Common.linux-x86_64 +BUILD_CLASS = HOST + TOOLSET_LOCATION = /opt/rh TOOLSET = gcc-toolset-12 STD_CXXFLAGS = -std=c++20 diff --git a/configure/os/CONFIG.Common.RHEL9-x86_64-clang b/configure/os/CONFIG.Common.RHEL9-x86_64-clang index b93ce65ff..b07b8b65e 100644 --- a/configure/os/CONFIG.Common.RHEL9-x86_64-clang +++ b/configure/os/CONFIG.Common.RHEL9-x86_64-clang @@ -1,3 +1,5 @@ include $(CONFIG)/os/CONFIG.Common.linux-clang +BUILD_CLASS = HOST + STD_CXXFLAGS = -std=c++2a diff --git a/configure/os/CONFIG.Common.linuxCommon b/configure/os/CONFIG.Common.linuxCommon index 93da73887..e689fe668 100644 --- a/configure/os/CONFIG.Common.linuxCommon +++ b/configure/os/CONFIG.Common.linuxCommon @@ -35,9 +35,13 @@ PRODDIR_RPATH_LDFLAGS_ORIGIN = $(shell $(MAKERPATH) -O '\$$ORIGIN' -F $(FINAL_DI PRODDIR_LDFLAGS += \ $(PRODDIR_RPATH_LDFLAGS_$(LINKER_USE_RPATH)) +# Make sure hosts tools find their libraries during build even if +# FINAL_LOCATION differs from INSTALL_LOCATION ifneq ($(LINKER_USE_RPATH:NO=),) ifeq ($(T_A),$(EPICS_HOST_ARCH)) -LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH:%=%:)$(INSTALL_LIB) +ifneq ($(FINAL_LOCATION:$(INSTALL_LOCATION)=),) +export LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH:%=%:)$(INSTALL_LIB) +endif endif endif diff --git a/configure/os/CONFIG_SITE.Common.linuxCommon b/configure/os/CONFIG_SITE.Common.linuxCommon index 80818f04e..20c5a5420 100644 --- a/configure/os/CONFIG_SITE.Common.linuxCommon +++ b/configure/os/CONFIG_SITE.Common.linuxCommon @@ -21,3 +21,9 @@ TARGET_LDFLAGS += $(SYSROOT:%=--sysroot=%) ifeq ($(filter SL% RHEL%,$(T_A)),) VALID_BUILDS = Ioc Command endif + +# backward compatibility: Keep unversioned libs for older linux versions +ifneq ($(filter SL% RHEL7% RHEL8%,$(T_A)),) +SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) +LOADABLE_SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE) +endif