RFR(8u): 8211933: [8u] hotspot adlc needs to link statically with libstdc++ for gcc7.3 (original) (raw)
Erik Joelsson erik.joelsson at oracle.com
Wed Oct 24 23:26:40 UTC 2018
- Previous message (by thread): RFR(8u): 8211933: [8u] hotspot adlc needs to link statically with libstdc++ for gcc7.3
- Next message (by thread): build openjdk8 on ubuntu18.04.1
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Looks good to me.
/Erik
On 2018-10-24 16:16, Kevin Walls wrote:
Hi,
I'd like to get a review of an 8u change: 8211933: [8u] hotspot adlc needs to link statically with libstdc++ for gcc7.3 https://bugs.openjdk.java.net/browse/JDK-8211933 webrev: http://cr.openjdk.java.net/~kevinw/8211933/webrev.00/ Essentially adds -static-libstdc++ for linking adlc during an 8u build. This is needed e.g. when we build with gcc7.x using our devkit bundle and we won't necessarily find a correct version of that library on the system. (Things are still very different in 9+ compared to 8u, despite all our changes this year...) I find that changing the definition of STATICSTDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic ...in gcc.make is a problem, the linked VM fails to load with _"undefined symbol: cxapurevirtual" If using STATICSTDCXX as it's already defined, to build adlc, then adlc doesn't statically link again libcstd and it gives the symbol version not found error. So defining a separate STATIC... var for adlc keeps everyone happy. Many thanks Kevin
bash-4.2$ cd jdk8u-dev/hotspot bash-4.2$ hg diff diff -r 992120803410 make/linux/makefiles/adlc.make --- a/make/linux/makefiles/adlc.make Mon Oct 22 05:26:38 2018 -0400 +++ b/make/linux/makefiles/adlc.make Wed Oct 24 16:15:07 2018 -0700 @@ -105,9 +105,15 @@ all: $(EXEC) +ADLCLDFLAGS= +ifeq ($(STATICCXX), true) + ADLCLDFLAGS = (STATICLIBGCC)(STATICLIBGCC) (STATICLIBGCC)(ADLCSTATICSTDCXX) +endif + + $(EXEC) : $(OBJECTS) @echo Making adlc - (QUIETLY)(QUIETLY) (QUIETLY)(filter-out (ARCHFLAG),(ARCHFLAG),(ARCHFLAG),(HOST.LINKNOPROF.CXX)) -o (EXEC)(EXEC) (EXEC)(OBJECTS) + (QUIETLY)(QUIETLY) (QUIETLY)(filter-out (ARCHFLAG),(ARCHFLAG),(ARCHFLAG),(HOST.LINKNOPROF.CXX)) $(ADLCLDFLAGS) -o (EXEC)(EXEC) (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 -r 992120803410 make/linux/makefiles/gcc.make --- a/make/linux/makefiles/gcc.make Mon Oct 22 05:26:38 2018 -0400 +++ b/make/linux/makefiles/gcc.make Wed Oct 24 16:15:07 2018 -0700 @@ -277,6 +277,8 @@ # statically link libstdc++.so, work with gcc but ignored by g++ STATICSTDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic +# While the VM needs the above line, adlc needs a separate setting: +ADLCSTATICSTDCXX = -static-libstdc++ ifeq ($(USECLANG),) # statically link libgcc and/or libgccs, libgcc does not exist before gcc-3.x. bash-4.2$
- Previous message (by thread): RFR(8u): 8211933: [8u] hotspot adlc needs to link statically with libstdc++ for gcc7.3
- Next message (by thread): build openjdk8 on ubuntu18.04.1
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]