Author Topic: Cross-compiling dynamic library for Linux ARM  (Read 2496 times)


  • New member
  • *
  • Posts: 6
Cross-compiling dynamic library for Linux ARM
« on: June 24, 2020, 01:18:20 pm »

I'm unable to link dynamic library for Linux ARM, when cross-compiling from linux x64.
Everything works fine for executables (ARM and x64), and dynamic libraries on x64.

Code: Pascal  [Select][+][-]
  1. library knihovna;
  3. {$mode objfpc}{$H+}
  4. {$R *.res}
  6. function Get_Version: Int32; cdecl;
  7. begin
  8.   Result := 1;
  9. end;
  11. exports
  12.   Get_Version;
  14. begin
  15. end.  

Compile Project, Mode: ARM, CPU: arm, Target: Exit code 1, Errors: 1
/home/shareman/Lazarus_FPC/Lazarus_2_0_0/cross/bin/arm-linux/arm-linux-gnueabihf-ld: warning: /media/sf_Projekty_FPC/Temp/17_dll_so/so/link.res contains output sections; did you forget -T?
/home/shareman/Lazarus_FPC/Lazarus_2_0_0/cross/bin/arm-linux/arm-linux-gnueabihf-ld: cannot find /lib/
knihovna.lpr(17,0) Error: Error while linking

/lib/ exists at the specified location, if I copy it to the project directory warnings disappear, but the linking error persists.

Is there any way to fix it?

Thanks for the help.

OS: Linux Mint XFCE x64
Lazarus: 2.0.0
FPC:   3.0.4   


  • New member
  • *
  • Posts: 6
Re: Cross-compiling dynamic library for Linux ARM
« Reply #1 on: November 24, 2021, 04:36:00 pm »
@mata_fp did you find a solution to this problem?

I have a Console application that dynamically loads a library file. It works fine when compiled for x86_64. When compiled for ARM, the console application runs until it attempts to load a function from the .so library.



TinyPortal © 2005-2018