Opened 7 weeks ago
Last modified 13 days ago
#59467 assigned defect
ghc @8.6.5_1: Built ghc not working on Catalina
Reported by: | abusse (Anselm Busse) | Owned by: | essandess (Steve Smith) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.2 |
Keywords: | catalina | Cc: | cjones051073 (Chris Jones) |
Port: | ghc |
Description
Compiled on macOS 10.15 with system compiler (Xcode 11.1) completes bootstrap, but the compiler later fails to run simple programs with a memory-related error:
ghc: mmap 131072 bytes at 0x0: Operation not permitted ghc: Try specifying an address with +RTS -xm<addr> -RTS ghc: internal error: m32_allocator_init: Failed to map (GHC version 8.6.5 for x86_64_apple_darwin)
Homebrew seems to have the same issue: https://github.com/Homebrew/homebrew-core/pull/44802
The issue is discussed upstream: https://gitlab.haskell.org/ghc/ghc/issues/17353 However, it seems to be an issue during building and not in the ghc code.
Change History (10)
comment:1 Changed 7 weeks ago by cjones051073 (Chris Jones)
comment:2 Changed 7 weeks ago by jmroot (Joshua Root)
Owner: | set to essandess |
---|---|
Status: | new → assigned |
comment:3 follow-up: 5 Changed 7 weeks ago by essandess (Steve Smith)
Another workaround: just install with the +prebuilt
variant and hope that it runs.
comment:4 Changed 6 weeks ago by cjones051073 (Chris Jones)
Cc: | cjones051073 added |
---|
comment:5 Changed 6 weeks ago by cjones051073 (Chris Jones)
Replying to essandess:
Another workaround: just install with the
+prebuilt
variant and hope that it runs.
Last resort. Please try and fix the build itself. If it is just the Xcode 11 issue again, based on experience with other ports either just blacklisting Xcode 11 clang, so macports clang 9.0 is used, or appending the compiler option -fno-stack-check
will do the job.
comment:6 Changed 6 weeks ago by mouse07410 (Mouse)
IMHO, blacklisting Xcode-11 would be a very bad idea. That's the way Apple chose to proceed. I don't even know if XCode-10 would work on Catalina. We got to deal with it.
Adding -fstack-no-check
appears the best solution/workaround, at least for now.
comment:7 Changed 6 weeks ago by cjones051073 (Chris Jones)
An Apple insider as confirmed its a bug in Xcode 11. So blacklisting it is perfectly reasonable.
comment:8 Changed 6 weeks ago by cjones051073 (Chris Jones)
Also note, just to be clear, the information we have is it should be fixed in Xcode 11.2 (time will tell on this). At this point the blacklist can be made specific to the clang version range affected.
Also, blacklisting Xcode 11 does not mean you have to install Xcode 10 !! It just means, for the port that does it, port will not use the Xcode clang versions blacklisted, and fallback to another compiler selection, which in this case will be MacPorts own build of clang 9.0. This works fine, we use it now in a number of places for exactly this issue.
comment:9 Changed 6 weeks ago by mouse07410 (Mouse)
Chris, ok thanks, that makes sense. If Xcode-11.2 fixed the problem, it's fine to blacklist Xcode-11.{0,1}. Residually if having Macports clang-9 resolves the issue anyway
comment:10 Changed 13 days ago by ryandesign (Ryan Schmidt)
Xcode 11.2.1 is out and is installed on our Catalina buildbot worker. But unfortunately ghc just got built with it and still has this problem.
Looks like just another instance of the Xcode 11 bug related to stack-check.
Simple solution, until either Apple fix it or upstream do something is blacklist Xcode 11 clang.