Recent

Author Topic: Cross compilation in Debian 64 to 32  (Read 3833 times)

benohb

  • Full Member
  • ***
  • Posts: 213
Cross compilation in Debian 64 to 32
« on: June 02, 2016, 10:07:20 am »



Code: Pascal  [Select][+][-]
  1. ...
  2. ..
  3. /bin/rm -f i386/ppcppc64 i386/ppcarm i386/ppcmips i386/ppcmipsel i386/ppcjvm i386/ppc8086 i386/ppca64 i386/ppc386
  4. /bin/rm -f ppc386
  5. /bin/mkdir -p i386/units/i386-linux
  6. /usr/share/fpcsrc/3.1.1/compiler/ppcross386 -Pi386 -XPi386-linux- -Xr -Ur -Xs -O2 -n -Fui386 -Fusystems -Fu/usr/share/fpcsrc/3.1.1/rtl/units/i386-linux -Fii386 -FE. -FUi386/units/i386-linux -dRELEASE -di386 -dGDB -dBROWSERLOG -Fux86 -Sew    -di386 -dGDB -dBROWSERLOG -Fux86 -Sew pp.pas
  7. ld: no input files
  8. pp.pas(228,1) Error: Error while linking
  9. pp.pas(228,1) Fatal: There were 1 errors compiling module, stopping
  10. Fatal: Compilation aborted
  11. Makefile:4073: recipe for target 'ppc386' failed
  12. make[3]: *** [ppc386] Error 1
  13. make[3]: Leaving directory '/usr/share/fpcsrc/3.1.1/compiler'
  14. Makefile:4154: recipe for target 'cycle' failed
  15. make[2]: *** [cycle] Error 2
  16. make[2]: Leaving directory '/usr/share/fpcsrc/3.1.1/compiler'
  17. Makefile:2861: recipe for target 'compiler_cycle' failed
  18. make[1]: *** [compiler_cycle] Error 2
  19. make[1]: Leaving directory '/usr/share/fpcsrc/3.1.1'
  20. Makefile:2893: recipe for target 'build-stamp.i386-linux' failed
  21. make: *** [build-stamp.i386-linux] Error 2





Code: Pascal  [Select][+][-]
  1.  
  2. which i386-linux-ld
  3. /usr/bin/i386-linux-ld
  4.  
  5.  
  6.  
  7. which i386-linux-as
  8. /usr/bin/i386-linux-a
  9.  


Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: Cross compilation in Debian 64 to 32
« Reply #1 on: June 02, 2016, 10:35:06 am »
I am missing -FD/usr/bin/
The rest looks pretty ok to me.
Since it is a cross-compiler I seem to remember somehow that /usr/bin is not a default perse.
So give that a try.

The other option is that you point to real 32bit linker and assembler( instead of 64bit compiled versions that link and assemble 32 bit) , which will ONLY work on a dual 32/64 system, which you need to install.
That's called multiarch. You also have to install binutils-multiarch.
« Last Edit: June 02, 2016, 10:42:10 am by Thaddy »
Specialize a type, not a var.

benohb

  • Full Member
  • ***
  • Posts: 213
Re: Cross compilation in Debian 64 to 32
« Reply #2 on: June 03, 2016, 01:54:16 am »
Thank you Thaddy  :)
I have found the solution , There is a difference between
 this
http://rpdev.net/home/book/export/html/33
and this
http://wiki.freepascal.org/Cross_compiling




The information in the fpc.wiki. Wrong


..the correct



/usr/bin/i386-linux-ld
Code: Pascal  [Select][+][-]
  1. #!/bin/bash
  2. ld -melf_i386 "$@"
  3.  
/usr/bin/i386-linux-as
Code: Pascal  [Select][+][-]
  1. #!/bin/bash
  2. as --32 "$@"
  3.  
« Last Edit: June 03, 2016, 02:02:13 am by benohb »

 

TinyPortal © 2005-2018