Skip to content

Commit 0935ba9

Browse files
SendaoYanmagicus
SendaoYan
andcommittedMar 26, 2025
8352481: Enforce the use of lld with clang
Co-authored-by: Magnus Ihse Bursie <ihse@openjdk.org> Reviewed-by: ihse, erikj
1 parent dbc620f commit 0935ba9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎make/autoconf/toolchain.m4

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -620,6 +620,13 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
620620
# All other toolchains use the compiler to link.
621621
LD="$CC"
622622
LDCXX="$CXX"
623+
# Force use of lld, since that is what we expect when setting flags later on
624+
if test "x$TOOLCHAIN_TYPE" = xclang; then
625+
if test "x$OPENJDK_BUILD_OS" != "xmacosx"; then
626+
LD="$LD -fuse-ld=lld"
627+
LDCXX="$LDCXX -fuse-ld=lld"
628+
fi
629+
fi
623630
fi
624631
AC_SUBST(LD)
625632
# FIXME: it should be CXXLD, according to standard (cf CXXCPP)

0 commit comments

Comments
 (0)
Please sign in to comment.