mesonbuild/meson

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

Ouverte

#10 319 ouverte le 27 avr. 2022

 (0 commentaire) (0 réaction) (0 personne assignée)Python (1 465 forks)batch import
buggood first issuelanguage:D

Métriques du dépôt

Stars
 (4 978 étoiles)
Métriques de merge PR
 (Merge moyen 139j 13h) (51 PRs mergées en 30 j)

Description

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

Guide contributeur