Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-01

headaches trying to create x86_64 to i386 cross-compile deb package

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Seth Grover

I've been trying to follow the directions here
http://wiki.lazarus.freepascal.org/How_to_setup_a_FPC_and_Lazarus_Ubuntu_repository to build FPC .deb packages. I was able to build
fpc_2.4.2-110120_amd64.deb and fpc-src_2.4.2-110120_amd64.deb packages and install them without any problems by following those directions (and making a minor modification changing an "Svn export" to a "cp -a" since the source directory I was building from is not a working copy).

However, I'm now trying to build a package for the x86_64 to i386 cross compiler. The "usage" printout of create_fpc_deb.sh says to specify OS_TARGET, CPU_TARGET, and BINUTILSPREFIX as environment variables, which I am doing. The first time I tried it it griped about ppcross386 not being available, which I thought was strange (since isn't that what I'm building) so I copied ppcross386 from another machine into my /usr/bin so it would be available. However, the "make" portion of the script is failing.

The command I'm running looks like:

OS_TARGET=linux CPU_TARGET=i386 BINUTILSPREFIX=i386-linux- ./create_fpc_deb.sh fpc /home/nitrodev/tmp/fpc-2.4.2

I see the script run through it's stuff and it gets to the part where it's going to execute:

make clean all FPCArch=i386 OS_TARGET=linux FPC=/usr/bin/ppcross386 BINUTILSPREFIX=i386-linux- CROSSINSTALL=1

It does the "make clean" stuff apparently Ok, but when it goes to build I see stuff like:

/usr/bin/ppcross386 -Ur -Ur -Xs -O2 -n -Fi../inc -Fi../x86_64 -Fi../unix -Fix86_64 -FE.
-FU/home/nitrodev/tmp/fpc_patchdir/fpc/rtl/units/x86_64-linux -Cg -dx86_64 -dRELEASE -Us -Sg system.pp
syscall.inc(18,2) Error: Illegal assembler style specified "GAS" syscall.inc(23,15) Error: Invalid register name
etc...

I've done a "make crossinstall" before on other machines and it works fine, but I'm trying to use this script to create the .deb and I'm not sure how the "make" and "make install" equate to what I've done before.

Is this broken? Am I doing something obviously wrong?

I'm attaching the output to this bug and I've also put it at http://pastebin.com/Hj4Uu0RG.

Any help would be appreciated.

-SG

_

This email is fiction. Any resemblance to actual events or persons living or dead is purely coincidental. Seth Grover sethdgrover[at]gmail[dot]com
Jonas Maebe
to Seth Grover
Seth Grover wrote 6 lines
However, I'm now trying to build a package for the x86_64 to i386 cross compiler. The "usage" printout of create_fpc_deb.sh says to specify OS_TARGET, CPU_TARGET, and BINUTILSPREFIX as environment variables, which I am doing. The first time I tried it it griped about ppcross386 not being available, which I thought was strange (since isn't that what I'm building)

That indeed means that the script is buggy for building cross- compilers. Since it's in the Lazarus svn repository, you may want to report that on the Lazarus list (although they're probably maintained by Abou Al Montacir, and he may also be on this list).

so I copied ppcross386 from another machine into my /usr/bin so it would be available. However, the "make" portion of the script is failing.

If you start a top level "make all" in the top level FPC dir using a cross-compiler as starting compiler, the makefile will fail because it will always first build the rtl/compiler for your OS' real architecture (i.e., in this case it is trying to build the x86-64 RTL using an i386 cross-compiler). In general, using a cross-compiler to start "make all" is not supported and the real fix has to be performed in that script, but you can work around the problem you are having by also explicitly setting CPU_SOURCE=i386 (although that's a hack).

Jonas