GHC fails to create a Windows DLL when profiling is enabled: 'error: export ordinal too large 86130'
Hello,
I am trying to create a Windows .dll that will be linked with a C++ application. For creating the .dll I am using GHC 8.4.3.
I can create the .dll successfully when profiling is not enabled by using the following command(a simplified version is displayed here):
ghc -shared -threaded -O2 -LC:/haskell_dll -l... -o C:/haskell.dll ...
Then I try again the same command by adding -prof for enabling profiling:
ghc -prof -shared -threaded -O2 -LC:/haskell_dll -l... -o C:/haskell.dll ...
But I am getting the following error:
ld.exe: Error: export ordinal too large: 86130
I made some investigation and it seems that this issue has been reported multiple times in the past and it is related with the limit of symbols that a Windows .dll can have. There is also a Wiki page describing it here.
However it is not clear to me if this issue has been resolved or not in recent versions of GHC. Does someone knows the current status? Is it only the prof RTS that exports more than 65535 symbols(the threaded RTS works normally)? Is there a way to overcome this issue?