diff --git a/make/autoconf/flags-ldflags.m4 b/make/autoconf/flags-ldflags.m4 index c4a75fb89c3..a2d0d4e606a 100644 --- a/make/autoconf/flags-ldflags.m4 +++ b/make/autoconf/flags-ldflags.m4 @@ -71,7 +71,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER], LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r" if test "x$OPENJDK_TARGET_OS" = xlinux; then - BASIC_LDFLAGS="-Wl,--exclude-libs,ALL" + BASIC_LDFLAGS="-fuse-ld=lld -Wl,--exclude-libs,ALL" fi if test "x$OPENJDK_TARGET_OS" = xaix; then BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-bnolibpath -Wl,-bnoexpall \ diff --git a/make/data/hotspot-symbols/version-script-clang.txt b/make/data/hotspot-symbols/version-script-clang.txt new file mode 100644 index 00000000000..351d64fdd1d --- /dev/null +++ b/make/data/hotspot-symbols/version-script-clang.txt @@ -0,0 +1,8 @@ +SUNWprivate_1.1 { + global: + *; + + local: + _fini; + _init; +}; diff --git a/make/data/hotspot-symbols/version-script.txt b/make/data/hotspot-symbols/version-script-gcc.txt similarity index 100% rename from make/data/hotspot-symbols/version-script.txt rename to make/data/hotspot-symbols/version-script-gcc.txt diff --git a/make/hotspot/lib/CompileJvm.gmk b/make/hotspot/lib/CompileJvm.gmk index ad374d57cee..dff7a159ae5 100644 --- a/make/hotspot/lib/CompileJvm.gmk +++ b/make/hotspot/lib/CompileJvm.gmk @@ -154,7 +154,7 @@ ifeq ($(call isTargetOs, windows), true) endif ifeq ($(call isTargetOs, linux), true) - HOTSPOT_VERSION_SCRIPT := $(TOPDIR)/make/data/hotspot-symbols/version-script.txt + HOTSPOT_VERSION_SCRIPT := $(TOPDIR)/make/data/hotspot-symbols/version-script-$(TOOLCHAIN_TYPE).txt JVM_LDFLAGS += -Wl,-version-script=$(HOTSPOT_VERSION_SCRIPT) endif