nixpkgs/pkgs/development
Randy Eckenrode e14e9647d7
haskell-builder.nix: work around useSystemCoreFoundationFramework hook
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]: 705b6ebcae/Cabal/src/Distribution/Simple/Program/Builtin.hs (L341-L380)
2024-07-23 18:30:26 -04:00
..
ada-modules
androidndk-pkgs androidndkPkgs_23: get rid of the unneeded b in the name 2024-07-21 20:25:03 +03:00
beam-modules
bower-modules/generic
chez-modules
compilers
coq-modules
cuda-modules
dhall-modules
em-modules/generic
embedded edl: add udev rules (#323878) 2024-07-21 13:05:48 +02:00
gnuradio-modules
guile-modules
hare-third-party
haskell-modules haskell-builder.nix: work around useSystemCoreFoundationFramework hook 2024-07-23 18:30:26 -04:00
idris-modules
interpreters Merge master into staging-next 2024-07-23 00:02:18 +00:00
java-modules
julia-modules
libraries Merge master into staging-next 2024-07-23 00:02:18 +00:00
lisp-modules
lua-modules Merge branch 'master' into staging-next 2024-07-22 22:53:31 +03:00
misc
mobile
node-packages
ocaml-modules
octave-modules
perl-modules Merge branch 'master' into staging-next 2024-07-22 22:53:31 +03:00
php-packages
python2-modules
python-modules Merge master into staging-next 2024-07-23 00:02:18 +00:00
r-modules
rocm-modules
ruby-modules
scheme-modules/scheme-bytestructures
skaware-packages
tools Merge master into staging-next 2024-07-23 00:02:18 +00:00
web