Skip to content

Commit

Permalink
macos: Skip as-needed test, the linker is too smart
Browse files Browse the repository at this point in the history
The new linker in Sonoma / Xcode 15 considers the dependency via the
initializer sufficient to pull in the library. The man page now notes:
  The linker never dead strips initialization and termination routines.
  They are considered "roots" of the dead strip graph.

I could not find a good way to skip only if the linker version is new
enough. Before long everyone will be using the new linker anyway...
  • Loading branch information
anarazel authored and jpakkane committed Dec 4, 2023
1 parent f1c748d commit 30184a4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test cases/common/173 as-needed/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ libB = library('B', 'libB.cpp', link_with : libA)

main_exe = executable('C', 'main.cpp', link_with : [libA, libB])
test('main test', main_exe)

# Since Sonoma / Xcode 15 the macos linker considers the dependency via the
# initializer sufficient to pull in the other other library. There's no good
# way to detect the linker version here, so just skip the on macos.
if host_machine.system() == 'darwin'
error('MESON_SKIP_TEST: the macos linker is too smart for this test')
endif

0 comments on commit 30184a4

Please sign in to comment.