Skip to content

macOS 12.x ld: warning: -undefined dynamic_lookup may not work with chained fixups

Host environment

  • Operating system: macOS 12.6 on M1 processor
  • OS/kernel version: Darwin xxxxx 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64
  • Architecture: ARM64
  • QEMU flavor: all
  • QEMU version: commit f1d33f55
  • QEMU command line: -

Emulated/Virtualized environment

  • Operating system: -
  • OS/kernel version: -
  • Architecture: -

Description of problem

Not sure if this is a serious or negligible problem and if it has any significant runtime implications but reporting it anyway:

$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-819.6
BUILD 14:58:44 Aug  5 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)

$ ninja -C build
ninja: Entering directory `build'
[314/2946] Linking static target libevent-loop-base.a
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: archive library: libevent-loop-base.a the table of contents is empty (no object file members in the library define global symbols)
[2044/2946] Generating qemu-system-aarch64 with a custom command
qemu-system-aarch64.tmp: replacing existing signature
[2584/2946] Linking target tests/plugin/libempty.dylib
ld: warning: -undefined dynamic_lookup may not work with chained fixups
[2585/2946] Linking target tests/plugin/libbb.dylib
ld: warning: -undefined dynamic_lookup may not work with chained fixups
[2588/2946] Linking target tests/plugin/libinsn.dylib
ld: warning: -undefined dynamic_lookup may not work with chained fixups
[2589/2946] Linking target tests/plugin/libmem.dylib
ld: warning: -undefined dynamic_lookup may not work with chained fixups
[2592/2946] Linking target tests/plugin/libsyscall.dylib
ld: warning: -undefined dynamic_lookup may not work with chained fixups
[2946/2946] Linking target tests/qtest/test-arm-mptimer

I saw a similar discussions in Bazel building system, CPython, and Ruby:

Steps to reproduce

  1. ./configure --target-list=aarch64-softmmu,arm-softmmu --enable-cocoa --enable-plugins (note that target list is not that important in this case though)
  2. ninja -C build
  3. Observe the warnings

Additional information

See "New Features" subsection under "Linking" section for chained fixup https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes for more information:

All programs and dylibs built with a deployment target of macOS 12 or iOS 15 or later now use the chained fixups format. This uses different load commands and LINKEDIT data, and won’t run or load on older OS versions. (49851380)

Edited by Anton Kochkov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information