1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00

CoreFoundation: specify the tbd explicitly

The current hook specifies the path to the framework library, but
nixpkgs does not actually provide the library when linking against the
system framework. It provides a text-based stub (`.tbd`) instead. ld64
will find the stub and use it, but lld will not when the full path is
specified. Both linkers work if the extension is included, so do that
for compatibility with both. This fixes using lld with CoreFoundation
(e.g., to support LTO on Darwin).
This commit is contained in:
Randy Eckenrode 2023-08-12 09:11:05 -04:00
parent 09f5e7d840
commit 8e56a2635f
No known key found for this signature in database
GPG key ID: 64C1CD4EC2A600D9
2 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,6 @@
forceLinkCoreFoundationFramework() {
NIX_CFLAGS_COMPILE="-F@out@/Library/Frameworks${NIX_CFLAGS_COMPILE:+ }${NIX_CFLAGS_COMPILE-}"
NIX_LDFLAGS+=" @out@/Library/Frameworks/CoreFoundation.framework/CoreFoundation"
NIX_LDFLAGS+=" @out@/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd"
}
preConfigureHooks+=(forceLinkCoreFoundationFramework)

View file

@ -3,7 +3,7 @@ linkSystemCoreFoundationFramework() {
# gross! many symbols (such as _OBJC_CLASS_$_NSArray) are defined in system CF, but not
# in the opensource release
# if the package needs private headers, we assume they also want to link with system CF
NIX_LDFLAGS+=" @out@/Library/Frameworks/CoreFoundation.framework/CoreFoundation"
NIX_LDFLAGS+=" @out@/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd"
}
preConfigureHooks+=(linkSystemCoreFoundationFramework)