Hello List.
I've cross built gpc20060325 for ppc-linux target. In order to do that I've made the changes attached.
The second and the third changes were needed because otherwise compilation process called xgpc (cross-compiler just built) with native CFLAGS (-O2 -g -march=i386 -mcpu=i686) which it didn't want to accept.
The first change allowed me to install the result compiler as ppc-linux-gpc instead of ppc-linuxppc-linux-gpc as it wanted to do first. Perhaps some changes are to be made in sources.
diff -urN gpc-20060325/p/Make-lang.in gpc-20060325-ppc/p/Make-lang.in --- gpc-20060325/p/Make-lang.in 2006-03-25 06:33:50.000000000 +0300 +++ gpc-20060325-ppc/p/Make-lang.in 2006-08-29 19:04:08.057019832 +0400 @@ -179,7 +179,8 @@
# Actual names to use when installing a cross-compiler. GPC_CROSS_NAME_=`t='$(program_transform_cross_name)'; echo gpc | sed $$t` -GPC_CROSS_NAME_34=$(target_noncanonical)`t='$(program_transform_name)'; echo gpc | sed $$t` +#GPC_CROSS_NAME_34=$(target_noncanonical)`t='$(program_transform_name)'; echo gpc | sed $$t` +GPC_CROSS_NAME_34=`t='$(program_transform_name)'; echo gpc | sed $$t` GPC_CROSS_NAME=$(GPC_CROSS_NAME_$(GPC_GCC_34_))
# The GPC to use for compiling libgpc.a @@ -228,8 +229,8 @@ RTS_FLAGS_TO_PASS_ALL=\ GCC_VERSION="$(GPC_GCC_VERSION)" \ SHELL="$(SHELL)" \ - CFLAGS="$(CFLAGS)" \ - PFLAGS="$(PFLAGS)" \ + CFLAGS="-O2 -g -mcpu=405" \ + PFLAGS="-O2 -g -mcpu=405" \ AR_FLAGS="$(AR_FLAGS)" \ RTSFLAGS="$(RTSFLAGS)" \ DESTDIR="../.." @@ -778,7 +779,7 @@ $(srcdir)/p/script/mkdir-p p/rts src=`cd $(srcdir) && pwd` && \ cd ./p/rts && \ - $(RTS_COMPILERS) CONFIG_SITE=nonexisting-file \ + $(RTS_COMPILERS) $(RTS_FLAGS_TO_PASS) CONFIG_SITE=nonexisting-file \ $$src/p/rts/configure --silent > /dev/null --srcdir=$$src/p/rts \ `if [ x$(WITH_SHARED) = xyes ]; then echo '--with-shared'; fi`
Best regards, Igor Marnat mailto:marny@rambler.ru