changeset 8994:359ded4897e9

8211933: [8u] hotspot adlc needs to link statically with libstdc++ for gcc7.3 Reviewed-by: erikj
author kevinw
date Thu, 25 Oct 2018 04:34:20 -0700
parents 992120803410
children fca71ba6b6ce
files make/linux/makefiles/adlc.make make/linux/makefiles/gcc.make
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/make/linux/makefiles/adlc.make	Mon Oct 22 05:26:38 2018 -0400
+++ b/make/linux/makefiles/adlc.make	Thu Oct 25 04:34:20 2018 -0700
@@ -105,9 +105,15 @@
 
 all: $(EXEC)
 
+ADLC_LD_FLAGS=
+ifeq ($(STATIC_CXX), true)
+  ADLC_LD_FLAGS = $(STATIC_LIBGCC) $(ADLC_STATIC_STDCXX)
+endif
+
+
 $(EXEC) : $(OBJECTS)
 	@echo Making adlc
-	$(QUIETLY) $(filter-out $(ARCHFLAG),$(HOST.LINK_NOPROF.CXX)) -o $(EXEC) $(OBJECTS)
+	$(QUIETLY) $(filter-out $(ARCHFLAG),$(HOST.LINK_NOPROF.CXX)) $(ADLC_LD_FLAGS) -o $(EXEC) $(OBJECTS)
 
 # Random dependencies:
 $(OBJECTS): opcodes.hpp classes.hpp adlc.hpp adlcVMDeps.hpp adlparse.hpp archDesc.hpp arena.hpp dict2.hpp filebuff.hpp forms.hpp formsopt.hpp formssel.hpp
--- a/make/linux/makefiles/gcc.make	Mon Oct 22 05:26:38 2018 -0400
+++ b/make/linux/makefiles/gcc.make	Thu Oct 25 04:34:20 2018 -0700
@@ -277,6 +277,8 @@
 
 # statically link libstdc++.so, work with gcc but ignored by g++
 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+# While the VM needs the above line, adlc needs a separate setting:
+ADLC_STATIC_STDCXX = -static-libstdc++
 
 ifeq ($(USE_CLANG),)
   # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.