From ada2e80cc5f54c754cf23166e331964ed6ca8ec5 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 9 Oct 2026 19:37:15 +0900 Subject: [PATCH] Name the toolchain copy of mold ld64.mold in lto-library-default The test linked mold into a toolchain's bin directory as ld, but mold acts as the Mach-O linker only under the name ld64.mold, so the copy ran the ELF linker and failed on -arch. The test checks that the linker loads the libLTO in lib beside its bin directory, which doesn't depend on the name. Co-Authored-By: Claude Opus 5.5 --- tests/macho/lto-library-default.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/macho/lto-library-default.sh b/tests/macho/lto-library-default.sh index c65c264c1..c62a93562 100755 --- a/tests/macho/lto-library-default.sh +++ b/tests/macho/lto-library-default.sh @@ -11,13 +11,15 @@ EOF # Without -lto_library, the linker takes the libLTO in lib beside the # bin directory it runs from, as ld-prime links its toolchain's. (The # system's ld is a shim that can't run from a copy; it finds Xcode's.) +# The copy keeps the name ld64.mold, under which mold acts as the Mach-O +# linker. ld=$mold if is_mold; then rm -rf $t/tc mkdir -p $t/tc/bin $t/tc/lib - ln $mold $t/tc/bin/ld 2> /dev/null || cp $mold $t/tc/bin/ld + ln $mold $t/tc/bin/ld64.mold 2> /dev/null || cp $mold $t/tc/bin/ld64.mold ln -s $lto_library $t/tc/lib/libLTO.dylib - ld=$t/tc/bin/ld + ld=$t/tc/bin/ld64.mold fi $ld -arch $ARCH -platform_version ${PLATFORM_VERSION:-macos 13.0 13.0} -syslibroot $SDK -lSystem $t/a.o -o $t/exe $RUN $t/exe | grep -q Hello