mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-09 13:43:50 +00:00
![]() In 23.11, Darwin was changes to use the system CoreFoundation both aarch64-darwin and x86_64-darwin. The ability to change between implementations was removed, but the hook was left in place because at the time it was harmless. Unfortunately, that is no longer the case.
After the upgrade of ld64 to 951.9, it is no longer as permissive about when `-rpath` may be used. It no longer allows the flag to be used when targeting macOS 10.5, and it no longer allows it when merging objects. The former was an issue for certain versions of GCC (now fixed). The latter is an issue for Haskell.
When a Haskell project uses Darwin frameworks and Cabal to build, they will fail to build without this workaround, giving the following error.
ld: -rpath can only be used when creating a dynamic final linked image
This is due to an optimization Cabal [performs][1]. If the linker supports creating relocatable objects or merging them, it will do so eagerly. This causes packages such as OpenGLRaw to fail to build due using Cabal and frameworks (OpenGL), which pull in the hook.
This workaround is ugly, but it will be reverted as soon as it hits staging and replaced with the real solution, which is removing the hook. The hook is only used with the 10.12 SDK. The 11.0 and 12.3 SDKs do not support the hook, and being able to switch CoreFoundation implementations is not anticipated to be restored in the future (due to problems it causes).
[1]:
|
||
---|---|---|
.. | ||
configuration-hackage2nix | ||
lib | ||
patches | ||
cabal2nix-unstable.nix | ||
configuration-arm.nix | ||
configuration-common.nix | ||
configuration-darwin.nix | ||
configuration-ghc-8.6.x.nix | ||
configuration-ghc-8.10.x.nix | ||
configuration-ghc-9.0.x.nix | ||
configuration-ghc-9.2.x.nix | ||
configuration-ghc-9.4.x.nix | ||
configuration-ghc-9.6.x.nix | ||
configuration-ghc-9.8.x.nix | ||
configuration-ghc-9.10.x.nix | ||
configuration-ghc-9.12.x.nix | ||
configuration-ghcjs-8.x.nix | ||
configuration-ghcjs-9.x.nix | ||
configuration-nix.nix | ||
configuration-tensorflow.nix | ||
default.nix | ||
generic-builder.nix | ||
generic-stack-builder.nix | ||
hackage-packages.nix | ||
HACKING.md | ||
hoogle-local-wrapper.sh | ||
hoogle.nix | ||
initial-packages.nix | ||
make-package-set.nix | ||
non-hackage-packages.nix | ||
package-list.nix | ||
stack-hook.sh | ||
with-packages-wrapper.nix |