
Hello, Following the directions at http://www.haskell.org/ghc/docs/6.2.1/html/building/sec-porting-ghc.html#UNR...... I have a Debian unstable system on i386 as the host machine and an IBM PowerPC system as the target. I have configured the files as specified in the docs. I am to the "make boot && make" phase in the ghc directory on the (Linux) host. All goes well until: ==fptools== make all -r; in /home/jgoerzen/no-backup/programs/ghc-6.2.1/ghc/rts ------------------------------------------------------------------------ ../../ghc/compiler/ghc-inplace -optc-O -optc-Wall -optc-W -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wbad-function-cast -optc-I../includes -optc-I. -optc-Iparallel -optc-DCOMPILING_RTS -optc-fomit-frame-pointer -H16m -O -O2 -static -c Adjustor.c -o Adjustor.o /tmp/ghc10917.s: Assembler messages: /tmp/ghc10917.s:54: Error: no such instruction: `dcbf 0,%eax' /tmp/ghc10917.s:55: Error: no such instruction: `sync' /tmp/ghc10917.s:56: Error: no such instruction: `icbi 0,%eax' /tmp/ghc10917.s:63: Error: no such instruction: `sync' /tmp/ghc10917.s:64: Error: no such instruction: `isync' make[1]: *** [Adjustor.o] Error 1 make: *** [all] Error 1 Why it's trying to use PowerPC assembler on an x86 host I don't know. (I assume that's what's going on here; but I don't really know.) What is the problem?

jgoerzen:
Hello,
Following the directions at http://www.haskell.org/ghc/docs/6.2.1/html/building/sec-porting-ghc.html#UNR......
I have a Debian unstable system on i386 as the host machine and an IBM PowerPC system as the target. I have configured the files as specified in the docs. I am to the "make boot && make" phase in the ghc directory on the (Linux) host. All goes well until:
You're now in the rts/ on the host machine? If so: "Don't worry if the build falls over in the RTS, we don't need the RTS yet." You can use make -k to keep going, I seem to remember, or use -pgmltrue, to have ghc skip the linking phase. This was a common trick when we went through a porting frenzy last year. Check the mailing list archives for lots of hints. http://www.haskell.org/pipermail/glasgow-haskell-users/2003-September/thread... Adding something like: AR=/usr/bin/true LD=/usr/bin/true SRC_HC_OPTS+= -pgmc /usr/bin/true -pgma /usr/bin/true -pgml /usr/bin/true to build.mk might help. Good luck! :) -- Don
==fptools== make all -r; in /home/jgoerzen/no-backup/programs/ghc-6.2.1/ghc/rts ------------------------------------------------------------------------ ../../ghc/compiler/ghc-inplace -optc-O -optc-Wall -optc-W -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wbad-function-cast -optc-I../includes -optc-I. -optc-Iparallel -optc-DCOMPILING_RTS -optc-fomit-frame-pointer -H16m -O -O2 -static -c Adjustor.c -o Adjustor.o /tmp/ghc10917.s: Assembler messages: /tmp/ghc10917.s:54: Error: no such instruction: `dcbf 0,%eax' /tmp/ghc10917.s:55: Error: no such instruction: `sync' /tmp/ghc10917.s:56: Error: no such instruction: `icbi 0,%eax' /tmp/ghc10917.s:63: Error: no such instruction: `sync' /tmp/ghc10917.s:64: Error: no such instruction: `isync' make[1]: *** [Adjustor.o] Error 1 make: *** [all] Error 1
Why it's trying to use PowerPC assembler on an x86 host I don't know. (I assume that's what's going on here; but I don't really know.)

On 2004-09-30, Donald Bruce Stewart
You can use make -k to keep going, I seem to remember, or use -pgmltrue,
Those tricks got me farther. Now I'm on the target and stuck at: gmake[5]: Entering directory `/home/jgoerzen/programs/unreg/ghc-6.2.1/ghc/rts/gm p/mpn' m4 -DPIC -DOPERATION_mul_1 mul_1.asm >tmp-mul_1.s /bin/sh ../libtool --mode=compile gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DOPE RATION_mul_1 -g -O2 tmp-mul_1.s -o mul_1.lo gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DOPERATION_mul_1 -g -O2 tmp-mul_1.s -o mul_1.o tmp-mul_1.s: Assembler messages: tmp-mul_1.s:55: Error: Unrecognized opcode: `mulhwu' tmp-mul_1.s:61: Error: Unrecognized opcode: `mulhwu' tmp-mul_1.s:67: Error: Unrecognized opcode: `mulhwu' tmp-mul_1.s:73: Error: Unrecognized opcode: `mulhwu' tmp-mul_1.s:82: Error: Unrecognized opcode: `mulhwu' tmp-mul_1.s:91: Error: Unrecognized opcode: `mulhwu' gmake[5]: *** [mul_1.lo] Error 1 gmake[5]: Leaving directory `/home/jgoerzen/programs/unreg/ghc-6.2.1/ghc/rts/gmp /mpn'
to have ghc skip the linking phase. This was a common trick when we went through a porting frenzy last year. Check the mailing list archives for lots of hints.
http://www.haskell.org/pipermail/glasgow-haskell-users/2003-September/thread...
Adding something like: AR=/usr/bin/true LD=/usr/bin/true SRC_HC_OPTS+= -pgmc /usr/bin/true -pgma /usr/bin/true -pgml /usr/bin/true to build.mk might help.
Good luck! :)
-- Don
==fptools== make all -r; in /home/jgoerzen/no-backup/programs/ghc-6.2.1/ghc/rts ------------------------------------------------------------------------ ../../ghc/compiler/ghc-inplace -optc-O -optc-Wall -optc-W -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wbad-function-cast -optc-I../includes -optc-I. -optc-Iparallel -optc-DCOMPILING_RTS -optc-fomit-frame-pointer -H16m -O -O2 -static -c Adjustor.c -o Adjustor.o /tmp/ghc10917.s: Assembler messages: /tmp/ghc10917.s:54: Error: no such instruction: `dcbf 0,%eax' /tmp/ghc10917.s:55: Error: no such instruction: `sync' /tmp/ghc10917.s:56: Error: no such instruction: `icbi 0,%eax' /tmp/ghc10917.s:63: Error: no such instruction: `sync' /tmp/ghc10917.s:64: Error: no such instruction: `isync' make[1]: *** [Adjustor.o] Error 1 make: *** [all] Error 1
Why it's trying to use PowerPC assembler on an x86 host I don't know. (I assume that's what's going on here; but I don't really know.)
-- John Goerzen Author, Foundations of Python Network Programming http://www.amazon.com/exec/obidos/tg/detail/-/1590593715

jgoerzen:
On 2004-09-30, Donald Bruce Stewart
wrote: You can use make -k to keep going, I seem to remember, or use -pgmltrue,
Those tricks got me farther. Now I'm on the target and stuck at:
gmake[5]: Entering directory `/home/jgoerzen/programs/unreg/ghc-6.2.1/ghc/rts/gm p/mpn' m4 -DPIC -DOPERATION_mul_1 mul_1.asm >tmp-mul_1.s /bin/sh ../libtool --mode=compile gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DOPE RATION_mul_1 -g -O2 tmp-mul_1.s -o mul_1.lo gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DOPERATION_mul_1 -g -O2 tmp-mul_1.s -o mul_1.o tmp-mul_1.s: Assembler messages: tmp-mul_1.s:55: Error: Unrecognized opcode: `mulhwu' tmp-mul_1.s:61: Error: Unrecognized opcode: `mulhwu' tmp-mul_1.s:67: Error: Unrecognized opcode: `mulhwu' tmp-mul_1.s:73: Error: Unrecognized opcode: `mulhwu' tmp-mul_1.s:82: Error: Unrecognized opcode: `mulhwu' tmp-mul_1.s:91: Error: Unrecognized opcode: `mulhwu' gmake[5]: *** [mul_1.lo] Error 1 gmake[5]: Leaving directory `/home/jgoerzen/programs/unreg/ghc-6.2.1/ghc/rts/gmp /mpn'
It could be that gmp is a bit too old for your platform. This has been
the case on other rarer platforms, and on (all?) 64bit archs. One
solution is to install a native, newer libgmp yourself (from the
vendor), and then add appropriate flags to have ./configure and gcc/ghc
find the library (if it isn't in a standard location).
On Irix I needed:
export LDFLAGS="-L/usr/freeware/lib64"
export CPPFLAGS="-I/usr/freeware/include"
cat >> mk/build.mk <

In gmane.comp.lang.haskell.cafe, you wrote:
jgoerzen:
/mpn'
It could be that gmp is a bit too old for your platform. This has been
Turns out that both ghc and gmp are confused about the true nature of the platform. It is AIX on PowerPC64, running in 32-bit mode. After significant tweaking to Makefiles (to add -mpowerpc all over the place), things seem to work. I hope I'll actually have it built later today. Sigh. Thanks for your help, though. It is appreciated. I will post the built tree once I have a working ghc. (alt.binaries.haskell anyone? <g>) -- John

jgoerzen:
In gmane.comp.lang.haskell.cafe, you wrote:
jgoerzen:
/mpn'
It could be that gmp is a bit too old for your platform. This has been
Turns out that both ghc and gmp are confused about the true nature of the platform. It is AIX on PowerPC64, running in 32-bit mode. After significant tweaking to Makefiles (to add -mpowerpc all over the place), things seem to work. I hope I'll actually have it built later today. Sigh.
This sounds like a similar issue I had on mips64-irix. It wants to run in 32bit mode, but I have to add compiler flags all over the place to get all the tools to use 64 bits. You may need to use similar settings. Most of the flags can be set in mk/build.mk: # C compiler flags SRC_CC_OPTS+=-mabi=64 # Haskell compiler flags, for gcc, and ld SRC_HC_OPTS+=-optc-mabi=64 -opta-mabi=64 -optl-mabi=64 SRC_CC_OPTS+=-L/usr/freeware/lib64 SRC_HC_OPTS+=-L/usr/freeware/lib64 And the following env vars were needed to be set to help out configure: export LDFLAGS="-L/usr/freeware/lib64 -mabi=64" export CPPFLAGS="-I/usr/freeware/include" export CFLAGS=-mabi=64 # make sure we use 64bit linker export LD="/usr/bin/ld -64" And once this is all built, I need to set some flags in ghc/rts/package.conf, in order to have the correct flags passed through for each future Haskell binary you build.
Thanks for your help, though. It is appreciated. I will post the built tree once I have a working ghc.
Cool. And send in patches too :) -- Don
participants (2)
-
dons@cse.unsw.edu.au
-
John Goerzen