Skip to content

Commit 4a3eb39

Browse files
committed
[libcxx][CI] Use lld for everything in the ARM picolib builds
Our host compiler is a clang install that will default to ld if not told otherwise. We were telling meson to use lld, but the way that we did it was outdated, which lead to picolib producing a linker script that lld could not use. Using the `c_ld` setting fixes this problem. See: https://mesonbuild.com/Machine-files.html#binaries Then to use lld in tests we need `-fuse-ld=lld` in the config files.
1 parent af53104 commit 4a3eb39

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

libcxx/cmake/caches/Armv7M-picolibc.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set(CMAKE_C_COMPILER_TARGET "armv7m-none-eabi" CACHE STRING "")
55
set(CMAKE_C_FLAGS "-mfloat-abi=soft" CACHE STRING "")
66
set(CMAKE_SYSTEM_NAME Generic CACHE STRING "")
77
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "")
8+
set(LLVM_USE_LINKER "lld" CACHE STRING "")
89
set(COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL "")
910
set(COMPILER_RT_BUILD_LIBFUZZER OFF CACHE BOOL "")
1011
set(COMPILER_RT_BUILD_PROFILE OFF CACHE BOOL "")

libcxx/test/configs/armv7m-picolibc-libc++.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ config.substitutions.append(('%{compile_flags}',
1313
' -Wno-atomic-alignment'
1414
))
1515
config.substitutions.append(('%{link_flags}',
16-
'-nostdlib -nostdlib++ -L %{lib-dir} -lc++ -lc++abi'
16+
'-fuse-ld=lld -nostdlib -nostdlib++ -L %{lib-dir} -lc++ -lc++abi'
1717
' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' +
1818
' -T {}'.format(libc_linker_script) +
1919
' -Wl,--defsym=__flash=0x0'

libcxx/utils/ci/build-picolibc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ cat <<EOF > "${picolibc_build_dir}/meson-cross-build.txt"
8181
c = ['${CC:-cc}', '--target=${target}', '-mfloat-abi=soft', '-nostdlib']
8282
ar = 'llvm-ar'
8383
as = 'llvm-as'
84-
ld = 'lld'
84+
c_ld = 'lld'
8585
strip = 'llvm-strip'
8686
[host_machine]
8787
system = 'none'

libcxxabi/test/configs/armv7m-picolibc-libc++abi.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ config.substitutions.append(('%{compile_flags}',
88
'-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS'
99
))
1010
config.substitutions.append(('%{link_flags}',
11-
'-nostdlib -nostdlib++ -L %{lib} -lc++ -lc++abi'
11+
'-fuse-ld=lld -nostdlib -nostdlib++ -L %{lib} -lc++ -lc++abi'
1212
' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' +
1313
' -T {}'.format(libc_linker_script) +
1414
' -Wl,--defsym=__flash=0x0'

libunwind/test/configs/armv7m-picolibc-libunwind.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ config.substitutions.append(('%{compile_flags}',
88
'-nostdinc++ -I %{include}'
99
))
1010
config.substitutions.append(('%{link_flags}',
11-
'-nostdlib -nostdlib++ -L %{lib} -lunwind'
11+
'-fuse-ld=lld -nostdlib -nostdlib++ -L %{lib} -lunwind'
1212
' -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost' +
1313
' -T {}'.format(libc_linker_script) +
1414
' -Wl,--defsym=__flash=0x0'

0 commit comments

Comments
 (0)