mesonbuild/meson

Building DLang shared library on MacOS ARM64 fails in the latest version of meson

Open

#10.319 aperta il 27 apr 2022

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Python (1465 fork)batch import
buggood first issuelanguage:D

Metriche repository

Star
 (4978 star)
Metriche merge PR
 (Merge medio 30g 19h) (63 PR mergiate in 30 g)

Descrizione

Describe the bug Using meson versions higher than 0.53.2 the building of DLang shared libraries will fail if you try to cross-compile them for macOS ARM64.

Output with meson > 0.53.2

[2/2] Linking target liblib.so
FAILED: liblib.so 
ldc2  -of=liblib.so liblib.so.p/lib.d.o -L=-install_name -L=@rpath/liblib.dylib -L=-headerpad_max_install_names -L=-undefined,dynamic_lookup -link-defaultlib-shared -shared -relocation-model=pic --mtriple=arm64-apple-macos
ld: unknown option: -undefined,dynamic_lookup
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: /usr/bin/cc failed with status: 1

Output with meson == 0.53.2

[2/2] Linking target liblib.so.
ld: warning: directory not found for option '-L-undefined,dynamic_lookup'

As you can see with meson 0.53.2 we get a warning but the library is successfully compiled, while with more recent meson the compilation fails.

To Reproduce See https://github.com/ErnyTech/MacOS_ARM_Meson_Issue

system parameters

  • what operating system: MacOS 11.6.5 in Github Actions

Guida contributor