Windows linker stack commit setting causing issues
I've been trying to work on a library that allows Haskell to call into .Net code, but there's a major show stopper in that the .Net runtime starting with version 4.0, doesn't like the executable files that GHC produces.
I've managed to reduce a test case to not actually depend on using Haskell, but just using GHC to compile a C file, and that C file being nothing but a dumb wrapper around a small dll. The resulting executable exhibits the incorrect behaviour:
> stack exec ghc -- main.c -no-hs-main
> main
1
2
3
4
5
6
ICLRRuntimeHost Start failed w/hr 0x80004005
Then I can also use GCC on the intermediate object file that was created, and produce an executable that exhibits the correct behaviour:
> stack exec gcc -- main.o -o main2.exe
> main2
1
2
3
4
5
6
7
8
I've put a copy of the test case here: https://gitlab.com/tim-m89/DotNetHostingTest
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Linking) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture | x86_64 (amd64) |
Edited by tim-m89