
Hi When Compiling on OpenBSD-Current I get the follow error, what do i need to do to fix this? Cheers Adam ===--- building phase 0 gmake --no-print-directory -f ghc.mk phase=0 phase_0_builds gmake[1]: Nothing to be done for 'phase_0_builds'. ===--- building phase 1 gmake --no-print-directory -f ghc.mk phase=1 phase_1_builds "/usr/local/bin/ghc" -o utils/hsc2hs/dist/build/tmp/hsc2hs -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -hide-all-packages -i -iutils/hsc2hs/. -iutils/hsc2hs/dist/build -Iutils/hsc2hs/dist/build -iutils/hsc2hs/dist/build/hsc2hs/autogen -Iutils/hsc2hs/dist/build/hsc2hs/autogen -optP-include -optPutils/hsc2hs/dist/build/hsc2hs/autogen/cabal_macros.h -package-id base-4.9.0.0 -package-id containers-0.5.7.1 -package-id directory-1.2.6.2 -package-id filepath-1.4.1.0 -package-id process-1.4.2.0 -XHaskell2010 -no-user-package-db -rtsopts -odir utils/hsc2hs/dist/build -hidir utils/hsc2hs/dist/build -stubdir utils/hsc2hs/dist/build -optl-z -optlwxneeded -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -hide-all-packages -i -iutils/hsc2hs/. -iutils/hsc2hs/dist/build -Iutils/hsc2hs/dist/build -iutils/hsc2hs/dist/build/hsc2hs/autogen -Iutils/hsc2hs/dist/build/hsc2hs/autogen -optP-include -optPutils/hsc2hs/dist/build/hsc2hs/autogen/cabal_macros.h -package-id base-4.9.0.0 -package-id containers-0.5.7.1 -package-id directory-1.2.6.2 -package-id filepath-1.4.1.0 -package-id process-1.4.2.0 -XHaskell2010 -no-user-package-db -rtsopts utils/hsc2hs/dist/build/Main.o utils/hsc2hs/dist/build/C.o utils/hsc2hs/dist/build/Common.o utils/hsc2hs/dist/build/CrossCodegen.o utils/hsc2hs/dist/build/DirectCodegen.o utils/hsc2hs/dist/build/Flags.o utils/hsc2hs/dist/build/HSCParser.o utils/hsc2hs/dist/build/UtilsCodegen.o utils/hsc2hs/dist/build/Paths_hsc2hs.o <no location info>: error: Warning: Couldn't figure out linker information! Make sure you're using GNU ld, GNU gold or the built in OS X linker, etc. cc: wxneeded: No such file or directory `cc' failed in phase `Linker'. (Exit code: 1) compiler/ghc.mk:580: compiler/stage1/build/.depend-v.haskell: No such file or directory gmake[1]: *** [utils/hsc2hs/ghc.mk:15: utils/hsc2hs/dist/build/tmp/hsc2hs] Error 1 gmake: *** [Makefile:125: all] Error 2

I've been hit by this during 8.0.2 rc1 binary preparation so if nobody else nor you find a time to fix that sooner I'll hopefully find some time during this weekend to have a look into it. I'm pretty sure this is fairly recent breakage on OpenBSD... Cheers, Karel On 12/ 1/16 12:21 PM, Adam Steen wrote:
Hi
When Compiling on OpenBSD-Current I get the follow error, what do i need to do to fix this?
Cheers Adam
===--- building phase 0 gmake --no-print-directory -f ghc.mk http://ghc.mk phase=0 phase_0_builds gmake[1]: Nothing to be done for 'phase_0_builds'. ===--- building phase 1 gmake --no-print-directory -f ghc.mk http://ghc.mk phase=1 phase_1_builds "/usr/local/bin/ghc" -o utils/hsc2hs/dist/build/tmp/hsc2hs -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -hide-all-packages -i -iutils/hsc2hs/. -iutils/hsc2hs/dist/build -Iutils/hsc2hs/dist/build -iutils/hsc2hs/dist/build/hsc2hs/autogen -Iutils/hsc2hs/dist/build/hsc2hs/autogen -optP-include -optPutils/hsc2hs/dist/build/hsc2hs/autogen/cabal_macros.h -package-id base-4.9.0.0 -package-id containers-0.5.7.1 -package-id directory-1.2.6.2 -package-id filepath-1.4.1.0 -package-id process-1.4.2.0 -XHaskell2010 -no-user-package-db -rtsopts -odir utils/hsc2hs/dist/build -hidir utils/hsc2hs/dist/build -stubdir utils/hsc2hs/dist/build -optl-z -optlwxneeded -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -hide-all-packages -i -iutils/hsc2hs/. -iutils/hsc2hs/dist/build -Iutils/hsc2hs/dist/build -iutils/hsc2hs/dist/build/hsc2hs/autogen -Iutils/hsc2hs/dist/build/hsc2hs/autogen -optP-include -optPutils/hsc2hs/dist/build/hsc2hs/autogen/cabal_macros.h -package-id base-4.9.0.0 -package-id containers-0.5.7.1 -package-id directory-1.2.6.2 -package-id filepath-1.4.1.0 -package-id process-1.4.2.0 -XHaskell2010 -no-user-package-db -rtsopts utils/hsc2hs/dist/build/Main.o utils/hsc2hs/dist/build/C.o utils/hsc2hs/dist/build/Common.o utils/hsc2hs/dist/build/CrossCodegen.o utils/hsc2hs/dist/build/DirectCodegen.o utils/hsc2hs/dist/build/Flags.o utils/hsc2hs/dist/build/HSCParser.o utils/hsc2hs/dist/build/UtilsCodegen.o utils/hsc2hs/dist/build/Paths_hsc2hs.o
<no location info>: error: Warning: Couldn't figure out linker information! Make sure you're using GNU ld, GNU gold or the built in OS X linker, etc. cc: wxneeded: No such file or directory `cc' failed in phase `Linker'. (Exit code: 1) compiler/ghc.mk:580 http://ghc.mk:580: compiler/stage1/build/.depend-v.haskell: No such file or directory gmake[1]: *** [utils/hsc2hs/ghc.mk:15 http://ghc.mk:15: utils/hsc2hs/dist/build/tmp/hsc2hs] Error 1 gmake: *** [Makefile:125: all] Error 2
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

https://phabricator.haskell.org/D2673 is responsible. It adds
CONF_LD_LINKER_OPTS_STAGE0 to $1_$2_$3_ALL_LD_OPTS, which is
documented as "Options for passing to plain ld", which is okay. But
just below that the same variable $1_$2_$3_ALL_LD_OPTS is added (with
-optl prefixes attached) to $1_$2_$3_GHC_LD_OPTS ("Options for passing
to GHC when we use it for linking"), which is wrong because GHC uses
gcc to do the link, not ld.
Regards,
Reid Barton
On Thu, Dec 1, 2016 at 6:58 AM, Karel Gardas
I've been hit by this during 8.0.2 rc1 binary preparation so if nobody else nor you find a time to fix that sooner I'll hopefully find some time during this weekend to have a look into it. I'm pretty sure this is fairly recent breakage on OpenBSD...
Cheers, Karel
On 12/ 1/16 12:21 PM, Adam Steen wrote:
Hi
When Compiling on OpenBSD-Current I get the follow error, what do i need to do to fix this?
Cheers Adam
===--- building phase 0 gmake --no-print-directory -f ghc.mk http://ghc.mk phase=0 phase_0_builds gmake[1]: Nothing to be done for 'phase_0_builds'. ===--- building phase 1 gmake --no-print-directory -f ghc.mk http://ghc.mk phase=1 phase_1_builds
"/usr/local/bin/ghc" -o utils/hsc2hs/dist/build/tmp/hsc2hs -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -hide-all-packages -i -iutils/hsc2hs/. -iutils/hsc2hs/dist/build -Iutils/hsc2hs/dist/build -iutils/hsc2hs/dist/build/hsc2hs/autogen -Iutils/hsc2hs/dist/build/hsc2hs/autogen -optP-include -optPutils/hsc2hs/dist/build/hsc2hs/autogen/cabal_macros.h -package-id base-4.9.0.0 -package-id containers-0.5.7.1 -package-id directory-1.2.6.2 -package-id filepath-1.4.1.0 -package-id process-1.4.2.0 -XHaskell2010 -no-user-package-db -rtsopts -odir utils/hsc2hs/dist/build -hidir utils/hsc2hs/dist/build -stubdir utils/hsc2hs/dist/build -optl-z -optlwxneeded -static -O0 -H64m -Wall -package-db libraries/bootstrapping.conf -hide-all-packages -i -iutils/hsc2hs/. -iutils/hsc2hs/dist/build -Iutils/hsc2hs/dist/build -iutils/hsc2hs/dist/build/hsc2hs/autogen -Iutils/hsc2hs/dist/build/hsc2hs/autogen -optP-include -optPutils/hsc2hs/dist/build/hsc2hs/autogen/cabal_macros.h -package-id base-4.9.0.0 -package-id containers-0.5.7.1 -package-id directory-1.2.6.2 -package-id filepath-1.4.1.0 -package-id process-1.4.2.0 -XHaskell2010 -no-user-package-db -rtsopts utils/hsc2hs/dist/build/Main.o utils/hsc2hs/dist/build/C.o utils/hsc2hs/dist/build/Common.o utils/hsc2hs/dist/build/CrossCodegen.o utils/hsc2hs/dist/build/DirectCodegen.o utils/hsc2hs/dist/build/Flags.o utils/hsc2hs/dist/build/HSCParser.o utils/hsc2hs/dist/build/UtilsCodegen.o utils/hsc2hs/dist/build/Paths_hsc2hs.o
<no location info>: error: Warning: Couldn't figure out linker information! Make sure you're using GNU ld, GNU gold or the built in OS X linker, etc. cc: wxneeded: No such file or directory `cc' failed in phase `Linker'. (Exit code: 1) compiler/ghc.mk:580 http://ghc.mk:580: compiler/stage1/build/.depend-v.haskell: No such file or directory gmake[1]: *** [utils/hsc2hs/ghc.mk:15 http://ghc.mk:15: utils/hsc2hs/dist/build/tmp/hsc2hs] Error 1 gmake: *** [Makefile:125: all] Error 2
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reid Barton
https://phabricator.haskell.org/D2673 is responsible. It adds CONF_LD_LINKER_OPTS_STAGE0 to $1_$2_$3_ALL_LD_OPTS, which is documented as "Options for passing to plain ld", which is okay. But just below that the same variable $1_$2_$3_ALL_LD_OPTS is added (with -optl prefixes attached) to $1_$2_$3_GHC_LD_OPTS ("Options for passing to GHC when we use it for linking"), which is wrong because GHC uses gcc to do the link, not ld.
Great catch Reid and thanks for the report Adam! I have setup an OpenBSD VM and have reproduced the issue. Following Reid's logic I have proposed D2776 as a fix. Cheers, - Ben
participants (4)
-
Adam Steen
-
Ben Gamari
-
Karel Gardas
-
Reid Barton