mesonbuild/meson

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

Open

#10,319 建立於 2022年4月27日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Python (4,978 star) (1,465 fork)batch import
buggood first issuelanguage:D

描述

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

貢獻者指南