Skip to content

Compiling with profiling on Windows can cause linker errors

I've attached code that is a drastically trimmed down version of the warp library, which depends only on base and bytestring. I've added a dummy executable, and when compiled with stack build --profile warp, results in the following linker errors on Windows:

Linking .stack-work\dist\e626a42b\build\linkerr\linkerr.exe ...
C:\Users\ericcro\Desktop\wai\warp\.stack-work\dist\e626a42b\build/libHSwarp-3.2.25-Iebn3G7jEoUDRqe90gH8n4_p.a(RequestHeader.p_o):fake:(.text+0x920): undefined reference to `__chkstk_ms'
C:\Users\ericcro\Desktop\wai\warp\.stack-work\dist\e626a42b\build/libHSwarp-3.2.25-Iebn3G7jEoUDRqe90gH8n4_p.a(RequestHeader.p_o):fake:(.text+0xc10): undefined reference to `__chkstk_ms'
C:\Users\ericcro\Desktop\wai\warp\.stack-work\dist\e626a42b\build/libHSwarp-3.2.25-Iebn3G7jEoUDRqe90gH8n4_p.a(RequestHeader.p_o):fake:(.text+0xc70): undefined reference to `__chkstk_ms'
C:\Users\ericcro\Desktop\wai\warp\.stack-work\dist\e626a42b\build/libHSwarp-3.2.25-Iebn3G7jEoUDRqe90gH8n4_p.a(RequestHeader.p_o):fake:(.text+0xdd8): undefined reference to `__chkstk_ms'
C:\Users\ericcro\Desktop\wai\warp\.stack-work\dist\e626a42b\build/libHSwarp-3.2.25-Iebn3G7jEoUDRqe90gH8n4_p.a(RequestHeader.p_o):fake:(.text+0xe90): undefined reference to `__chkstk_ms'
C:\Users\ericcro\Desktop\wai\warp\.stack-work\dist\e626a42b\build/libHSwarp-3.2.25-Iebn3G7jEoUDRqe90gH8n4_p.a(RequestHeader.p_o):fake:(.text+0xee0): more undefined references to `__chkstk_ms' follow
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)

--  While building package warp-3.2.25 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6.3.exe --builddir=.stack-work\dist\e626a42b build lib:warp exe:linkerr --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

This is preventing me from doing any profiling on my large program which is built on warp.

Trac metadata
Trac field Value
Version 8.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information