Recent

Author Topic: How can I compile a 32-Bit ELF with 64-Bit Linux?  (Read 5865 times)

Fred556

  • New Member
  • *
  • Posts: 26
    • Copy Protection Software
How can I compile a 32-Bit ELF with 64-Bit Linux?
« on: October 30, 2009, 02:27:55 pm »
Hello,

I have OpenSuse11.1 and would like compile a 32Bit Elf File.

But I have no project. Only one dpr file and this compile. So no config exists.
Is there a compiler command to inlcude this in dpr file?
Programmer Software and other copy protection tools.

Fred556

  • New Member
  • *
  • Posts: 26
    • Copy Protection Software
Re: How can I compile a 32-Bit ELF with 64-Bit Linux?
« Reply #1 on: October 31, 2009, 02:29:19 pm »
Hello,

when I compile my project with command
fpc test.pas

And I check them with
"file test" Then it told me
test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.4.0,statically linked, stripped

How can I compile a 32-bit LSB executable in a OpenSuse 11.1 64-Bit.
Programmer Software and other copy protection tools.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2706
Re: How can I compile a 32-Bit ELF with 64-Bit Linux?
« Reply #2 on: November 02, 2009, 11:31:15 am »
find a x86 version of fpc.
Then build a "new" fpc with it so rtl and fcl is compiled for x86.
Code: [Select]
fpc_source_dir> make all PP=your_path_to_ppc386install it and make sure you fpc.cfg contains something like (in my case)
Code: [Select]
# 32-bits
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl
# 64-bits
-Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget
-Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/*
-Fu/usr/lib64/fpc/$fpcversion/units/$fpctarget/rtl

Now you have a 32bit fpc installation. Next is lazarus.
Compile the LCL for 32 bit:
Code: [Select]
lazarus_source_dir> make lcl PP=ppc386
Now you can compile for 32bit or 64bit
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018