From c1eb9665fce5f1ed8c538d885c6b22487d8529ca Mon Sep 17 00:00:00 2001 From: kevinw Date: Thu, 25 Oct 2018 04:34:20 -0700 Subject: [PATCH] 8211933: [8u] hotspot adlc needs to link statically with libstdc++ for gcc7.3 Reviewed-by: erikj --- make/linux/makefiles/adlc.make | 8 +++++++- make/linux/makefiles/gcc.make | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/make/linux/makefiles/adlc.make b/make/linux/makefiles/adlc.make index 8a866917b..92b8b9b39 100644 --- a/make/linux/makefiles/adlc.make +++ b/make/linux/makefiles/adlc.make @@ -105,9 +105,15 @@ GENERATEDFILES = $(GENERATEDNAMES:%=$(OUTDIR)/%) 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 diff --git a/make/linux/makefiles/gcc.make b/make/linux/makefiles/gcc.make index c9580f331..36b3c8ba9 100644 --- a/make/linux/makefiles/gcc.make +++ b/make/linux/makefiles/gcc.make @@ -277,6 +277,8 @@ endif # 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. -- GitLab