mesonbuild/meson

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

Offen

#10.319 geöffnet am 27.04.2022

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (1.465 Forks)batch import
buggood first issuelanguage:D

Repository-Metriken

Stars
 (4.978 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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

Contributor Guide