* * *

Author Topic: Cross compilation libraries from Win32 to Linux  (Read 1096 times)

regs

  • New member
  • *
  • Posts: 42
Cross compilation libraries from Win32 to Linux
« on: August 29, 2016, 05:11:04 am »
having error
C:\FPC\3.0.0\bin\i386-Win32\x86_64-linux-ld.exe: cannot find /lib64/ld-linux-x86-64.so.2

File is in folder with all other libraries. It's provided with -FI. Apps cross compiles well, but not libraries. Tried -Xd as suggested in some threads, but still same. Am I missing something?

Thaddy

  • Hero Member
  • *****
  • Posts: 4423
Re: Cross compilation libraries from Win32 to Linux
« Reply #1 on: August 29, 2016, 09:01:38 am »
What you are missing is that for that platform the internal linker and assembler  will just work. Don't need to specify an internal linker or assembler.
What you DO have to do is maybe set some options that are linux specific. like maybe -fPIC and -Tlinux

If you want to use un external linker anyway, the options are -FL\path\to\the\linker\ld (capital L, not lowercase l, not -Fl) , use -XP<x> for the binutilsprefix and -FD<binutils path>
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

regs

  • New member
  • *
  • Posts: 42
Re: Cross compilation libraries from Win32 to Linux
« Reply #2 on: August 29, 2016, 09:14:13 am »
there is a full command line from project options. if i change library to program everything goes well.

Code: Pascal  [Select]
  1.  -Tlinux -Px86_64 -MObjFPC -Scghi -Cg -O1 -Xs -l -vewnhibq -Fis:\libtest\lib\linux-x86_64-gtk2
  2. -Flc:\fpc\3.0.0\libraries\linux\x86_64 -FuC:\lazarus-trunk\lcl\units\x86_64-linux\gtk2 -FuC:\lazarus-trunk\lcl\units\x86_64-linux
  3. -FuC:\lazarus-trunk\components\lazutils\lib\x86_64-linux -FuC:\lazarus-trunk\packager\units\x86_64-linux
  4. -Fus:\libtest\ -FUs:\libtest\lib\linux-x86_64-gtk2\ -FEs:\libtest\bin\ -olibtest.so -dLCL -dLCLgtk2




edit: this indeed did it
-FLc:\fpc\3.0.0\libraries\linux\x86_64\ld-linux-x86-64.so.2
« Last Edit: August 29, 2016, 09:23:00 am by regs »

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus