Build issue on macos aarch64
Closed this issue · 2 comments
tomcumming commented
When I enable a single example in the cabal file and try to build I get the following error:
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
- GLUT-2.7.0.16 (lib) (configuration changed)
- GLUT-2.7.0.16 (exe:RedBook4-Hello) (configuration changed)
Configuring library for GLUT-2.7.0.16..
Preprocessing library for GLUT-2.7.0.16..
Building library for GLUT-2.7.0.16..
Configuring executable 'RedBook4-Hello' for GLUT-2.7.0.16..
Preprocessing executable 'RedBook4-Hello' for GLUT-2.7.0.16..
Building executable 'RedBook4-Hello' for GLUT-2.7.0.16..
[2 of 2] Linking /Users/xyz/proj/GLUT/dist-newstyle/build/aarch64-osx/ghc-9.8.2/GLUT-2.7.0.16/x/RedBook4-Hello/build/RedBook4-Hello/RedBook4-Hello
ld: Absolute addressing not allowed in arm64 code but used in '_Lcapw_info' referencing '_GLUTzm2zi7zi0zi16zminplace_GraphicsziUIziGLUTziRawziCallbacks_makeDisplayFunc1_closure'
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
ghc: `clang' failed in phase `Linker'. (Exit code: 1)
Error: cabal: Failed to build exe:RedBook4-Hello from GLUT-2.7.0.16.
svenpanne commented
I'm afraid, but I don't have a development environment for Mac OS X at hand, and it seems to be related to that, right? In any case: I haven't seen such a failure yet, perhaps you can ask in the relevant GHC forums/mailing lists/... if there is a known issue with the FFI on that platform. The message above hints at some problem with
.If there is a fix, I'll be happy to incorporate it.
tomcumming commented
This was an issue with my nix setup, it works fine when I use the nixpkgs standard cabal and ghc