-optl behavior in ghc-7.8.1

Yuras Shumovich shumovichy at gmail.com
Thu Apr 10 15:44:31 UTC 2014


I found that -optl behavior was changed in ghc-7.8.1

ghc-7.6.3 passes additional linker options after all the haskell object
files, while ghc-7.8.1 does the opposite.

$ /opt/ghc-7.6.3/bin/ghc --make main.hs -optl=hello -v
'/usr/bin/gcc' '-fno-stack-protector' '-Wl,--hash-size=31' '-Wl,--reduce-memory-overheads' '-o' 'main' 'main.o' 'hello' ...

$ /opt/ghc-7.8.1/bin/ghc --make main.hs -optl=hello -v
/usr/bin/gcc -fno-stack-protector -DTABLES_NEXT_TO_CODE hello -o main main.o ...

Is it intentional change?

I want to compile in a number of static libraries. I have the next line
in my cabal file:

    ld-options:  ./path/to/libsomething.a

It works ok on linux and mac os with ghc-7.6.3, but with ghc-7.8.1 I get
undefined references for symbols from the libsomething.a


More information about the Glasgow-haskell-users mailing list