Skip to content

Commit 8da2bc7

Browse files
committed
[meson] Provide Language-specific Linker Definitions
This is a new feature of meson v0.53.1 which chooses the linker in a language-specific manner. We just set the linker for C and C++ to explicitly be riscv32-unknown-elf-ld, the linker we normally use. In the clang builds, this will be passed with `clang -fuse-ld=<path>` which should work correctly, but uses the clang driver to establish all the right arguments to pass down to the linker. Signed-off-by: Sam Elliott <selliott@lowrisc.org>
1 parent 29745b4 commit 8da2bc7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

generate-clang-meson-cross-file.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ c = '${toolchain_dest}/bin/${toolchain_target}-clang'
6767
cpp = '${toolchain_dest}/bin/${toolchain_target}-clang++'
6868
ar = '${toolchain_dest}/bin/${toolchain_target}-ar'
6969
ld = '${toolchain_dest}/bin/${toolchain_target}-ld'
70+
c_ld = '${toolchain_dest}/bin/${toolchain_target}-ld'
71+
cpp_ld = '${toolchain_dest}/bin/${toolchain_target}-ld'
7072
objdump = '${toolchain_dest}/bin/${toolchain_target}-objdump'
7173
objcopy = '${toolchain_dest}/bin/${toolchain_target}-objcopy'
7274
strip = '${toolchain_dest}/bin/${toolchain_target}-strip'

generate-gcc-meson-cross-file.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ c = '${toolchain_dest}/bin/${toolchain_target}-gcc'
6363
cpp = '${toolchain_dest}/bin/${toolchain_target}-g++'
6464
ar = '${toolchain_dest}/bin/${toolchain_target}-ar'
6565
ld = '${toolchain_dest}/bin/${toolchain_target}-ld'
66+
c_ld = '${toolchain_dest}/bin/${toolchain_target}-ld'
67+
cpp_ld = '${toolchain_dest}/bin/${toolchain_target}-ld'
6668
objdump = '${toolchain_dest}/bin/${toolchain_target}-objdump'
6769
objcopy = '${toolchain_dest}/bin/${toolchain_target}-objcopy'
6870
strip = '${toolchain_dest}/bin/${toolchain_target}-strip'

0 commit comments

Comments
 (0)