[fpc-devel] assumed bug in the RTL with ARM v5 regarding loading dynamic libraries
Thomas Schatzl
tom_at_work at gmx.at
Wed Jan 23 10:20:50 CET 2013
Hi,
[topic is about a compilation problem specific to qnap ARM/linux based
NASes using the heavily modded stock OS]
On Wed, 2013-01-23 at 09:33 +0100, Michael Schnell wrote:
>
> My project uses Synapse but features link problems and crashes when I
> resolve same.
> Tracking this down:
>
> Synapse uses the unit dynlibs
>
> dynlibs uses the unit dl
>
> dl does not have a "uses" clause, so the problem seems to be here.
>
> When in a dedicated test project I just do "uses dl", I get the
> linker message about _fini and _init, that I feature with any use of
> Synapse.
>
> This can be resolved by
> {$I crti.o}
> and copying crti.o from /lib in my system to the project directory.
> crti.o supposedly came with the libc-devel package that had been
> fetched when installing gcc.
when you install libc-dev using ipkg on qnap (or install anything
using ipkg), *everything* is installed into the /opt subdirectory.
So if you copy and use some random crti.o from somewhere it won't work.
On my qnap, there is no crti.o in /lib for example.
You can specify the path where the linker searches for libraries (and
crt* files) using the -Fl command line parameter too. So you don't need
to copy around files at all.
On my arm qnap, after installing libc-dev, crti.o and friends are
located in /opt/arm-none-linux-gnueabi/lib
So, to compile your test program successfully, try the following
program:
program test;
uses cmem, dynlibs;
begin
writeln('Hello');
end.
Compile with:
ppcarm -Fl/opt/arm-none-linux-gnueabi/lib test.pas
Hth,
Thomas
P.S.: It might be useful to start a bug report with the used compiler
version and platform, maybe with a compilable test program as simple as
the one above. Everything that you think might be needed to understand
the context and reproduce the issue.
Especially if you start a new thread, so that other readers not
following your qnap problems from the beginning in already X different
threads have a chance to understand and comment without reading 50 or so
emails.
Thanks.
More information about the fpc-devel
mailing list