Subject: [Haskell-cafe] caba install with external gcc toolchain not the ghc-bundled one
From: Daniel Kahlenberg <[email-masked]>
To: [email-masked]
Date: Wed, 11 Nov 2009 11:17:42 +0100

Hello friends,

I have a question regarding one thing I can't get my head around: First
my problem is, that wanted to install 'bindings-common' here on my
Windows machine. Usually that is no problem with the help of the
glorious cabal.

Now, 'bindings-common' needs a higher version of gcc than the one
bundled with ghc-6.10.4 to build as the developer told me, so I install
the gcc version 4.4.0 by mingw and try to give the needed options to
'cabal install bindings-common...' - '--with-gcc=... --with-ld=...' etc.
- At the same time I log everything cabal is putting to the outside
world when doing the tasks for building the 'binding-commons':

For this sake I use the '--build-log=...' option of 'cabal install' and
at the same time pipe what gets shown on the terminal with 'tee' as well
as verbosity level 3 for 'cabal install'. So far nothing new...

But the package isn't built, so I wonder what the transcript is saying
and have a look at the two generated log files, stating that the one
generated by 'tee' tells me another linker (the one coming with the
ghc-6.10.4 bundle) than I thought to have specified is actually used. An
excerpt from the tee built log file:

  *** Linker:
  E:\programme\ghc\ghc-6.10.4\gcc -BE:\programme\ghc\ghc-6.10.4\gcc-lib/
  ...
  Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc
  ...
  Thread model: win32
  gcc version 3.4.5 (mingw-vista special r3)

(Sorry if I'm mis-interpreting something here) While the log file
resulting from the '--build-log' cabal install option has nothing
suspicious in it telling me to (plan to?) use exactly what I specified
by options. A little excerpt from that log file:

("e:\\programme\\ghc\\ghc-6.10.4\\bin\\hsc2hs.exe",["--cc=e:/programme/ghc/mingw-gcc4/bin/gcc.exe","--ld=e:/programme/ghc/mingw-gcc4/bin/gcc.exe","--cflag=-Be:/programme/ghc/mingw-gcc4/lib/","--cflag=-Ie:/programme/ghc/mingw4-gcc/include","--cflag=-Le:/programme/ghc/mingw-gcc4/lib","--lflag=-Be:/programme/ghc/mingw-gcc4/lib/","--lflag=-Ie:/programme/ghc/mingw4-gcc/include","--lflag=-Le:/programme/ghc/mingw-gcc4/lib","--cflag=-D__GLASGOW_HASKELL__=610","--cflag=-Isrc","--cflag=-Ie:/programme/ghc/mingw-gcc4/include","--cflag=-D_ISOC99_SOURCE","--lflag=-Le:/programme/ghc/mingw-gcc4/lib","--cflag=-Ie:\\programme\\ghc\\ghc-6.10.4\\base-4.1.0.0\\include","--cflag=-Ie:\\programme\\ghc\\ghc-6.10.4/include","--lflag=-Le:\\programme\\ghc\\ghc-6.10.4\\base-3.0.3.1","--lflag=-Le:\\programme\\ghc\\ghc-6.10.4\\syb-0.1.0.1","--lflag=-Le:\\programme\\ghc\\ghc-6.10.4\\base-4.1.0.0","--lflag=-lwsock32","--lflag=-luser32","--lflag=-lshell32","--lflag=-Le:\\programme\\ghc\\ghc-6.10.4\\integer-0
.1.0.1","--lflag=-Le:\\programme\\ghc\\ghc-6.10.4\\ghc-prim-0.1.0.0","--lflag=-Le:\\programme\\ghc\\ghc-6.10.4","--lflag=-Le:\\programme\\ghc\\ghc-6.10.4/gcc-lib","--lflag=-lm","--lflag=-lffi","--lflag=-lgmp","--lflag=-lwsock32","-o","H:\\.homedir\\hugsdata\\build\\Bindings\\C\\Ctype.hs","src\\Bindings\\C\\Ctype.hsc"])
  ...
  Using ld given by user at: e:/programme/ghc/mingw-gcc4/bin/ld.exe

So now my question is: Can anybody give me a good hint or tell me how I
would, aside from using hard links or other file system related tasks,
specify the external compiler, linker or gcc-toolchain to be used by
'cabal install' (or in consequence by 'ghc')?

Cheers and thanks for your
Daniel

searching for ghc in path.
found ghc at e:\programme\ghc\ghc-6.10.4\bin\ghc.exe
("e:\\programme\\ghc\\ghc-6.10.4\\bin\\ghc.exe",["--numeric-version"])
e:\programme\ghc\ghc-6.10.4\bin\ghc.exe is version 6.10.4
looking for package tool: ghc-pkg near compiler in
e:\programme\ghc\ghc-6.10.4\bin
found package tool in e:\programme\ghc\ghc-6.10.4\bin\ghc-pkg.exe
("e:\\programme\\ghc\\ghc-6.10.4\\bin\\ghc-pkg.exe",["--version"])
e:\programme\ghc\ghc-6.10.4\bin\ghc-pkg.exe is version 6.10.4
("e:\\programme\\ghc\\ghc-6.10.4\\bin\\ghc.exe",["--supported-languages"])
Reading installed packages...
("e:\\programme\\ghc\\ghc-6.10.4\\bin\\ghc-pkg.exe",["dump","--global"])
("e:\\programme\\ghc\\ghc-6.10.4\\bin\\ghc-pkg.exe",["dump","--package-conf=h:\\.homedir\\ghc\\i386-mingw32-6.10.4\\package.conf"])
Reading available packages...
Resolving dependencies...
selecting bindings-common-1.3.3 (hackage) and discarding bindings-common-0.1,
0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6,
1.0, 1.1, 1.2, 1.3, 1.3.1 and 1.3.2
selecting base-3.0.3.1 (installed) and 4.1.0.0 (installed) and discarding
syb-0.1.0.0 and 0.1.0.1
selecting ghc-prim-0.1.0.0 (installed)
selecting integer-0.1.0.1 (installed)
selecting rts-1.0 (installed)
selecting syb-0.1.0.1 (installed)
In order, the following would be installed:
bindings-common-1.3.3 (new package)
bindings-common-1.3.3 has already been downloaded.
Extracting C:\Dokumente und
Einstellungen\Zyx\Anwendungsdaten\cabal\packages\hackage.haskell.org\bindings-common\1.3.3\bindings-common-1.3.3.tar.gz
to c:\DOKUME~1\Zyx\LOKALE~1\Temp\bindings-common-1.3.31176...
Using external setup method with build-type Simple
Creating h:\.homedir\hugsdata\setup (and its parents)
Using Cabal library version 1.6.0.3
Using h:\.homedir\hugsdata\setup\setup.hs as setup script.
Setup script is out of date, compiling...
("e:\\programme\\ghc\\ghc-6.10.4\\bin\\ghc.exe",["-v","--make","h:\\.homedir\\hugsdata\\setup\\setup.hs","-o","h:\\.homedir\\hugsdata\\setup\\setup.exe","-odir","h:\\.homedir\\hugsdata\\setup","-hidir","h:\\.homedir\\hugsdata\\setup","-i","-ic:\\DOKUME~1\\Zyx\\LOKALE~1\\Temp\\bindings-common-1.3.31176\\bindings-common-1.3.3","-no-user-package-conf","-package-conf","h:\\.homedir\\ghc\\i386-mingw32-6.10.4\\package.conf","-package","Cabal-1.6.0.3"])
Glasgow Haskell Compiler, Version 6.10.4, for Haskell 98, stage 2 booted by GHC version 6.10.1
Using package config file: E:\programme\ghc\ghc-6.10.4\package.conf
Using package config file: h:\.homedir\ghc\i386-mingw32-6.10.4\package.conf
Using package config file: h:\.homedir\ghc\i386-mingw32-6.10.4\package.conf
hiding package base-3.0.3.1 to avoid conflict with later version base-4.1.0.0
hiding package regex-base-0.72.0.2 to avoid conflict with later version regex-base-0.93.1
hiding package parsec-2.1.0.1 to avoid conflict with later version parsec-3.0.1
hiding package QuickCheck-1.2.0.0 to avoid conflict with later version QuickCheck-2.1.0.2
wired-in package ghc-prim mapped to ghc-prim-0.1.0.0
wired-in package integer mapped to integer-0.1.0.1
wired-in package base mapped to base-4.1.0.0
wired-in package rts mapped to rts-1.0
wired-in package haskell98 mapped to haskell98-1.0.1.0
wired-in package syb mapped to syb-0.1.0.1
wired-in package template-haskell mapped to template-haskell-2.3.0.1
wired-in package dph-seq mapped to dph-seq-0.3
wired-in package dph-par mapped to dph-par-0.3
Hsc static flags: -static
*** Chasing dependencies:
Chasing modules from: *H:\.homedir\hugsdata\setup\setup.hs
Stable obj: []
Stable BCO: []
Ready for upsweep
  [NONREC
      ModSummary {
         ms_hs_date = Mon Nov  9 14:45:34 Westeuropäische Normalzeit 2009
         ms_mod = main:Main,
         ms_imps = [Distribution.Simple]
         ms_srcimps = []
      }]
compile: input file H:\.homedir\hugsdata\setup\setup.hs
Created temporary directory: C:\DOKUME~1\Zyx\LOKALE~1\Temp\/ghc2388_0
*** Checking old interface for main:Main:
[1 of 1] Compiling Main             ( H:\.homedir\hugsdata\setup\setup.hs, H:\.homedir\hugsdata\setup\Main.o )
*** Parser:
*** Renamer/typechecker:
*** Desugar:
    Result size = 8
*** Simplify:
    Result size = 6
    Result size = 6
*** Tidy Core:
    Result size = 6
writeBinIface: 1 Names
writeBinIface: 28 dict entries
*** CorePrep:
    Result size = 6
*** Stg2Stg:
*** CodeGen:
*** CodeOutput:
*** Assembler:
E:\programme\ghc\ghc-6.10.4\gcc -BE:\programme\ghc\ghc-6.10.4\gcc-lib/ -IE:\programme\ghc\ghc-6.10.4\include/mingw -IH:\.homedir\hugsdata\setup -c C:\DOKUME~1\Zyx\LOKALE~1\Temp\/ghc2388_0/ghc2388_0.s -o h:\.homedir\hugsdata\setup\Main.o
*** Deleting temp files:
Deleting: C:\DOKUME~1\Zyx\LOKALE~1\Temp\/ghc2388_0/ghc2388_0.s
Upsweep completely successful.
*** Deleting temp files:
Deleting: 
link: linkables are ...
LinkableM (Mon Nov  9 14:45:34 Westeuropäische Normalzeit 2009) main:Main
   [DotO h:\.homedir\hugsdata\setup\Main.o]
Linking h:\.homedir\hugsdata\setup\setup.exe ...
*** Windres:
E:\programme\ghc\ghc-6.10.4\bin/windres --preprocessor="E:\programme\ghc\ghc-6.10.4\gcc" "-BE:\programme\ghc\ghc-6.10.4\gcc-lib/" "-IE:\programme\ghc\ghc-6.10.4\include/mingw" "-E" "-xc" "-DRC_INVOKED" --use-temp-file --input=C:\DOKUME~1\Zyx\LOKALE~1\Temp\/ghc2388_0/ghc2388_0.rc --output=C:\DOKUME~1\Zyx\LOKALE~1\Temp\/ghc2388_0/ghc2388_0.o --output-format=coff
*** Linker:
E:\programme\ghc\ghc-6.10.4\gcc -BE:\programme\ghc\ghc-6.10.4\gcc-lib/ -IE:\programme\ghc\ghc-6.10.4\include/mingw -v -o h:\.homedir\hugsdata\setup\setup.exe -DDONT_WANT_WIN32_DLL_SUPPORT h:\.homedir\hugsdata\setup\Main.o C:\DOKUME~1\Zyx\LOKALE~1\Temp\/ghc2388_0/ghc2388_0.o -Lh:\.homedir\.cabal\Cabal-1.6.0.3\ghc-6.10.4 -LE:\programme\ghc\ghc-6.10.4\process-1.0.1.1 -LE:\programme\ghc\ghc-6.10.4\pretty-1.0.1.0 -LE:\programme\ghc\ghc-6.10.4\directory-1.0.0.3 -LE:\programme\ghc\ghc-6.10.4\old-time-1.0.0.2 -LE:\programme\ghc\ghc-6.10.4\old-locale-1.0.0.1 -LE:\programme\ghc\ghc-6.10.4\filepath-1.1.0.2 -LE:\programme\ghc\ghc-6.10.4\Win32-2.2.0.0 -LE:\programme\ghc\ghc-6.10.4\bytestring-0.9.1.4 -LE:\programme\ghc\ghc-6.10.4\containers-0.2.0.1 -LE:\programme\ghc\ghc-6.10.4\array-0.2.0.0 -LE:\programme\ghc\ghc-6.10.4\syb-0.1.0.1 -LE:\programme\ghc\ghc-6.10.4\base-4.1.0.0 -LE:\programme\ghc\ghc-6.10.4\integer-0.1.0.1 -LE:\programme\ghc\ghc-6.10.4\ghc-prim-0.1.0.0 -LE:\programme\ghc\ghc-6.10.4 -LE:\programme\ghc\ghc-6.10.4/gcc-lib -lHSCabal-1.6.0.3 -lHSprocess-1.0.1.1 -lHSpretty-1.0.1.0 -lHSdirectory-1.0.0.3 -lHSold-time-1.0.0.2 -lHSold-locale-1.0.0.1 -lHSfilepath-1.1.0.2 -lHSWin32-2.2.0.0 -luser32 -lgdi32 -lwinmm -ladvapi32 -lHSbytestring-0.9.1.4 -lHScontainers-0.2.0.1 -lHSarray-0.2.0.0 -lHSsyb-0.1.0.1 -lHSbase-4.1.0.0 -lwsock32 -luser32 -lshell32 -lHSinteger-0.1.0.1 -lHSghc-prim-0.1.0.0 -lHSrts -lm -lffi -lgmp -lwsock32 -u _ghczmprim_GHCziTypes_Izh_static_info -u _ghczmprim_GHCziTypes_Czh_static_info -u _ghczmprim_GHCziTypes_Fzh_static_info -u _ghczmprim_GHCziTypes_Dzh_static_info -u _base_GHCziPtr_Ptr_static_info -u _base_GHCziWord_Wzh_static_info -u _base_GHCziInt_I8zh_static_info -u _base_GHCziInt_I16zh_static_info -u _base_GHCziInt_I32zh_static_info -u _base_GHCziInt_I64zh_static_info -u _base_GHCziWord_W8zh_static_info -u _base_GHCziWord_W16zh_static_info -u _base_GHCziWord_W32zh_static_info -u _base_GHCziWord_W64zh_static_info -u _base_GHCziStable_StablePtr_static_info -u _ghczmprim_GHCziTypes_Izh_con_info -u _ghczmprim_GHCziTypes_Czh_con_info -u _ghczmprim_GHCziTypes_Fzh_con_info -u _ghczmprim_GHCziTypes_Dzh_con_info -u _base_GHCziPtr_Ptr_con_info -u _base_GHCziPtr_FunPtr_con_info -u _base_GHCziStable_StablePtr_con_info -u _ghczmprim_GHCziBool_False_closure -u _ghczmprim_GHCziBool_True_closure -u _base_GHCziPack_unpackCString_closure -u _base_GHCziIOBase_stackOverflow_closure -u _base_GHCziIOBase_heapOverflow_closure -u _base_ControlziExceptionziBase_nonTermination_closure -u _base_GHCziIOBase_blockedOnDeadMVar_closure -u _base_GHCziIOBase_blockedIndefinitely_closure -u _base_ControlziExceptionziBase_nestedAtomically_closure -u _base_GHCziWeak_runFinalizzerBatch_closure -u _base_GHCziTopHandler_runIO_closure -u _base_GHCziTopHandler_runNonIO_closure -u _base_GHCziConc_runHandlers_closure -u _base_GHCziConc_ensureIOManagerIsRunning_closure
Reading specs from E:/programme/ghc/ghc-6.10.4/gcc-lib/specs
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)
 E:/programme/ghc/ghc-6.10.4/gcc-lib/collect2.exe -Bdynamic -o h:\.homedir\hugsdata\setup\setup.exe -u _ghczmprim_GHCziTypes_Izh_static_info -u _ghczmprim_GHCziTypes_Czh_static_info -u _ghczmprim_GHCziTypes_Fzh_static_info -u _ghczmprim_GHCziTypes_Dzh_static_info -u _base_GHCziPtr_Ptr_static_info -u _base_GHCziWord_Wzh_static_info -u _base_GHCziInt_I8zh_static_info -u _base_GHCziInt_I16zh_static_info -u _base_GHCziInt_I32zh_static_info -u _base_GHCziInt_I64zh_static_info -u _base_GHCziWord_W8zh_static_info -u _base_GHCziWord_W16zh_static_info -u _base_GHCziWord_W32zh_static_info -u _base_GHCziWord_W64zh_static_info -u _base_GHCziStable_StablePtr_static_info -u _ghczmprim_GHCziTypes_Izh_con_info -u _ghczmprim_GHCziTypes_Czh_con_info -u _ghczmprim_GHCziTypes_Fzh_con_info -u _ghczmprim_GHCziTypes_Dzh_con_info -u _base_GHCziPtr_Ptr_con_info -u _base_GHCziPtr_FunPtr_con_info -u _base_GHCziStable_StablePtr_con_info -u _ghczmprim_GHCziBool_False_closure -u _ghczmprim_GHCziBool_True_closure -u _base_GHCziPack_unpackCString_closure -u _base_GHCziIOBase_stackOverflow_closure -u _base_GHCziIOBase_heapOverflow_closure -u _base_ControlziExceptionziBase_nonTermination_closure -u _base_GHCziIOBase_blockedOnDeadMVar_closure -u _base_GHCziIOBase_blockedIndefinitely_closure -u _base_ControlziExceptionziBase_nestedAtomically_closure -u _base_GHCziWeak_runFinalizzerBatch_closure -u _base_GHCziTopHandler_runIO_closure -u _base_GHCziTopHandler_runNonIO_closure -u _base_GHCziConc_runHandlers_closure -u _base_GHCziConc_ensureIOManagerIsRunning_closure E:/programme/ghc/ghc-6.10.4/gcc-lib/crt2.o E:/programme/ghc/ghc-6.10.4/gcc-lib/crtbegin.o -Lh:\.homedir\.cabal\Cabal-1.6.0.3\ghc-6.10.4 -LE:\programme\ghc\ghc-6.10.4\process-1.0.1.1 -LE:\programme\ghc\ghc-6.10.4\pretty-1.0.1.0 -LE:\programme\ghc\ghc-6.10.4\directory-1.0.0.3 -LE:\programme\ghc\ghc-6.10.4\old-time-1.0.0.2 -LE:\programme\ghc\ghc-6.10.4\old-locale-1.0.0.1 -LE:\programme\ghc\ghc-6.10.4\filepath-1.1.0.2 -LE:\programme\ghc\ghc-6.10.4\Win32-2.2.0.0 -LE:\programme\ghc\ghc-6.10.4\bytestring-0.9.1.4 -LE:\programme\ghc\ghc-6.10.4\containers-0.2.0.1 -LE:\programme\ghc\ghc-6.10.4\array-0.2.0.0 -LE:\programme\ghc\ghc-6.10.4\syb-0.1.0.1 -LE:\programme\ghc\ghc-6.10.4\base-4.1.0.0 -LE:\programme\ghc\ghc-6.10.4\integer-0.1.0.1 -LE:\programme\ghc\ghc-6.10.4\ghc-prim-0.1.0.0 -LE:\programme\ghc\ghc-6.10.4 -LE:\programme\ghc\ghc-6.10.4/gcc-lib -LE:/programme/ghc/ghc-6.10.4/gcc-lib h:\.homedir\hugsdata\setup\Main.o C:\DOKUME~1\Zyx\LOKALE~1\Temp\/ghc2388_0/ghc2388_0.o -lHSCabal-1.6.0.3 -lHSprocess-1.0.1.1 -lHSpretty-1.0.1.0 -lHSdirectory-1.0.0.3 -lHSold-time-1.0.0.2 -lHSold-locale-1.0.0.1 -lHSfilepath-1.1.0.2 -lHSWin32-2.2.0.0 -luser32 -lgdi32 -lwinmm -ladvapi32 -lHSbytestring-0.9.1.4 -lHScontainers-0.2.0.1 -lHSarray-0.2.0.0 -lHSsyb-0.1.0.1 -lHSbase-4.1.0.0 -lwsock32 -luser32 -lshell32 -lHSinteger-0.1.0.1 -lHSghc-prim-0.1.0.0 -lHSrts -lm -lffi -lgmp -lwsock32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt E:/programme/ghc/ghc-6.10.4/gcc-lib/crtend.o
link: done
*** Deleting temp files:
Deleting: C:\DOKUME~1\Zyx\LOKALE~1\Temp\/ghc2388_0/ghc2388_0.o C:\DOKUME~1\Zyx\LOKALE~1\Temp\/ghc2388_0/ghc2388_0.rc
*** Deleting temp dirs:
Deleting: C:\DOKUME~1\Zyx\LOKALE~1\Temp\/ghc2388_0
h:\.homedir\hugsdata\setup\setup.exe configure --verbose=3
--builddir=h:\.homedir\hugsdata --ghc --prefix=h:\.homedir\.cabal
--datadir=h:\.homedir\.cabal
--configure-option=CC=e:\programme\mingw-gcc4\bin\gcc.exe --user
--package-db=h:\.homedir\ghc\i386-mingw32-6.10.4\package.conf
--extra-include-dirs=e:/programme/ghc/mingw-gcc4/include
--extra-lib-dirs=e:/programme/ghc/mingw-gcc4/lib --constraint=base ==3.0.3.1
--with-gcc=e:\programme\ghc\mingw-gcc4\bin\gcc.exe
--with-ld=e:\programme\ghc\mingw-gcc4\bin\ld.exe --gcc-option=-v
--gcc-option=-Wall
Redirecting build log to {handle:
h:\.homedir\hugsdata\build-bindings-common-1.3.3-ghc-6.10.4.log}
Using external setup method with build-type Simple
Creating h:\.homedir\hugsdata\setup (and its parents)
Using Cabal library version 1.6.0.3
Using h:\.homedir\hugsdata\setup\setup.hs as setup script.
h:\.homedir\hugsdata\setup\setup.exe build --verbose=3
--builddir=h:\.homedir\hugsdata
Redirecting build log to {handle:
h:\.homedir\hugsdata\build-bindings-common-1.3.3-ghc-6.10.4.log}
cabal.exe: Error: some packages failed to install:
bindings-common-1.3.3 failed during the building phase. The exception was:
exit: ExitFailure 1