mmomtchev / hadron

The Meson Build System (with `node-api` module)
http://mesonbuild.com
Apache License 2.0
1 stars 0 forks source link

Using `native: true` when not cross-compiling with a non-standard linker causes misidentification of the linker #41

Open mmomtchev opened 6 hours ago

mmomtchev commented 6 hours ago

Describe the bug When not cross-building, using native: true leads to some options not being picked up

To Reproduce

project('lld', ['c'])
executable('main', 'main.c', native: true)
[binaries]
c = 'clang'
ld = 'ld.lld'
strip = 'llvm-strip'

[built-in options]
c_link_args = ['-fuse-ld=lld']

works (linker is correctly identified)

meson.py setup --native-file ../nativefile.ini --cross-file ../nativefile.ini ..

does not work (linker is not correctly identified)

meson.py setup --native-file ../nativefile.ini ..

This can lead to build failures when ld is not installed.

Expected behavior When not cross-building, native: true has no effect

system parameters All UNIX with clang

mmomtchev commented 6 hours ago

Upstream bug