mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.62k stars 1.63k forks source link

macOS does not like -undefined dynamic_lookup anymore #10894

Open petere opened 2 years ago

petere commented 2 years ago

Any use of -undefined dynamic_lookup on macOS now appears to draw a warning.

Example project:

project('foo', ['c'], version: '0.0.1')

shared_module('foo', 'foo.c')
$ touch foo.c
$ meson setup _build
...
$ meson compile -v -C _build
[1/2] ccache cc -Ilibfoo.dylib.p -I. -I.. -fcolor-diagnostics -Wall -Winvalid-pch -O0 -g -MD -MQ libfoo.dylib.p/foo.c.o -MF libfoo.dylib.p/foo.c.o.d -o libfoo.dylib.p/foo.c.o -c ../foo.c
[2/2] cc  -o libfoo.dylib libfoo.dylib.p/foo.c.o -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,dynamic_lookup -bundle -Wl,-undefined,dynamic_lookup
ld: warning: -undefined dynamic_lookup may not work with chained fixups

This happens for every shared_module() now.

Information on this is scant, but it seems clear that this option is on its way out. In any case, having these warnings is annoying.

tristan957 commented 2 years ago

what version of ld do you have? Which linker do you have?

CsBigDataHub commented 2 years ago

FYI.. https://issues.guix.gnu.org/issue/57849

Looks like using -Wl,-w will help.

petere commented 2 years ago

what version of ld do you have? Which linker do you have?

@(#)PROGRAM:ld  PROJECT:ld64-819.6
BUILD 21:47:27 Sep 13 2022
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 14.0.0, (clang-1400.0.29.102) (static support for 29, runtime is 29)
TAPI support using: Apple TAPI version 14.0.0 (tapi-1400.0.11)