Sign in Join

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

Mailing lists / lazarus / 2010-09

Cross Compile: from 64 to i386 on linux

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Osvaldo Filho

Cross Compile: from 64 to i386 on linux

Environment:
Ubuntu 10.04 64
lazarus from subversion
fpc 2.4.3 from subversion

Error Message:
/usr/bin/ld: warning: link.res contains output sections; did you forget -T? /usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o when searching for /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o
/usr/bin/ld: cannot find /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o ycv.lpr(23,1) Error: Error while linking
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100915/c117a0e9/attachment.html>

Reply by email

Torsten Bonde Christiansen
to Osvaldo Filho
Show quoted text 9 lines
Error Message: /usr/bin/ld: warning: link.res contains output sections; did you forget -T? /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o when searching for /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o /usr/bin/ld: cannot find /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o ycv.lpr(23,1) Error: Error while linking

This is probably because you havn't set up the fpc.cfg correctly. Check that there is a part that looks like this:

#ifdef cpui386
-Xd
-Fl/lib32
-Fl/usr/lib32
#endif

It informs the compiler to skip the regular library paths, but to search the 32-bit ones instead.

Also beware that you may need to manually create som symbolic link for some of the gcc lib files, fpc expects older version not present in ubuntu 10.04, but creating symbolic links does the trick.

Hope that helps as a start.

Kind regards,
Torsten Bonde Christiansen.

Reply by email

Osvaldo Filho
to Torsten Bonde Christiansen

The same problem! :-(

-----
/usr/bin/ld: warning: link.res contains output sections; did you forget -T? /usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o when searching for /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o
/usr/bin/ld: cannot find /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o ycv.lpr(23,1) Error: Error while linking
ycv.lpr(23,1) Fatal: There were 1 errors compiling module, stopping -----

My fpc.cfg
---
# set binutils prefix

#IFNDEF CPUI386
#IFNDEF CPUAMD64
#DEFINE NEEDCROSSBINUTILS
#ENDIF
#ENDIF

#ifdef cpui386
-Xd
-Fl/usr/lib32
-Fl/lib32
#endif

#IFNDEF linux
#DEFINE NEEDCROSSBINUTILS
#ENDIF

#IFDEF FPC_CROSSCOMPILING
#IFDEF NEEDCROSSBINUTILS
-XP$fpctarget-
#ENDIF NEEDCROSSBINUTILS
#ENDIF

---

2010/9/15 Torsten Bonde Christiansen

Show quoted text 37 lines
Error Message: > /usr/bin/ld: warning: link.res contains output sections; did you forget > -T? > /usr/bin/ld: skipping incompatible > /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o when searching for > /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o > /usr/bin/ld: cannot find /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbegin.o > ycv.lpr(23,1) Error: Error while linking > > This is probably because you havn't set up the fpc.cfg correctly. Check that there is a part that looks like this: #ifdef cpui386 -Xd -Fl/lib32 -Fl/usr/lib32 #endif It informs the compiler to skip the regular library paths, but to search the 32-bit ones instead. Also beware that you may need to manually create som symbolic link for some of the gcc lib files, fpc expects older version not present in ubuntu 10.04, but creating symbolic links does the trick. Hope that helps as a start. Kind regards, Torsten Bonde Christiansen. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100915/a6d74ca9/attachment-0001.html>

Reply by email