From 4c344335fe0abc04308f4bfc62c6b3afc110240c Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 15 Aug 2024 07:39:31 +0000 Subject: [PATCH] 8338304: clang on Linux - check for lld presence after JDK-8333189 Reviewed-by: erikj, ihse --- make/autoconf/flags-ldflags.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/make/autoconf/flags-ldflags.m4 b/make/autoconf/flags-ldflags.m4 index a2d0d4e606a..fab8bec789b 100644 --- a/make/autoconf/flags-ldflags.m4 +++ b/make/autoconf/flags-ldflags.m4 @@ -71,7 +71,9 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER], LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r" if test "x$OPENJDK_TARGET_OS" = xlinux; then + # Clang needs the lld linker to work correctly BASIC_LDFLAGS="-fuse-ld=lld -Wl,--exclude-libs,ALL" + UTIL_REQUIRE_PROGS(LLD, lld) fi if test "x$OPENJDK_TARGET_OS" = xaix; then BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-bnolibpath -Wl,-bnoexpall \