[GHC] #9521: ghc doesn't pass flags to ld via -optl

#9521: ghc doesn't pass flags to ld via -optl -------------------------------------+------------------------------------- Reporter: MikolajKonarski | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Keywords: | Operating System: Linux Architecture: Unknown/Multiple | Type of failure: Difficulty: Unknown | None/Unknown Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- I'm compiling i386 binaries on amd64 linux --- already overcame #9421, but still not there. When I do the following (using a i386 GHC 7.8.3 on a 64 bit Ubuntu) {{{ ~/r/LambdaHack$ cabal install haskell-lexer-1.0 -j1 --ghc- option="-optc-m32" --ghc-option="-opta-m32" --ghc-option="-optl-m32" --ghc-option="-optl-arch\ i386" --ghc-option="-optl-m\ elf_i386" --ghc- option="-optl-Wl,-m32" -v3 >& log }}} I get the attached log with, in particular, these lines: {{{ ("/home/mikolaj/local/bin/ghc",["-c","/tmp/4707.c","-o","/tmp/4707.o","-optc-m32","-opta-m32","-optl-m32 ","-optl-arch\\ i386","-optl-m\\ elf_i386","-optl-Wl,-m32"]) ("/usr/bin/ld",["-x","-r","/tmp/4707.o","-o","/tmp/4708.o"]) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9521 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9521: ghc doesn't pass flags to ld via -optl -------------------------------------+------------------------------------- Reporter: | Owner: MikolajKonarski | Status: closed Type: bug | Milestone: Priority: normal | Version: 7.8.3 Component: Compiler | Keywords: Resolution: invalid | Architecture: Unknown/Multiple Operating System: Linux | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by MikolajKonarski): * status: new => closed * resolution: => invalid Comment: I panicked, there is probably no bug. The offending call to /usr/bin/ld is done directly by cabal, not by ghc, and so I needed to pass --ld-option as well: {{{ cabal install haskell-lexer-1.0 -j1 --ghc-option="-optc-m32" --ghc- option="-opta-m32" --ghc-option="-optl-m32" --ld-option="-melf_i386" }}} This works and so compiling i386 binaries on amd64 Linux finally works for me. BTW, for completeness, I also had to do {{{ sudo apt-get install libgmp-dev:i386 }}} which unfortunately breaks compilation of amd64 binaries, or hack around as follows {{{ sudo ln -s /usr/lib/i386-linux-gnu/libgmp.so.10.0.2 /usr/lib/i386-linux- gnu/libgmp.so }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9521#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC