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 <[email protected]>
This commit is contained in:
Rui UeyamaandClaude Opus 5.5 committed 2026-10-09 19:37:15 +09:00
1 parent 5aa155003d
commit ada2e80cc5
1 file changed
+4 -2
+4 -2
View File
@@ -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