diff --git a/_build.sh b/_build.sh index 0476bd160..3ced1be00 100755 --- a/_build.sh +++ b/_build.sh @@ -1248,6 +1248,10 @@ build_single_target() { ccrtlib="-l${ccrtlib%.*}" # clang_rt.builtins-aarch64 or gcc libprefix="/usr/${_TRIPLETSH}/lib" _LDFLAGS_GLOBAL="${_LDFLAGS_GLOBAL} -nodefaultlibs -L${libprefix} -L${ccrtdir}" + # lld by default wants to load startfiles from + # /usr/bin/../lib/gcc-cross/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/lib/ + # or similar. + _LDFLAGS_GLOBAL="${_LDFLAGS_GLOBAL} -nostartfiles ${libprefix}/Scrt1.o ${libprefix}/crti.o ${libprefix}/crtn.o" _LIBS_GLOBAL="${_LIBS_GLOBAL} -lc ${ccrtlib}" fi _LDFLAGS_GLOBAL="${_LDFLAGS_GLOBAL} -rtlib=compiler-rt"