porting using unregisterised build: x86->amd64 solaris

Hello, I'm attempting to make unregisterised build of recent GHC head on Solaris/x86 for Solaris/amd64 platform. I'm closely following: http://hackage.haskell.org/trac/ghc/wiki/Building/Porting#Cross-compilingtop... with the only one issue: mentioned: echo compiler/main/Config.hs >> list seems to be incorrect due to missing compiler/main/Config.hs file which means gtar will fail on it later. However I've got to the: <T>$ make all_ghc_stage2 2>&1 | tee c.log step which fails with: gmake -r --no-print-directory -f ghc.mk phase=0 just-makefiles "" configure --with-ghc="/export/home/karel/vcs/ghc-target/" --with-ghc-pkg="/export/home/karel/vcs/ghc-target/" --with-gcc="/usr/bin/gcc" --configure-option=--with-cc="/usr/bin/gcc" --ghc-option=-DOMIT_NATIVE_CODEGEN --ghc-option=-DNO_REGS --flags=stage2 --ghc-option=-DSTAGE=2 --disable-library-for-ghci --with-hscolour="/usr/local/bin/HsColour" --configure-option=CFLAGS="-g -O0 -DNO_REGS -DUSE_MINIINTERPRETER -D__GLASGOW_HASKELL__=613 -Iincludes " --configure-option=LDFLAGS=" " -- stage2 compiler /bin/sh: line 1: : cannot execute [Is a directory] gmake[1]: *** [compiler/stage2/package-data.mk] Error 126 gmake: *** [all_ghc_stage2] Error 2 To me it looks like it's perhaps expecting to have `ghc' binary in /export/home/karel/vcs/ghc-target/ but there is only `ghc' subdirectory there hence failing. Also I'm not sure I've detected correctly mentioned "unimportant build failures in the RTS" as I've got one which looks like: gmake -r --no-print-directory -f ghc.mk all "inplace/bin/ghc-stage1" -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes -optc-Irts -optc-DCOMPILING_RTS -optc-DNOSMP -optc-fno-strict-aliasing -optc-fno-common -optc-Ilibffi/build/include -optc-fomit-frame-pointer -optc-DRtsWay=\"rts_v\" -H32m -O -H32m -Iincludes -Irts -DCOMPILING_RTS -package-name rts -optc-DNOSMP -dcmm-lint -Ilibffi/build/include -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -keep-hc-files -c rts/Linker.c -o rts/dist/build/Linker.o rts/Linker.c: In function `do_Elf_Rel_relocations': rts/Linker.c:3784:0: warning: cast from pointer to integer of different size rts/Linker.c:3785:0: warning: cast to pointer from integer of different size rts/Linker.c:3807:0: warning: cast from pointer to integer of different size rts/Linker.c:3815:0: warning: cast from pointer to integer of different size rts/Linker.c:3819:0: warning: cast from pointer to integer of different size rts/Linker.c: In function `do_Elf_Rela_relocations': rts/Linker.c:3866:0: warning: cast from pointer to integer of different size rts/Linker.c:3903:0: warning: cast from pointer to integer of different size rts/Linker.c:3915:0: warning: cast from pointer to integer of different size rts/Linker.c:4028:0: error: `R_X86_64_64' undeclared (first use in this function) rts/Linker.c:4028:0: error: (Each undeclared identifier is reported only once rts/Linker.c:4028:0: error: for each function it appears in.) rts/Linker.c:4029:0: warning: cast to pointer from integer of different size rts/Linker.c:4032:0: error: `R_X86_64_PC32' undeclared (first use in this function) rts/Linker.c:4038:0: warning: comparison between signed and unsigned rts/Linker.c:4048:0: warning: cast to pointer from integer of different size rts/Linker.c:4056:0: warning: cast to pointer from integer of different size rts/Linker.c:4060:0: error: `R_X86_64_32' undeclared (first use in this function) rts/Linker.c:4074:0: warning: cast to pointer from integer of different size rts/Linker.c:4078:0: error: `R_X86_64_32S' undeclared (first use in this function) rts/Linker.c:4082:0: warning: comparison between signed and unsigned rts/Linker.c:4092:0: warning: cast to pointer from integer of different size rts/Linker.c:4096:0: error: `R_X86_64_GOTPCREL' undeclared (first use in this function) rts/Linker.c:4100:0: warning: cast to pointer from integer of different size rts/Linker.c:4104:0: error: `R_X86_64_PLT32' undeclared (first use in this function) rts/Linker.c:4110:0: warning: comparison between signed and unsigned rts/Linker.c:4115:0: warning: cast to pointer from integer of different size gmake[1]: *** [rts/dist/build/Linker.o] Error 1 gmake: *** [all] Error 2 karel@silence:~/vcs/ghc-host$ I do have two questions: 1) is the url above describing cross-compiling GHC for porting up-to-date? 2) is there any trick how to get my last step (i.e. <T>$ make all_ghc_stage2 2>&1 | tee c.log) working? Thanks! Karel

Hello, this email below is originally from September 22 so are also the source code which I comment in it. Originally this email was rejected being sent from unsubscribed email address and I noted this just today so I resent it again especially when seeing the email `Attempt at building on OpenBSD/sparc64 - failure at "make all_ghc_stage2"' by Benjamin Jansen who seems to get into the same troubles as me. Thanks, Karel On 10/02/10 20:25, Karel Gardas wrote:
Hello,
I'm attempting to make unregisterised build of recent GHC head on Solaris/x86 for Solaris/amd64 platform. I'm closely following:
http://hackage.haskell.org/trac/ghc/wiki/Building/Porting#Cross-compilingtop...
with the only one issue: mentioned: echo compiler/main/Config.hs >> list
seems to be incorrect due to missing compiler/main/Config.hs file which means gtar will fail on it later.
However I've got to the: <T>$ make all_ghc_stage2 2>&1 | tee c.log step which fails with:
gmake -r --no-print-directory -f ghc.mk phase=0 just-makefiles "" configure --with-ghc="/export/home/karel/vcs/ghc-target/" --with-ghc-pkg="/export/home/karel/vcs/ghc-target/" --with-gcc="/usr/bin/gcc" --configure-option=--with-cc="/usr/bin/gcc" --ghc-option=-DOMIT_NATIVE_CODEGEN --ghc-option=-DNO_REGS --flags=stage2 --ghc-option=-DSTAGE=2 --disable-library-for-ghci --with-hscolour="/usr/local/bin/HsColour" --configure-option=CFLAGS="-g -O0 -DNO_REGS -DUSE_MINIINTERPRETER -D__GLASGOW_HASKELL__=613 -Iincludes " --configure-option=LDFLAGS=" " -- stage2 compiler /bin/sh: line 1: : cannot execute [Is a directory] gmake[1]: *** [compiler/stage2/package-data.mk] Error 126 gmake: *** [all_ghc_stage2] Error 2
To me it looks like it's perhaps expecting to have `ghc' binary in /export/home/karel/vcs/ghc-target/ but there is only `ghc' subdirectory there hence failing.
Also I'm not sure I've detected correctly mentioned "unimportant build failures in the RTS" as I've got one which looks like:
gmake -r --no-print-directory -f ghc.mk all "inplace/bin/ghc-stage1" -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Iincludes -optc-Irts -optc-DCOMPILING_RTS -optc-DNOSMP -optc-fno-strict-aliasing -optc-fno-common -optc-Ilibffi/build/include -optc-fomit-frame-pointer -optc-DRtsWay=\"rts_v\" -H32m -O -H32m -Iincludes -Irts -DCOMPILING_RTS -package-name rts -optc-DNOSMP -dcmm-lint -Ilibffi/build/include -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -keep-hc-files -c rts/Linker.c -o rts/dist/build/Linker.o rts/Linker.c: In function `do_Elf_Rel_relocations':
rts/Linker.c:3784:0: warning: cast from pointer to integer of different size
rts/Linker.c:3785:0: warning: cast to pointer from integer of different size
rts/Linker.c:3807:0: warning: cast from pointer to integer of different size
rts/Linker.c:3815:0: warning: cast from pointer to integer of different size
rts/Linker.c:3819:0: warning: cast from pointer to integer of different size rts/Linker.c: In function `do_Elf_Rela_relocations':
rts/Linker.c:3866:0: warning: cast from pointer to integer of different size
rts/Linker.c:3903:0: warning: cast from pointer to integer of different size
rts/Linker.c:3915:0: warning: cast from pointer to integer of different size
rts/Linker.c:4028:0: error: `R_X86_64_64' undeclared (first use in this function)
rts/Linker.c:4028:0: error: (Each undeclared identifier is reported only once
rts/Linker.c:4028:0: error: for each function it appears in.)
rts/Linker.c:4029:0: warning: cast to pointer from integer of different size
rts/Linker.c:4032:0: error: `R_X86_64_PC32' undeclared (first use in this function)
rts/Linker.c:4038:0: warning: comparison between signed and unsigned
rts/Linker.c:4048:0: warning: cast to pointer from integer of different size
rts/Linker.c:4056:0: warning: cast to pointer from integer of different size
rts/Linker.c:4060:0: error: `R_X86_64_32' undeclared (first use in this function)
rts/Linker.c:4074:0: warning: cast to pointer from integer of different size
rts/Linker.c:4078:0: error: `R_X86_64_32S' undeclared (first use in this function)
rts/Linker.c:4082:0: warning: comparison between signed and unsigned
rts/Linker.c:4092:0: warning: cast to pointer from integer of different size
rts/Linker.c:4096:0: error: `R_X86_64_GOTPCREL' undeclared (first use in this function)
rts/Linker.c:4100:0: warning: cast to pointer from integer of different size
rts/Linker.c:4104:0: error: `R_X86_64_PLT32' undeclared (first use in this function)
rts/Linker.c:4110:0: warning: comparison between signed and unsigned
rts/Linker.c:4115:0: warning: cast to pointer from integer of different size gmake[1]: *** [rts/dist/build/Linker.o] Error 1 gmake: *** [all] Error 2 karel@silence:~/vcs/ghc-host$
I do have two questions:
1) is the url above describing cross-compiling GHC for porting up-to-date? 2) is there any trick how to get my last step (i.e. <T>$ make all_ghc_stage2 2>&1 | tee c.log) working?
Thanks! Karel _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On Sat, Oct 02, 2010 at 08:25:53PM +0200, Karel Gardas wrote:
step which fails with:
gmake -r --no-print-directory -f ghc.mk phase=0 just-makefiles "" configure --with-ghc="/export/home/karel/vcs/ghc-target/" --with-ghc-pkg="/export/home/karel/vcs/ghc-target/" --with-gcc="/usr/bin/gcc" --configure-option=--with-cc="/usr/bin/gcc" --ghc-option=-DOMIT_NATIVE_CODEGEN --ghc-option=-DNO_REGS --flags=stage2 --ghc-option=-DSTAGE=2 --disable-library-for-ghci --with-hscolour="/usr/local/bin/HsColour" --configure-option=CFLAGS="-g -O0 -DNO_REGS -DUSE_MINIINTERPRETER -D__GLASGOW_HASKELL__=613 -Iincludes " --configure-option=LDFLAGS=" " -- stage2 compiler /bin/sh: line 1: : cannot execute [Is a directory] gmake[1]: *** [compiler/stage2/package-data.mk] Error 126 gmake: *** [all_ghc_stage2] Error 2
It's trying to create/update compiler/stage2/package-data.mk with ghc-cabal (but you don't have ghc-cabal, so it's running ""), but it should be using the file that already exists. Does the file exist? If so, "make -dr all_ghc_stage2" should show why make thinks it's out of date, which should point to the problem.
Also I'm not sure I've detected correctly mentioned "unimportant build failures in the RTS" as I've got one which looks like:
rts/Linker.c: In function `do_Elf_Rel_relocations':
Failures in compiling C files are fine. It's the Haskell/cmm files we need to compile, so that we get .hc files that can be built on the target. Thanks Ian

On Tue, Oct 05, 2010 at 04:25:46PM +0100, Ian Lynagh wrote:
On Sat, Oct 02, 2010 at 08:25:53PM +0200, Karel Gardas wrote:
step which fails with:
gmake -r --no-print-directory -f ghc.mk phase=0 just-makefiles "" configure --with-ghc="/export/home/karel/vcs/ghc-target/" --with-ghc-pkg="/export/home/karel/vcs/ghc-target/" --with-gcc="/usr/bin/gcc" --configure-option=--with-cc="/usr/bin/gcc" --ghc-option=-DOMIT_NATIVE_CODEGEN --ghc-option=-DNO_REGS --flags=stage2 --ghc-option=-DSTAGE=2 --disable-library-for-ghci --with-hscolour="/usr/local/bin/HsColour" --configure-option=CFLAGS="-g -O0 -DNO_REGS -DUSE_MINIINTERPRETER -D__GLASGOW_HASKELL__=613 -Iincludes " --configure-option=LDFLAGS=" " -- stage2 compiler /bin/sh: line 1: : cannot execute [Is a directory] gmake[1]: *** [compiler/stage2/package-data.mk] Error 126 gmake: *** [all_ghc_stage2] Error 2
It's trying to create/update compiler/stage2/package-data.mk with ghc-cabal (but you don't have ghc-cabal, so it's running ""), but it should be using the file that already exists.
Does the file exist?
If so, "make -dr all_ghc_stage2" should show why make thinks it's out of date, which should point to the problem.
Incidentally, the rule is in rules/build-package-data.mk Thanks Ian

On 10/05/10 17:25, Ian Lynagh wrote:
On Sat, Oct 02, 2010 at 08:25:53PM +0200, Karel Gardas wrote:
step which fails with:
gmake -r --no-print-directory -f ghc.mk phase=0 just-makefiles "" configure --with-ghc="/export/home/karel/vcs/ghc-target/" --with-ghc-pkg="/export/home/karel/vcs/ghc-target/" --with-gcc="/usr/bin/gcc" --configure-option=--with-cc="/usr/bin/gcc" --ghc-option=-DOMIT_NATIVE_CODEGEN --ghc-option=-DNO_REGS --flags=stage2 --ghc-option=-DSTAGE=2 --disable-library-for-ghci --with-hscolour="/usr/local/bin/HsColour" --configure-option=CFLAGS="-g -O0 -DNO_REGS -DUSE_MINIINTERPRETER -D__GLASGOW_HASKELL__=613 -Iincludes " --configure-option=LDFLAGS=" " -- stage2 compiler /bin/sh: line 1: : cannot execute [Is a directory] gmake[1]: *** [compiler/stage2/package-data.mk] Error 126 gmake: *** [all_ghc_stage2] Error 2
It's trying to create/update compiler/stage2/package-data.mk with ghc-cabal (but you don't have ghc-cabal, so it's running ""), but it should be using the file that already exists.
Does the file exist?
If so, "make -dr all_ghc_stage2" should show why make thinks it's out of date, which should point to the problem.
The file exists and `gmake -dr all_ghc_stage2' shows following info. It seems `compiler/stage2/package-data.mk' is outdated due to `compiler/stage2/build/Config.hs' being newer that it. Finished prerequisites of target file `compiler/stage2/package-data.mk'. Prerequisite `compiler/ghc.cabal' is older than target `compiler/stage2/package-data.mk'. Prerequisite `libraries/haskeline/dist-install/package-data.mk' is older than target `compiler/stage2/package-data.mk'. Prerequisite `compiler/stage2/build/Config.hs' is newer than target `compiler/stage2/package-data.mk'. Prerequisite `compiler/ghc.mk' is older than target `compiler/stage2/package-data.mk'. Must remake target `compiler/stage2/package-data.mk'. "" configure --with-ghc="/export/home/karel/vcs/ghc-target/" --with-ghc-pkg="/export/home/karel/vcs/ghc-target/" --with-gcc="/usr/bin/gcc" --configure-option=--with-cc="/usr/bin/gcc" --ghc-option=-DOMIT_NATIVE_CODEGEN --ghc-option=-DNO_REGS --flags=stage2 --ghc-option=-DSTAGE=2 --disable-library-for-ghci --with-hscolour="/usr/local/bin/HsColour" --configure-option=CFLAGS="-g -O0 -DNO_REGS -DUSE_MINIINTERPRETER -D__GLASGOW_HASKELL__=613 -Iincludes " --configure-option=LDFLAGS=" " -- stage2 compiler Putting child 0x081bb6a8 (compiler/stage2/package-data.mk) PID 17110 on the chain. Live child 0x081bb6a8 (compiler/stage2/package-data.mk) PID 17110 /bin/sh: line 1: : cannot execute [Is a directory] Reaping losing child 0x081bb6a8 PID 17110 gmake[1]: *** [compiler/stage2/package-data.mk] Error 126 Removing child 0x081bb6a8 PID 17110 from chain. Reaping losing child 0x08097060 PID 17080 gmake: *** [all_ghc_stage2] Error 2 Removing child 0x08097060 PID 17080 from chain. karel@silence:~/vcs/ghc-target$ Please let me know if this is enough or if I shall send whole output of gmake for your reference. Thanks, Karel

On Tue, Oct 05, 2010 at 07:21:43PM +0200, Karel Gardas wrote:
On 10/05/10 17:25, Ian Lynagh wrote:
Does the file exist?
If so, "make -dr all_ghc_stage2" should show why make thinks it's out of date, which should point to the problem.
The file exists and `gmake -dr all_ghc_stage2' shows following info. It seems `compiler/stage2/package-data.mk' is outdated due to `compiler/stage2/build/Config.hs' being newer that it.
Aha, OK, this should fix it: touch -r inplace/lib/package.conf.d */*/package-data.mk */*/*/package-data.mk compiler/stage*/build/Config.hs I've updated the wiki page. Thanks Ian

On Oct 5, 2010, at 3:02 PM, Ian Lynagh wrote:
On Tue, Oct 05, 2010 at 07:21:43PM +0200, Karel Gardas wrote:
On 10/05/10 17:25, Ian Lynagh wrote:
Does the file exist?
If so, "make -dr all_ghc_stage2" should show why make thinks it's out of date, which should point to the problem.
The file exists and `gmake -dr all_ghc_stage2' shows following info. It seems `compiler/stage2/package-data.mk' is outdated due to `compiler/stage2/build/Config.hs' being newer that it.
Aha, OK, this should fix it:
touch -r inplace/lib/package.conf.d */*/package-data.mk */*/*/package-data.mk compiler/stage*/build/Config.hs
In my case (see thread "Attempt at building on OpenBSD/sparc64 - failure at "make all_ghc_stage2") the problem file was `compiler/main/Config.hs', so I had to add it to the touch command line: touch -r inplace/lib/package.conf.d */*/package-data.mk */*/*/package-data.mk compiler/stage*/build/Config.hs compiler/main/Config.hs Thanks! - Ben

On 10/06/10 00:02, Ian Lynagh wrote:
On Tue, Oct 05, 2010 at 07:21:43PM +0200, Karel Gardas wrote:
On 10/05/10 17:25, Ian Lynagh wrote:
Does the file exist?
If so, "make -dr all_ghc_stage2" should show why make thinks it's out of date, which should point to the problem.
The file exists and `gmake -dr all_ghc_stage2' shows following info. It seems `compiler/stage2/package-data.mk' is outdated due to `compiler/stage2/build/Config.hs' being newer that it.
Aha, OK, this should fix it:
touch -r inplace/lib/package.conf.d */*/package-data.mk */*/*/package-data.mk compiler/stage*/build/Config.hs
I've updated the wiki page.
Ian, thanks for the update. However it does not help here for I don't know what reason exactly (perhaps previous false attempts might also corrupt the build tree) so I'm running with today's sources again. Now, it even doesn't go that far and fails on first step: <T>$ make bootstrapping-files done on the target machine. This is the step right before you go (on Wiki) and describe what to do on host machine in `On the host machine' paragraph. The failure which I get from the step above is: [59 of 63] Compiling Distribution.Simple.Build ( libraries/Cabal/Distribution/Simple/Build.hs, bootstrapping/Distribution/Simple/Build.o ) [60 of 63] Compiling Distribution.Simple.Haddock ( libraries/Cabal/Distribution/Simple/Haddock.hs, bootstrapping/Distribution/Simple/Haddock.o ) [61 of 63] Compiling Distribution.Simple.Test ( libraries/Cabal/Distribution/Simple/Test.hs, bootstrapping/Distribution/Simple/Test.o ) [62 of 63] Compiling Distribution.Simple ( libraries/Cabal/Distribution/Simple.hs, bootstrapping/Distribution/Simple.o ) [63 of 63] Compiling Main ( utils/ghc-cabal/ghc-cabal.hs, bootstrapping/Main.o ) Linking utils/ghc-cabal/dist/build/tmp/ghc-cabal ... touch utils/ghc-cabal/dist/build/tmp/ghc-cabal "cp" utils/ghc-cabal/dist/build/tmp/ghc-cabal inplace/bin/ghc-cabal gmake[1]: *** No rule to make target `utils/ghc-pkg/dist-install/build/tmp/ghc-pkg', needed by `inplace/bin/ghc-pkg'. Stop. gmake: *** [bootstraping-files] Error 2 I think this is wrong, since `On the host machine' paragraph then requires to copy some includes files from the target directory build which are not on the required place. My guess is that they need to be generated in the `gmake bootstrapping-files' which fails here too early. Any idea what's going wrong here? Thanks! Karel
participants (3)
-
Benjamin Jansen
-
Ian Lynagh
-
Karel Gardas