Sign in Join

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

Mailing lists / fpc-pascal / 2010-10

Cross-compiling with FPC 2.5.1

10 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

patspiper

I use the scripts buildcrossbinutils.sh and buildcrosssnapshot.sh to buils the FPC 2.4.2 cross compiler (linux to win32). However when I do the same steps but with FPC 2.5.1, I get the following error:

make all LINKSMART=1 CREATESMART=1
make[4]: Entering directory
`/home/me/Programs/fpc/fpsrc/2.5.1/packages/hermes' /home/me/Programs/fpc/cross_fpc/cross/bin/i686-cygwin-as --32 -o units/i386-win32/mmx_clr.o src/i386/mmx_clr.as
make[4]: /home/me/Programs/fpc/cross_fpc/cross/bin/i686-cygwin-as: Command not found
make[4]: *** [mmx_clr.o] Error 127
make[4]: Leaving directory
`/home/me/Programs/fpc/fpsrc/2.5.1/packages/hermes' make[3]: *** [fpc_smart] Error 2
make[3]: Leaving directory
`/home/me/Programs/fpc/fpsrc/2.5.1/packages/hermes' make[2]: *** [hermes_smart] Error 2
make[2]: Leaving directory `/home/me/Programs/fpc/fpsrc/2.5.1/packages' make[1]: *** [packages_smart] Error 2
make[1]: Leaving directory `/home/me/Programs/fpc/fpsrc/2.5.1' make: *** [build-stamp.i386-win32] Error 2

What should I do to build the 2.5.1 crosscompiler successully?

leledumbo
to patspiper
make[4]: /home/me/Programs/fpc/cross_fpc/cross/bin/i686-cygwin-as: Command not found

The error is very clear, do you have the assembler in the indicated directory? Make sure the result of building binutils have i686-cygwin- prefix. Otherwise, you have to specify -XP compiler option to specify the prefix used.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Cross-compiling-with-FPC-2-5-1-tp3236321p3236639.html Sent from the Free Pascal - General mailing list .
patspiper
to leledumbo
leledumbo wrote 9 lines
> make[4]: /home/me/Programs/fpc/cross_fpc/cross/bin/i686-cygwin-as: > Command not found > The error is very clear, do you have the assembler in the indicated directory? Make sure the result of building binutils have i686-cygwin- prefix. Otherwise, you have to specify -XP compiler option to specify the prefix used.

The buildcrossbinutils.sh script produces i686-mingw32- binaries only (no i686-cygwin-), and yet, FPC 2.4.2 cross compiles without any problem. What is different about 2.5.1?
Have you crosscompiled 2.5.1 successfully?

Vincent Snijders
to patspiper

2010/10/26 patspiper

The buildcrossbinutils.sh script produces i686-mingw32- binaries only (no i686-cygwin-), and yet, FPC 2.4.2 cross compiles without any problem. What is different about 2.5.1?

Probably 2.5.1 contains assembler files, so it needs an assembler, 2.4.2 only pascal source fails, that the compiler can assemble.

Maybe for 2.4.2 you don't need any binutils, except windres maybe. Maybe windres is not necessary either and fpcres is used.

Vincent

patspiper
to Vincent Snijders
Vincent Snijders wrote 16 lines
2010/10/26 patspiper < > The buildcrossbinutils.sh script produces i686-mingw32- binaries only (no i686-cygwin-), and yet, FPC 2.4.2 cross compiles without any problem. What is different about 2.5.1? Probably 2.5.1 contains assembler files, so it needs an assembler, 2.4.2 only pascal source fails, that the compiler can assemble. Maybe for 2.4.2 you don't need any binutils, except windres maybe. Maybe windres is not necessary either and fpcres is used. Vincent

i686-mingw32-as is present in the crossbinutils bin folder. But the error concerns i686-cygwin-as...why would it ask for the assembler with a i686-cygwin prefix?

Jonas Maebe
to patspiper
patspiper wrote
i686-mingw32-as is present in the crossbinutils bin folder. But the error concerns i686-cygwin-as...why would it ask for the assembler with a i686-cygwin prefix?

Because that's probably the version that the person who added support for cross-assembling to Win32 used. You can change the prefix by adding the following to your make command line:

OPT="-XPi686-mingw32-"

If that crossbinutils folder is not in your path, you also have to use

OPT="-XPi686-mingw32- -FD/full/path/to/crossbinutils"

Jonas

Marco van de Voort
to Jonas Maebe

In our previous episode, Jonas Maebe said:

Show quoted text 9 lines
Because that's probably the version that the person who added support for cross-assembling to Win32 used. You can change the prefix by adding the following to your make command line: OPT="-XPi686-mingw32-" If that crossbinutils folder is not in your path, you also have to use OPT="-XPi686-mingw32- -FD/full/path/to/crossbinutils"

IIRC it is wiser to use the variables (CROSSBINDIR and CROSSBINUTILSPREFIX or so, see buildfaq), because these are then only applied to the relevant cycles of make crosscycle.

patspiper
to Jonas Maebe: Because that's probably the version that the person who added support for…
Jonas Maebe wrote 16 lines
On 26 Oct 2010, at 16:38, patspiper wrote: > i686-mingw32-as is present in the crossbinutils bin folder. But the > error concerns i686-cygwin-as...why would it ask for the assembler > with a i686-cygwin prefix? Because that's probably the version that the person who added support for cross-assembling to Win32 used. You can change the prefix by adding the following to your make command line: OPT="-XPi686-mingw32-" If that crossbinutils folder is not in your path, you also have to use OPT="-XPi686-mingw32- -FD/full/path/to/crossbinutils"

The wiki needs correction: binutils should be built for cygwin and not mingw32 as cygwin is hardcoded for win32 in the script buildcrossbinutils.sh. It so happens, as Vincent pointed out, that 2.4.2 did not need the binutils.

I rebuilt the cross binutils for cygwin and both FPC 2.4.2 and 2.5.1 were crosscompiled successfully :)

patspiper
to Marco van de Voort: In our previous episode, Jonas Maebe said: IIRC it is wiser to use the variables…
Marco van de Voort wrote
IIRC it is wiser to use the variables (CROSSBINDIR and CROSSBINUTILSPREFIX or so, see buildfaq), because these are then only applied to the relevant cycles of make crosscycle.

The script buildcrosssnapshot.sh uses CROSSBINDIR and BINUTILSPREFIX already. All I had to do is build the binutils for cygwin as cygwin is hardcoded for win32 in the script.