Date: Fri, 26 Jan 2024 22:25:57 GMT From: Michael Osipov <michaelo@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org Subject: git: cfb52bd42c00 - 2024Q1 - java/openjdk{19,20,21}: fix build with lld 17 Message-ID: <202401262225.40QMPvGl018363@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch 2024Q1 has been updated by michaelo: URL: https://cgit.FreeBSD.org/ports/commit/?id=cfb52bd42c007e6e909bc915f8081a1b033a7bfd commit cfb52bd42c007e6e909bc915f8081a1b033a7bfd Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2023-11-12 20:00:48 +0000 Commit: Michael Osipov <michaelo@FreeBSD.org> CommitDate: 2024-01-26 22:25:04 +0000 java/openjdk{19,20,21}: fix build with lld 17 Building java/openjdk{19,20,21} with lld 17 results in the following link errors: ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZ21WB_HandshakeWalkStackE16TraceSelfClosure' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZ24WB_HandshakeReadMonitorsE19ReadMonitorsClosure' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZ26WB_AsyncHandshakeWalkStackE16TraceSelfClosure' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZL20reinitialize_itablesvE18ReinitTableClosure' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZN12JvmtiEnvBase27check_for_periodic_clean_upEvE28ThreadInsideIterationClosure' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZN15G1RemSetSummary6updateEvE11CollectData' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZN16SATBMarkQueueSet22set_active_all_threadsEbbE22SetThreadActiveClosure' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZN16SATBMarkQueueSet23abandon_partial_markingEvE25AbandonThreadQueueClosure' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZN18G1ConcurrentRefine30get_and_reset_refinement_statsEvE12CollectStats' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZN19G1DirtyCardQueueSet12abandon_logsEvE23AbandonThreadLogClosure' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZN19G1DirtyCardQueueSet16concatenate_logsEvE27ConcatenateThreadLogClosure' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZN19G1DirtyCardQueueSet30get_and_reset_refinement_statsEvE12CollectStats' failed: symbol not defined ld: error: version script assignment of 'SUNWprivate_1.1' to symbol '_ZTVZN7Threads25change_thread_claim_tokenEvE11ResetClaims' failed: symbol not defined This is because lld 17 defaults to errors when undefined symbols are referenced in linker version scripts. The problem is due to the Makefile JvmMapfile.gmk, which generates a linker version script. It uses "nm --defined-only" to dump symbols in object files, but this also includes local (hidden) symbols. Add "--extern-only" to make it only dump global symbols. PR: 276425 Approved by: otis (mentor), dim MFH: 2024Q1 Differential Revision: https://reviews.freebsd.org/D43620 (cherry picked from commit a1f91b22f1fc8ada691c47864c6365731cf8ef86) --- .../files/patch-make_hotspot_lib_JvmMapfile.gmk | 20 ++++++++++++++++++++ .../files/patch-make_hotspot_lib_JvmMapfile.gmk | 20 ++++++++++++++++++++ .../files/patch-make_hotspot_lib_JvmMapfile.gmk | 20 ++++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/java/openjdk19/files/patch-make_hotspot_lib_JvmMapfile.gmk b/java/openjdk19/files/patch-make_hotspot_lib_JvmMapfile.gmk new file mode 100644 index 000000000000..9ae03810886e --- /dev/null +++ b/java/openjdk19/files/patch-make_hotspot_lib_JvmMapfile.gmk @@ -0,0 +1,20 @@ +--- make/hotspot/lib/JvmMapfile.gmk.orig 2022-07-20 22:54:48 UTC ++++ make/hotspot/lib/JvmMapfile.gmk +@@ -53,7 +53,7 @@ ifeq ($(call isTargetOs, linux), true) + # platform dependent. + + ifeq ($(call isTargetOs, linux), true) +- DUMP_SYMBOLS_CMD := $(NM) --defined-only *.o ++ DUMP_SYMBOLS_CMD := $(NM) --extern-only --defined-only *.o + ifneq ($(FILTER_SYMBOLS_PATTERN), ) + FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)| + endif +@@ -134,7 +134,7 @@ else ifeq ($(call isTargetOs, bsd), true) + if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \ + }' + else +- DUMP_SYMBOLS_CMD := $(NM) --defined-only *.o ++ DUMP_SYMBOLS_CMD := $(NM) --extern-only --defined-only *.o + FILTER_SYMBOLS_AWK_SCRIPT := \ + '{ \ + if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \ diff --git a/java/openjdk20/files/patch-make_hotspot_lib_JvmMapfile.gmk b/java/openjdk20/files/patch-make_hotspot_lib_JvmMapfile.gmk new file mode 100644 index 000000000000..12bd16b87198 --- /dev/null +++ b/java/openjdk20/files/patch-make_hotspot_lib_JvmMapfile.gmk @@ -0,0 +1,20 @@ +--- make/hotspot/lib/JvmMapfile.gmk.orig 2024-01-26 16:33:03 UTC ++++ make/hotspot/lib/JvmMapfile.gmk +@@ -53,7 +53,7 @@ endif + # platform dependent. + + ifeq ($(call isTargetOs, linux), true) +- DUMP_SYMBOLS_CMD := $(NM) --defined-only *$(OBJ_SUFFIX) ++ DUMP_SYMBOLS_CMD := $(NM) --extern-only --defined-only *$(OBJ_SUFFIX) + ifneq ($(FILTER_SYMBOLS_PATTERN), ) + FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)| + endif +@@ -134,7 +134,7 @@ else ifeq ($(call isTargetOs, bsd), true) + if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \ + }' + else +- DUMP_SYMBOLS_CMD := $(NM) --defined-only *$(OBJ_SUFFIX) ++ DUMP_SYMBOLS_CMD := $(NM) --extern-only --defined-only *$(OBJ_SUFFIX) + FILTER_SYMBOLS_AWK_SCRIPT := \ + '{ \ + if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \ diff --git a/java/openjdk21/files/patch-make_hotspot_lib_JvmMapfile.gmk b/java/openjdk21/files/patch-make_hotspot_lib_JvmMapfile.gmk new file mode 100644 index 000000000000..12bd16b87198 --- /dev/null +++ b/java/openjdk21/files/patch-make_hotspot_lib_JvmMapfile.gmk @@ -0,0 +1,20 @@ +--- make/hotspot/lib/JvmMapfile.gmk.orig 2024-01-26 16:33:03 UTC ++++ make/hotspot/lib/JvmMapfile.gmk +@@ -53,7 +53,7 @@ endif + # platform dependent. + + ifeq ($(call isTargetOs, linux), true) +- DUMP_SYMBOLS_CMD := $(NM) --defined-only *$(OBJ_SUFFIX) ++ DUMP_SYMBOLS_CMD := $(NM) --extern-only --defined-only *$(OBJ_SUFFIX) + ifneq ($(FILTER_SYMBOLS_PATTERN), ) + FILTER_SYMBOLS_PATTERN := $(FILTER_SYMBOLS_PATTERN)| + endif +@@ -134,7 +134,7 @@ else ifeq ($(call isTargetOs, bsd), true) + if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \ + }' + else +- DUMP_SYMBOLS_CMD := $(NM) --defined-only *$(OBJ_SUFFIX) ++ DUMP_SYMBOLS_CMD := $(NM) --extern-only --defined-only *$(OBJ_SUFFIX) + FILTER_SYMBOLS_AWK_SCRIPT := \ + '{ \ + if ($$3 ~ /$(FILTER_SYMBOLS_PATTERN)/) print $$3; \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401262225.40QMPvGl018363>