[GHC] #12806: curl dependency in conjunction with Template Haskell causes "unknown symbol" errors

#12806: curl dependency in conjunction with Template Haskell causes "unknown symbol" errors -------------------------------------+------------------------------------- Reporter: Darwin226 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I've reported on this issue to the stack issue tracker here https://github.com/commercialhaskell/stack/issues/2752#issuecomment-25737851... The steps to reproduce are the following * Make a new stack project (lts-5.3 in my case). stack new curl-test -resolver=lts-5,3 * Add curl as a dependency to the library. * Modify the Lib file to the following {{{ {-# LANGUAGE TemplateHaskell #-} module Lib where return [] someFunc :: IO () someFunc = return () }}} The error that I get with GHC 8 is this {{{ ghc.EXE: unable to load package `curl-1.3.8' ghc.EXE: C:\Users\darwi\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib\libcurl.a: unknown symbol `stricmp' ghc.EXE: Could not on-demand load symbol 'curl_strequal' ghc.EXE: C:\Users\darwi\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib\libcurl.a: unknown symbol `curl_strequal' ghc.EXE: Could not on-demand load symbol '.refptr.Curl_cstrdup' ghc.EXE: C:\Users\darwi\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib\libcurl.a: unknown symbol `.refptr.Curl_cstrdup' ghc.EXE: Could not on-demand load symbol 'curl_slist_free_all' ghc.EXE: C:\Users\darwi\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib\libcurl.a: unknown symbol `curl_slist_free_all' ghc.EXE: Could not on-demand load symbol 'Curl_ssl_connect_nonblocking' ghc.EXE: C:\Users\darwi\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib\libcurl.a: unknown symbol `Curl_ssl_connect_nonblocking' ghc.EXE: Could not on-demand load symbol '.refptr.Curl_crealloc' ghc.EXE: C:\Users\darwi\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib\libcurl.a: unknown symbol `.refptr.Curl_crealloc' ghc.EXE: Could not on-demand load symbol 'curl_msnprintf' ghc.EXE: C:\Users\darwi\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib\libcurl.a: unknown symbol `curl_msnprintf' ghc.EXE: Could not on-demand load symbol '.refptr.Curl_cmalloc' ghc.EXE: C:\Users\darwi\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib\libcurl.a: unknown symbol `.refptr.Curl_cmalloc' ghc.EXE: Could not on-demand load symbol 'Curl_verify_windows_version' ghc.EXE: C:\Users\darwi\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib\libcurl.a: unknown symbol `Curl_verify_windows_version' ghc.EXE: Could not on-demand load symbol 'Curl_sspi_global_init' ghc.EXE: C:\Users\darwi\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib\libcurl.a: unknown symbol `Curl_sspi_global_init' ghc.EXE: Could not on-demand load symbol 'curl_global_init' ghc.EXE: C:\sr\snapshots\df48cbae\lib\x86_64-windows- ghc-8.0.1\curl-1.3.8-B8AxMCtSRkiFrZLK4gerBe\HScurl-1.3.8-B8AxMCtSRkiFrZLK4gerBe.o: unknown symbol `curl_global_init' }}} but this still fails with GHC 7.10.3 with a similar error. This is happening on two Windows 10 machines so it's not an isolated case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12806 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12806: curl dependency in conjunction with Template Haskell causes "unknown symbol" errors -------------------------------------+------------------------------------- Reporter: Darwin226 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.0.1 (Linker) | Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * cc: Phyx- (added) * os: Unknown/Multiple => Windows * component: Compiler => Runtime System (Linker) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12806#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12806: curl dependency in conjunction with Template Haskell causes "unknown symbol" errors -------------------------------------+------------------------------------- Reporter: Darwin226 | Owner: Phyx- Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Runtime System | Version: 8.0.1 (Linker) | Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Phyx-): * owner: => Phyx- * milestone: => 8.2.1 Comment: Thanks for the report. It seems we don't quite deal correctly with symbols at the start of a section. We incorrectly think they're undefined because their addresses are 0. 8.0.2 would alleviate this somewhat as it'll have import library support, so it would like against the DLL in that case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12806#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12806: curl dependency in conjunction with Template Haskell causes "unknown symbol" errors -------------------------------------+------------------------------------- Reporter: Darwin226 | Owner: Phyx- Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Runtime System | Version: 8.0.1 (Linker) | Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Phyx-): What I don't quite get is what's causing it to link against anything in the library to begin with.. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12806#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12806: curl dependency in conjunction with Template Haskell causes "unknown symbol" errors -------------------------------------+------------------------------------- Reporter: Darwin226 | Owner: Phyx- Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Runtime System | Version: 8.0.1 (Linker) | Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: RyanGlScott (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12806#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC