Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-05

CThreads problem when cross-compiling to ARM/RPi.

18 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bruce Tulloch

Starting with a simple test program arm-test.pas:

program test;
begin
  writeln('DATE ',{$i %DATE%});
  writeln('FPCTARGET ',{$i %FPCTARGET%});
  writeln('FPCTARGETCPU ',{$i %FPCTARGETCPU%});
  writeln('FPCTARGETOS ',{$i %FPCTARGETOS%});
  writeln('FPCVERSION ',{$i %FPCVERSION%});
end.

I can cross-compile:

Free Pascal Compiler version 2.7.1 [2013/05/20] for arm Copyright (c) 1993-2013 by Florian Klaempfl and others Target OS: Linux for ARMHF
Compiling arm-test.pas
Assembling test
Linking arm-test
8 lines compiled, 0.1 sec

successfully producing this:

arm-test: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.0.0, stripped

which when executed produces:

DATE 2013/05/23
FPCTARGET arm
FPCTARGETCPU arm
FPCTARGETOS Linux
FPCVERSION 2.7.1

All good, the ARM cross-compiler is working.

However, if I simply add this uses clause:

uses
  cthreads;

the program compiles fine but fails when linking:

Linking arm-test-threads
/usr/local/lib/fpc/2.7.1/
units/arm-linux/rtl/cthreads.o: In function
`CTHREADS_$$_LOADPTHREADS$$BOOLEAN':
cthreads.pp:(.text.n_cthreads_$$_loadpthreads$$boolean+0xc): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a(dlopen.o): In function `dlopen':
(.text+0xc): undefined reference to `__dlopen'
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a(dlclose.o): In function `dlclose':
(.text+0x0): undefined reference to `__dlclose'
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a(dlsym.o): In function `dlsym':
(.text+0xc): undefined reference to `__dlsym'
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a(dladdr.o): In function `dladdr':
(.text+0x0): undefined reference to `__dladdr'
An error occurred while linking arm-test-threads

When compiling the same code native (x86_64) or cross compiled to Linux i386, this does not happen (i.e the program links and executes fine). The ARM linux system against which I'm linking is raspbian for RPi.

The relevant compiler configuration is:

#IFDEF CPUARM
-Xd
-k--sysroot=/usr/local/opt/chroot/raspbian/rootfs
-Fl/usr/local/opt/chroot/raspbian/rootfs/lib/arm-linux-gnueabihf -Fl/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf -FD/usr/local/opt/binutils/bin
-XP$FPCTARGET-
#ENDIF

What am I doing wrong?

Thanks, Bruce.

Reply by email

Jonas Maebe
to Bruce Tulloch
Bruce Tulloch wrote 16 lines
However, if I simply add this uses clause: uses cthreads; the program compiles fine but fails when linking: Linking arm-test-threads /usr/local/lib/fpc/2.7.1/ units/arm-linux/rtl/cthreads.o: In function `CTHREADS_$$_LOADPTHREADS$$BOOLEAN': cthreads.pp:(.text.n_cthreads_$$_loadpthreads$$boolean+0xc): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

Why/how are you trying to create a statically linked binary? As the message above explains, statically linking libdl relies on a bunch of library magic. At the very least you'll probably also have to link libc explicitly, but I would really recommend to link dynamically instead. Support for binaries statically linked against C libraries is generally very much untested, and known not to work on certain platforms (e.g. Linux/x86-64).

Jonas

Reply by email

Bruce Tulloch
to Jonas Maebe

Okay, so I'm not trying to link statically, not intentionally anyway.

Here's the command line from ppas.sh that produces this error:

/usr/local/opt/binutils/bin/arm-linux-ld \
--sysroot=/usr/local/opt/chroot/raspbian/rootfs \
--dynamic-linker=/lib/ld-linux-armhf.so.3 \
-s -L. -o arm-test-threads link.res

and the dynamic linker referred to is:

file ld-linux-armhf.so.3
ld-linux-armhf.so.3: symbolic link to `arm-linux-gnueabihf/ld-2.13.so' file arm-linux-gnueabihf/ld-2.13.so
arm-linux-gnueabihf/ld-2.13.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked,
BuildID[sha1]=0x40caad061df15685e213cec1e4dfe1ba5f67701c, stripped

Any clues? -b

Jonas Maebe wrote 34 lines
On 23 May 2013, at 14:10, Bruce Tulloch wrote: However, if I simply add this uses clause: > > uses > cthreads; > > the program compiles fine but fails when linking: > > Linking arm-test-threads > /usr/local/lib/fpc/2.7.1/ > units/arm-linux/rtl/cthreads.**o: In function > `CTHREADS_$$_LOADPTHREADS$$**BOOLEAN': > cthreads.pp:(.text.n_cthreads_**$$_loadpthreads$$boolean+0xc): warning: > Using > 'dlopen' in statically linked applications requires at runtime the shared > libraries from the glibc version used for linking > Why/how are you trying to create a statically linked binary? As the message above explains, statically linking libdl relies on a bunch of library magic. At the very least you'll probably also have to link libc explicitly, but I would really recommend to link dynamically instead. Support for binaries statically linked against C libraries is generally very much untested, and known not to work on certain platforms (e.g. Linux/x86-64). Jonas ______________________________**_________________ fpc-pascal maillist - http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>

Reply by email

Jonas Maebe
to Bruce Tulloch
Bruce Tulloch wrote 28 lines
On Thu, May 23, 2013 at 10:18 PM, Jonas Maebe < >wrote: > On 23 May 2013, at 14:10, Bruce Tulloch wrote: > >> Linking arm-test-threads >> /usr/local/lib/fpc/2.7.1/ >> units/arm-linux/rtl/cthreads.**o: In function >> `CTHREADS_$$_LOADPTHREADS$$**BOOLEAN': >> cthreads.pp:(.text.n_cthreads_**$$_loadpthreads$$boolean+0xc): >> warning: >> Using >> 'dlopen' in statically linked applications requires at runtime the >> shared >> libraries from the glibc version used for linking >> > > Why/how are you trying to create a statically linked binary? As the > message above explains, statically linking libdl relies on a bunch of > library magic. At the very least you'll probably also have to link > libc > explicitly, but I would really recommend to link dynamically instead. > Support for binaries statically linked against C libraries is > generally > very much untested, and known not to work on certain platforms (e.g. > Linux/x86-64). > Okay, so I'm not trying to link statically, not intentionally anyway.

Do you have a libdl.so in your library search path? And what kind of reference to libdl does link.res contain?

Jonas

Reply by email

Bruce Tulloch
to Jonas Maebe

Yes, it's in the search path as:

ls -l libdl*
-rw-r--r-- 1 root root 9812 Feb 23 00:37 libdl-2.13.so lrwxrwxrwx 1 root root 13 Feb 23 00:37 libdl.so.2 -> libdl-2.13.so

It's referred to in an INPUT statement in link.res as:

INPUT(
-lpthread
-ldl
)

and there are two search statements:

SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf/") SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/lib/arm-linux-gnueabihf/")

at the top of the file which suggest it should be found okay.

Jonas Maebe wrote 42 lines
On 23 May 2013, at 14:25, Bruce Tulloch wrote: On Thu, May 23, 2013 at 10:18 PM, Jonas Maebe > **wrote: > > On 23 May 2013, at 14:10, Bruce Tulloch wrote: >> >> Linking arm-test-threads >>> /usr/local/lib/fpc/2.7.1/ >>> units/arm-linux/rtl/cthreads.****o: In function >>> `CTHREADS_$$_LOADPTHREADS$$****BOOLEAN': >>> cthreads.pp:(.text.n_cthreads_****$$_loadpthreads$$boolean+**0xc): >>> warning: >>> >>> Using >>> 'dlopen' in statically linked applications requires at runtime the >>> shared >>> libraries from the glibc version used for linking >>> >>> >> Why/how are you trying to create a statically linked binary? As the >> message above explains, statically linking libdl relies on a bunch of >> library magic. At the very least you'll probably also have to link libc >> explicitly, but I would really recommend to link dynamically instead. >> Support for binaries statically linked against C libraries is generally >> very much untested, and known not to work on certain platforms (e.g. >> Linux/x86-64). >> >> Okay, so I'm not trying to link statically, not intentionally anyway. > Do you have a libdl.so in your library search path? And what kind of reference to libdl does link.res contain? Jonas ______________________________**_________________ fpc-pascal maillist - http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>

Reply by email

Bruce Tulloch
to Bruce Tulloch

Just noticed another INPUT statement also refers to dl as:

/usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/dl.o

This appears ahead of the -ldl statement.

Could this be the problem? -b

Bruce Tulloch wrote 70 lines
Yes, it's in the search path as: ls -l libdl* -rw-r--r-- 1 root root 9812 Feb 23 00:37 libdl-2.13.so lrwxrwxrwx 1 root root 13 Feb 23 00:37 libdl.so.2 -> libdl-2.13.so It's referred to in an INPUT statement in link.res as: INPUT( -lpthread -ldl ) and there are two search statements: SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf/") SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/lib/arm-linux-gnueabihf/") at the top of the file which suggest it should be found okay. On Thu, May 23, 2013 at 10:28 PM, Jonas Maebe wrote: > > On 23 May 2013, at 14:25, Bruce Tulloch wrote: > > On Thu, May 23, 2013 at 10:18 PM, Jonas Maebe < >> >**wrote: >> >> On 23 May 2013, at 14:10, Bruce Tulloch wrote: >>> >>> Linking arm-test-threads >>>> /usr/local/lib/fpc/2.7.1/ >>>> units/arm-linux/rtl/cthreads.****o: In function >>>> `CTHREADS_$$_LOADPTHREADS$$****BOOLEAN': >>>> cthreads.pp:(.text.n_cthreads_****$$_loadpthreads$$boolean+**0xc): >>>> warning: >>>> >>>> Using >>>> 'dlopen' in statically linked applications requires at runtime the >>>> shared >>>> libraries from the glibc version used for linking >>>> >>>> >>> Why/how are you trying to create a statically linked binary? As the >>> message above explains, statically linking libdl relies on a bunch of >>> library magic. At the very least you'll probably also have to link libc >>> explicitly, but I would really recommend to link dynamically instead. >>> Support for binaries statically linked against C libraries is generally >>> very much untested, and known not to work on certain platforms (e.g. >>> Linux/x86-64). >>> >>> Okay, so I'm not trying to link statically, not intentionally anyway. >> > > Do you have a libdl.so in your library search path? And what kind of > reference to libdl does link.res contain? > > > > Jonas > ______________________________**_________________ > fpc-pascal maillist - > http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal> >

Reply by email

Jonas Maebe
to Bruce Tulloch: Yes, it's in the search path as: ls -l libdl* -rw-r--r-- 1 root root 9812 Feb 23 00:37…
Bruce Tulloch wrote 14 lines
On Thu, May 23, 2013 at 10:28 PM, Jonas Maebe < >wrote: > > On 23 May 2013, at 14:25, Bruce Tulloch wrote: > > Do you have a libdl.so in your library search path? And what kind of > reference to libdl does link.res contain? > Yes, it's in the search path as: ls -l libdl* -rw-r--r-- 1 root root 9812 Feb 23 00:37 libdl-2.13.so lrwxrwxrwx 1 root root 13 Feb 23 00:37 libdl.so.2 -> libdl-2.13.so

You don't have libdl.so, only libdl.so.2. The latter is for use at run time, the former for use at link/compile time. Install the libc-dev or similar package in your crossroot to get it along with other missing symlinks. Do not start creating those manually, it will only lead to errors and confusion down the line.

Show quoted text 15 lines
It's referred to in an INPUT statement in link.res as: INPUT( -lpthread -ldl ) and there are two search statements: SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux- gnueabihf/") SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/lib/arm-linux- gnueabihf/") at the top of the file which suggest it should be found okay.

The linker will only look for libdl.so and resolve it to its target in case it's a symlink, so that the symlink is no longer required at run time. It will not look for libdl.so.<something>, that one is used by the programs at run time (since the symlinks at compile/link time pointed to it and the linker will write the name of this symlink target into the binary's list of linked libraries).

Show quoted text 5 lines
Just noticed another INPUT statement also refers to dl as: /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/dl.o This appears ahead of the -ldl statement.

That is the object file of the Pascal "dl" unit. It is unrelated to your library issue.

Jonas

Reply by email

Bruce Tulloch
to Jonas Maebe

Okay, but it is installed:

apt-file search libdl.so
libc6: /lib/arm-linux-gnueabihf/libdl.so.2
libc6-dev: /usr/lib/arm-linux-gnueabihf/libdl.so

apt-show-versions libc6-dev
libc6-dev/wheezy uptodate 2.13-38+rpi2

but I noticed that:

ls -l libdl*
-rw-r--r-- 1 root root 9042 Feb 23 00:38 libdl.a
lrwxrwxrwx 1 root root 35 Feb 23 00:38 libdl.so -> /lib/arm-linux-gnueabihf/libdl.so.2

which means they're the same file.

Checking my host x86_64 system we have:

ls -l libdl*
-rw-r--r-- 1 root root 13074 Dec 31 02:36 libdl.a
lrwxrwxrwx 1 root root 32 Dec 31 02:36 libdl.so -> /lib/x86_64-linux-gnu/libdl.so.2

but building native on the host does not produce this problem.

Still confused :-) -b

Jonas Maebe wrote 68 lines
On 23 May 2013, at 14:32, Bruce Tulloch wrote: On Thu, May 23, 2013 at 10:28 PM, Jonas Maebe > **wrote: > > >> On 23 May 2013, at 14:25, Bruce Tulloch wrote: >> >> Do you have a libdl.so in your library search path? And what kind of >> reference to libdl does link.res contain? >> >> Yes, it's in the search path as: > > ls -l libdl* > -rw-r--r-- 1 root root 9812 Feb 23 00:37 libdl-2.13.so > lrwxrwxrwx 1 root root 13 Feb 23 00:37 libdl.so.2 -> libdl-2.13.so > You don't have libdl.so, only libdl.so.2. The latter is for use at run time, the former for use at link/compile time. Install the libc-dev or similar package in your crossroot to get it along with other missing symlinks. Do not start creating those manually, it will only lead to errors and confusion down the line. It's referred to in an INPUT statement in link.res as: > > INPUT( > -lpthread > -ldl > ) > > and there are two search statements: > > SEARCH_DIR("/usr/local/opt/**chroot/raspbian/rootfs/usr/** > lib/arm-linux-gnueabihf/") > SEARCH_DIR("/usr/local/opt/**chroot/raspbian/rootfs/lib/** > arm-linux-gnueabihf/") > > at the top of the file which suggest it should be found okay. > The linker will only look for libdl.so and resolve it to its target in case it's a symlink, so that the symlink is no longer required at run time. It will not look for libdl.so.<something>, that one is used by the programs at run time (since the symlinks at compile/link time pointed to it and the linker will write the name of this symlink target into the binary's list of linked libraries). Just noticed another INPUT statement also refers to dl as: > > /usr/local/lib/fpc/2.7.1/**units/arm-linux/rtl/dl.o > > This appears ahead of the -ldl statement. > That is the object file of the Pascal "dl" unit. It is unrelated to your library issue. Jonas ______________________________**_________________ fpc-pascal maillist - http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>

Reply by email

Jonas Maebe
to Bruce Tulloch
Bruce Tulloch wrote 38 lines
On Thu, May 23, 2013 at 10:50 PM, Jonas Maebe < >wrote: > > On 23 May 2013, at 14:32, Bruce Tulloch wrote: > > On Thu, May 23, 2013 at 10:28 PM, Jonas Maebe < > > >> **wrote: >> >> >>> On 23 May 2013, at 14:25, Bruce Tulloch wrote: >>> >>> Do you have a libdl.so in your library search path? And what kind >>> of >>> reference to libdl does link.res contain? >>> >>> Yes, it's in the search path as: >> >> ls -l libdl* >> -rw-r--r-- 1 root root 9812 Feb 23 00:37 libdl-2.13.so >> lrwxrwxrwx 1 root root 13 Feb 23 00:37 libdl.so.2 -> libdl-2.13.so >> > > You don't have libdl.so, only libdl.so.2. The latter is for use at > run > time, the former for use at link/compile time. Install the libc-dev > or > similar package in your crossroot to get it along with other missing > symlinks. Do not start creating those manually, it will only lead > to errors > and confusion down the line. > Okay, but it is installed: apt-file search libdl.so libc6: /lib/arm-linux-gnueabihf/libdl.so.2 libc6-dev: /usr/lib/arm-linux-gnueabihf/libdl.so

The topic of this thread is about cross-compiling, but those are the files on the native system. Are you getting this error while cross- compiling or while compiling natively? If you are compiling natively, try compiling something with "gcc -### x.c -ldl" to see what parameters gcc passes to linker (create an empty x.c file first).

Show quoted text 11 lines
apt-show-versions libc6-dev libc6-dev/wheezy uptodate 2.13-38+rpi2 but I noticed that: ls -l libdl* -rw-r--r-- 1 root root 9042 Feb 23 00:38 libdl.a lrwxrwxrwx 1 root root 35 Feb 23 00:38 libdl.so -> /lib/arm-linux-gnueabihf/libdl.so.2 which means they're the same file.

Yes, they are the same file. Why that is the case and why nevertheless need both is what I tried to explain in my previous message.

Jonas

Reply by email

Bruce Tulloch
to Jonas Maebe

Okay, I understand the reason for the two file locations, thanks.

The problem occurs ONLY when cross-compiling to ARM. Native (and cross to i386) is fine.

The files I referred to are on the crossroot not the host despite appearances; the crossroot is at /usr/local/opt/chroot/raspbian/rootfs but I reported these files in my previous email from within a qemu enabled chroot (so they looked like they were native). The machine name "beria" is the chroot and "fermi" is the host.

My apologies for the confusion.

-b

Jonas Maebe wrote 73 lines
On 23 May 2013, at 15:03, Bruce Tulloch wrote: On Thu, May 23, 2013 at 10:50 PM, Jonas Maebe > **wrote: > > >> On 23 May 2013, at 14:32, Bruce Tulloch wrote: >> >> On Thu, May 23, 2013 at 10:28 PM, Jonas Maebe < >> > >> >>> **wrote: >>> >>> >>> >>> On 23 May 2013, at 14:25, Bruce Tulloch wrote: >>>> >>>> Do you have a libdl.so in your library search path? And what kind of >>>> reference to libdl does link.res contain? >>>> >>>> Yes, it's in the search path as: >>>> >>> >>> ls -l libdl* >>> -rw-r--r-- 1 root root 9812 Feb 23 00:37 libdl-2.13.so >>> lrwxrwxrwx 1 root root 13 Feb 23 00:37 libdl.so.2 -> libdl-2.13.so >>> >>> >> You don't have libdl.so, only libdl.so.2. The latter is for use at run >> time, the former for use at link/compile time. Install the libc-dev or >> similar package in your crossroot to get it along with other missing >> symlinks. Do not start creating those manually, it will only lead to >> errors >> and confusion down the line. >> >> Okay, but it is installed: > > apt-file search libdl.so > libc6: /lib/arm-linux-gnueabihf/**libdl.so.2 > libc6-dev: /usr/lib/arm-linux-gnueabihf/**libdl.so > The topic of this thread is about cross-compiling, but those are the files on the native system. Are you getting this error while cross-compiling or while compiling natively? If you are compiling natively, try compiling something with "gcc -### x.c -ldl" to see what parameters gcc passes to linker (create an empty x.c file first). apt-show-versions libc6-dev > libc6-dev/wheezy uptodate 2.13-38+rpi2 > > but I noticed that: > > ls -l libdl* > -rw-r--r-- 1 root root 9042 Feb 23 00:38 libdl.a > lrwxrwxrwx 1 root root 35 Feb 23 00:38 libdl.so -> > /lib/arm-linux-gnueabihf/**libdl.so.2 > > which means they're the same file. > Yes, they are the same file. Why that is the case and why nevertheless need both is what I tried to explain in my previous message. Jonas ______________________________**_________________ fpc-pascal maillist - http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>

Reply by email

Bruce Tulloch
to Bruce Tulloch

I have to pack it in for about 8 hours (I'm "down under") but I can provide more feedback then.

By way of background, I have cross-compilation set up and working well for Linux i386 and Windows i385 and x86_64 targets from this x86_64 development system.

I debootstrapped a raspbian system using qemu to add the ARM/RPi as a new target when I ran into this problem.

The setup I've used for this target is very similar to the Linux i386 cross setup which works just fine. I've compared the linker arguments and link.res between the i386 and ARM cross builds and cannot see a difference which looks material to the problem.

Any suggestions as to what else I can try or where else I can look for a solution are welcome!

Thanks for all your advice so far, it's most appreciated. -b

Bruce Tulloch wrote 93 lines
Okay, I understand the reason for the two file locations, thanks. The problem occurs ONLY when cross-compiling to ARM. Native (and cross to i386) is fine. The files I referred to are on the crossroot not the host despite appearances; the crossroot is at /usr/local/opt/chroot/raspbian/rootfs but I reported these files in my previous email from within a qemu enabled chroot (so they looked like they were native). The machine name "beria" is the chroot and "fermi" is the host. My apologies for the confusion. -b On Thu, May 23, 2013 at 11:19 PM, Jonas Maebe wrote: > > On 23 May 2013, at 15:03, Bruce Tulloch wrote: > > On Thu, May 23, 2013 at 10:50 PM, Jonas Maebe < >> >**wrote: >> >> >>> On 23 May 2013, at 14:32, Bruce Tulloch wrote: >>> >>> On Thu, May 23, 2013 at 10:28 PM, Jonas Maebe < >>> > >>> >>>> **wrote: >>>> >>>> >>>> >>>> On 23 May 2013, at 14:25, Bruce Tulloch wrote: >>>>> >>>>> Do you have a libdl.so in your library search path? And what kind of >>>>> reference to libdl does link.res contain? >>>>> >>>>> Yes, it's in the search path as: >>>>> >>>> >>>> ls -l libdl* >>>> -rw-r--r-- 1 root root 9812 Feb 23 00:37 libdl-2.13.so >>>> lrwxrwxrwx 1 root root 13 Feb 23 00:37 libdl.so.2 -> libdl-2.13.so >>>> >>>> >>> You don't have libdl.so, only libdl.so.2. The latter is for use at run >>> time, the former for use at link/compile time. Install the libc-dev or >>> similar package in your crossroot to get it along with other missing >>> symlinks. Do not start creating those manually, it will only lead to >>> errors >>> and confusion down the line. >>> >>> Okay, but it is installed: >> >> apt-file search libdl.so >> libc6: /lib/arm-linux-gnueabihf/**libdl.so.2 >> libc6-dev: /usr/lib/arm-linux-gnueabihf/**libdl.so >> > > The topic of this thread is about cross-compiling, but those are the > files on the native system. Are you getting this error while > cross-compiling or while compiling natively? If you are compiling natively, > try compiling something with "gcc -### x.c -ldl" to see what parameters gcc > passes to linker (create an empty x.c file first). > > > apt-show-versions libc6-dev >> libc6-dev/wheezy uptodate 2.13-38+rpi2 >> >> but I noticed that: >> >> ls -l libdl* >> -rw-r--r-- 1 root root 9042 Feb 23 00:38 libdl.a >> lrwxrwxrwx 1 root root 35 Feb 23 00:38 libdl.so -> >> /lib/arm-linux-gnueabihf/**libdl.so.2 >> >> which means they're the same file. >> > > Yes, they are the same file. Why that is the case and why nevertheless > need both is what I tried to explain in my previous message. > > > > Jonas > ______________________________**_________________ > fpc-pascal maillist - > http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal> >

Reply by email

Bruce Tulloch
to Bruce Tulloch

Raspbian is a Debian Wheezy derived distribution for ARMHF on Raspberry Pi. My attempts to replicate the exactly same setup for a Wheezy based i386 target (so I could compare with this one) ran into problems when cross compiled and linked:

http://lists.freepascal.org/lists/fpc-pascal/2013-May/038241.html

In that case the cross compile did not pull in libgcc but I found a temporary hack to work around it. Perhaps they are related? They are both Wheezy based crossroots.

The key question for my ARM cross compile is why does it report:

/usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/cthreads.o: In function `CTHREADS_$$_LOADPTHREADS$$BOOLEAN': cthreads.pp:
(.text.n_cthreads_$$_loadpthreads$$boolean+0xc): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

when linking. I've checked the linker script and arguments and nowhere am I (or FPC) asking for a static link, so why is this message reported?

What else can cause ld to attempt a static link?

Bruce.

Bruce Tulloch wrote 117 lines
I have to pack it in for about 8 hours (I'm "down under") but I can provide more feedback then. By way of background, I have cross-compilation set up and working well for Linux i386 and Windows i385 and x86_64 targets from this x86_64 development system. I debootstrapped a raspbian system using qemu to add the ARM/RPi as a new target when I ran into this problem. The setup I've used for this target is very similar to the Linux i386 cross setup which works just fine. I've compared the linker arguments and link.res between the i386 and ARM cross builds and cannot see a difference which looks material to the problem. Any suggestions as to what else I can try or where else I can look for a solution are welcome! Thanks for all your advice so far, it's most appreciated. -b On Thu, May 23, 2013 at 11:34 PM, Bruce Tulloch wrote: > > Okay, I understand the reason for the two file locations, thanks. > > The problem occurs ONLY when cross-compiling to ARM. Native (and cross to > i386) is fine. > > The files I referred to are on the crossroot not the host despite > appearances; the crossroot is at /usr/local/opt/chroot/raspbian/rootfs but I > reported these files in my previous email from within a qemu enabled chroot > (so they looked like they were native). The machine name "beria" is the > chroot and "fermi" is the host. > > My apologies for the confusion. > > -b > > > On Thu, May 23, 2013 at 11:19 PM, Jonas Maebe > wrote: >> >> >> On 23 May 2013, at 15:03, Bruce Tulloch wrote: >> >>> On Thu, May 23, 2013 at 10:50 PM, Jonas Maebe >>> wrote: >>> >>>> >>>> On 23 May 2013, at 14:32, Bruce Tulloch wrote: >>>> >>>> On Thu, May 23, 2013 at 10:28 PM, Jonas Maebe >>>> >>>>> >>>>> **wrote: >>>>> >>>>> >>>>> >>>>>> On 23 May 2013, at 14:25, Bruce Tulloch wrote: >>>>>> >>>>>> Do you have a libdl.so in your library search path? And what kind of >>>>>> reference to libdl does link.res contain? >>>>>> >>>>>> Yes, it's in the search path as: >>>>> >>>>> >>>>> ls -l libdl* >>>>> -rw-r--r-- 1 root root 9812 Feb 23 00:37 libdl-2.13.so >>>>> lrwxrwxrwx 1 root root 13 Feb 23 00:37 libdl.so.2 -> libdl-2.13.so >>>>> >>>> >>>> You don't have libdl.so, only libdl.so.2. The latter is for use at run >>>> time, the former for use at link/compile time. Install the libc-dev or >>>> similar package in your crossroot to get it along with other missing >>>> symlinks. Do not start creating those manually, it will only lead to >>>> errors >>>> and confusion down the line. >>>> >>> Okay, but it is installed: >>> >>> apt-file search libdl.so >>> libc6: /lib/arm-linux-gnueabihf/libdl.so.2 >>> libc6-dev: /usr/lib/arm-linux-gnueabihf/libdl.so >> >> >> The topic of this thread is about cross-compiling, but those are the >> files on the native system. Are you getting this error while cross-compiling >> or while compiling natively? If you are compiling natively, try compiling >> something with "gcc -### x.c -ldl" to see what parameters gcc passes to >> linker (create an empty x.c file first). >> >> >>> apt-show-versions libc6-dev >>> libc6-dev/wheezy uptodate 2.13-38+rpi2 >>> >>> but I noticed that: >>> >>> ls -l libdl* >>> -rw-r--r-- 1 root root 9042 Feb 23 00:38 libdl.a >>> lrwxrwxrwx 1 root root 35 Feb 23 00:38 libdl.so -> >>> /lib/arm-linux-gnueabihf/libdl.so.2 >>> >>> which means they're the same file. >> >> >> Yes, they are the same file. Why that is the case and why nevertheless >> need both is what I tried to explain in my previous message. >> >> >> >> Jonas >> _______________________________________________ >> fpc-pascal maillist - >> http://lists.freepascal.org/mailman/listinfo/fpc-pascal > >

Reply by email

Jonas Maebe
to Bruce Tulloch
Bruce Tulloch wrote 16 lines
The key question for my ARM cross compile is why does it report: /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/cthreads.o: In function `CTHREADS_$$_LOADPTHREADS$$BOOLEAN': cthreads.pp: (.text.n_cthreads_$$_loadpthreads$$boolean+0xc): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking when linking. I've checked the linker script and arguments and nowhere am I (or FPC) asking for a static link, so why is this message reported? What else can cause ld to attempt a static link?

I don't know. Have you already tried with gcc?

Jonas

Reply by email

Bruce Tulloch
to Jonas Maebe

Not yet, but I will try this shortly -b

Jonas Maebe wrote 28 lines
On 24 May 2013, at 07:31, Bruce Tulloch wrote: > > The key question for my ARM cross compile is why does it report: > > /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/cthreads.o: In function > `CTHREADS_$$_LOADPTHREADS$$BOOLEAN': cthreads.pp: > (.text.n_cthreads_$$_loadpthreads$$boolean+0xc): warning: Using > 'dlopen' in statically linked applications requires at runtime the > shared > libraries from the glibc version used for linking > > when linking. I've checked the linker script and arguments and nowhere > am I (or FPC) asking for a static link, so why is this message > reported? > > What else can cause ld to attempt a static link? I don't know. Have you already tried with gcc? Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Bruce Tulloch
to Bruce Tulloch

So here's what gcc reports when run on the raspbian arm target I'm trying to cross compile for:

gcc -### test.c -ldl
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14+rpi1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release
--build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-14+rpi1)
COLLECT_GCC_OPTIONS='-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' /usr/lib/gcc/arm-linux-gnueabihf/4.6/cc1 -quiet -imultilib . -imultiarch arm-linux-gnueabihf test.c -quiet -dumpbase test.c "-march=armv6" "-mfloat-abi=hard" "-mfpu=vfp" -auxbase test -o /tmp/ccTepGGB.s
COLLECT_GCC_OPTIONS='-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' as "-march=armv6" "-mfloat-abi=hard" "-mfpu=vfp" "-meabi=5" -o /tmp/ccUcKZI2.o /tmp/ccTepGGB.s
COMPILER_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/ LIBRARY_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../:/lib/arm-linux-gnueabihf/:/lib/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/ COLLECT_GCC_OPTIONS='-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' /usr/lib/gcc/arm-linux-gnueabihf/4.6/collect2 "--sysroot=/" --build-id --no-add-needed --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X "--hash-style=both" -m armelf_linux_eabi /usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crt1.o /usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crti.o /usr/lib/gcc/arm-linux-gnueabihf/4.6/crtbegin.o
-L/usr/lib/gcc/arm-linux-gnueabihf/4.6
-L/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf -L/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../..
-L/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf /tmp/ccUcKZI2.o -ldl -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtend.o
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crtn.o

Reply by email

Bruce Tulloch
to Bruce Tulloch

So this problem is not related to cthreads per se.

I've changed the program to:

program test;
uses
  Interfaces;
begin
  writeln('DATE ',{$i %DATE%});
  writeln('FPCTARGET ',{$i %FPCTARGET%});
  writeln('FPCTARGETCPU ',{$i %FPCTARGETCPU%});
  writeln('FPCTARGETOS ',{$i %FPCTARGETOS%});
  writeln('FPCVERSION ',{$i %FPCVERSION%});
end.

and built it as:

fpc -Tlinux -Parm \
-Fu/home/bruce/lazarus/lcl/units/arm-linux/gtk2 \
-Fu/home/bruce/lazarus/lcl/units/arm-linux \
-Fu/home/bruce/lazarus/components/lazutils/lib/arm-linux \ -s test.pas

where relevant part of /etc/fpc.cfg is:

-Sgic
-viwn
-Xs
-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/* #IFDEF FPC_CROSSCOMPILING
-XP$FPCTARGET-
#IFDEF LINUX
#IFDEF CPUARMHF
-Xd
-k--sysroot=/usr/local/opt/chroot/raspbian/rootfs
-Fl/usr/local/opt/chroot/raspbian/rootfs/usr/lib/gcc/arm-linux-gnueabihf/4.6 -Fl/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf -Fl/usr/local/opt/chroot/raspbian/rootfs/usr/lib
-Fl/usr/local/opt/chroot/raspbian/rootfs/lib/arm-linux-gnueabihf -Fl/usr/local/opt/chroot/raspbian/rootfs/lib
-FD/usr/local/opt/binutils/bin
#ENDIF
#ENDIF
#ENDIF

this produces ppas.sh:

#!/bin/sh
DoExitAsm ()
{ echo "An error occurred while assembling $1"; exit 1; } DoExitLink ()
{ echo "An error occurred while linking $1"; exit 1; } echo Assembling test
/usr/local/opt/binutils/bin/arm-linux-as -mfloat-abi=hard -meabi=5 -march=armv7-a -mfpu=vfpv3-d16 -o test.o test.s
if [ $? != 0 ]; then DoExitAsm test; fi
rm test.s
echo Linking test
OFS=$IFS
IFS="
"
/usr/local/opt/binutils/bin/arm-linux-ld
--sysroot=/usr/local/opt/chroot/raspbian/rootfs
--dynamic-linker=/lib/ld-linux-armhf.so.3 -s -L. -o test link.res if [ $? != 0 ]; then DoExitLink test; fi
IFS=$OFS

This assembles but the link fails on missing library dependencies.

The original (unmodified) INPUT statement in link.res is:

INPUT(
-ldl
-lpthread
-lX11
-lgdk_pixbuf-2.0
-lgtk-x11-2.0
-lgdk-x11-2.0
-lgobject-2.0
-lglib-2.0
-lgthread-2.0
-lgmodule-2.0
-lpango-1.0
-lcairo
-latk-1.0
)

To which I have to manually add these libraries:

-lrt
-lgcc_s
-lpcre

to fix these dependency problems, but the link then produces:

$ ./ppas.sh
Assembling test
Linking test
/usr/local/opt/binutils/bin/arm-linux-ld: warning: link.res contains output sections; did you forget -T?
/usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/dynlibs.o: In function `DYNLIBS_$$_LOADLIBRARY$ANSISTRING$$LONGINT':
dynlibs.pas:(.text.n_dynlibs_$$_loadlibrary$ansistring$$longint+0x1c): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a(dlopen.o): In function `dlopen':
(.text+0xc): undefined reference to `__dlopen'
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a(dlclose.o): In function `dlclose':
(.text+0x0): undefined reference to `__dlclose'
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a(dlsym.o): In function `dlsym':
(.text+0xc): undefined reference to `__dlsym'
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a(dlerror.o): In function `dlerror':
(.text+0x0): undefined reference to `__dlerror'
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a(dladdr.o): In function `dladdr':
(.text+0x0): undefined reference to `__dladdr'
An error occurred while linking test

I cannot see any reason why arm-linux-ld is trying to link this statically on the basis of the arguments used in ppas.sh and the contents of the link.res based on the output of gcc in my previous email.

I've tried comparing the linker arguments used with those produced by gcc and there some differences at assembly time. Is this important?

Prima facie is looks like it might be.

For example gcc on the target says:

-march=armv6

but FPC directs the assembler to use:

-march=armv7-a

FYI, below is the full content of the (amended) link.res file...

SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/lib/") SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/lib/arm-linux-gnueabihf/") SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/usr/lib/") SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf/") SEARCH_DIR("/usr/local/opt/chroot/raspbian/rootfs/usr/lib/gcc/arm-linux-gnueabihf/4.6/") SEARCH_DIR("/home/bruce/lazarus/lcl/units/arm-linux/gtk2/") SEARCH_DIR("/home/bruce/lazarus/lcl/units/arm-linux/") SEARCH_DIR("/home/bruce/lazarus/components/lazutils/lib/arm-linux/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/httpd22/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/cdrom/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/jni/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/imagemagick/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-fpcunit/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/tcl/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-web/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/ldap/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/iconvenc/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/modplug/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/syslog/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/imlib/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fv/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/ggi/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/lua/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/opengl/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/pthreads/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-async/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-registry/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fftw/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/dbus/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-res/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/gtk2/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-js/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/mysql/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/utmp/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/svgalib/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-base/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/libgd/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fastcgi/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/symbolic/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/postgres/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/ibase/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/mad/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-xml/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/uuid/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/chm/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/ncurses/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/oggvorbis/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fpgtk/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-db/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/bzip2/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/opengles/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/numlib/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-process/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/cairo/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/bfd/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/x11/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/gtk1/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-net/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/dts/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/dblib/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/gdbint/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/proj4/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/libsee/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/libxml2/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/oracle/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-json/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/httpd24/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/openal/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/zlib/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/sqlite/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fpindexer/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/libtar/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/pcap/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/rsvg/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fppkg/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fpmkunit/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/ptc/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/unzip/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-passrc/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-extra/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-stl/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/xforms/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/sdl/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/hermes/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/openssl/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/odbc/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/pxlib/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/regexpr/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/users/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/aspell/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/zorba/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/gmp/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/newt/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/gnome1/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/hash/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-sdo/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/libcurl/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/libvlc/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/libpng/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/units/arm-linux/gdbm/") SEARCH_DIR("/usr/local/lib/fpc/2.7.1/")
INPUT(
/usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/cprt0.o /usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf/crti.o /usr/local/opt/chroot/raspbian/rootfs/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtbegin.o test.o
test.or
/usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/system.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/fpintres.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/interfaces.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/objpas.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/cwstring.o /home/bruce/lazarus/lcl/units/arm-linux/interfacebase.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/baseunix.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/ctypes.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/unix.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/unixtype.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/initc.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/dynlibs.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/unixcp.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/unixutil.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/dl.o
/usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/types.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/classes.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/sysutils.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/math.o /home/bruce/lazarus/lcl/units/arm-linux/lclstrconsts.o /home/bruce/lazarus/lcl/units/arm-linux/lcltype.o
/home/bruce/lazarus/lcl/units/arm-linux/lclproc.o
/home/bruce/lazarus/lcl/units/arm-linux/lmessages.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpimage.o /home/bruce/lazarus/lcl/units/arm-linux/graphtype.o /home/bruce/lazarus/lcl/units/arm-linux/graphmath.o /home/bruce/lazarus/lcl/units/arm-linux/intfgraphics.o /home/bruce/lazarus/lcl/units/arm-linux/themes.o
/usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/typinfo.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/rtlconsts.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/errors.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/sysconst.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazlogger.o /home/bruce/lazarus/lcl/units/arm-linux/fpcadds.o
/home/bruce/lazarus/components/lazutils/lib/arm-linux/avglvltree.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/fileutil.o /home/bruce/lazarus/lcl/units/arm-linux/wsreferences.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazmethodlist.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazutf8.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazloggerbase.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazclasses.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/masks.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazutilsstrconsts.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazfileutils.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-base/contnrs.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/strutils.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-base/gettext.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazutf8classes.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpreadbmp.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpwritebmp.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/bmpcomn.o /home/bruce/lazarus/lcl/units/arm-linux/lclversion.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpreadpng.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpwritepng.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpreadtiff.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpwritetiff.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fptiffcmn.o /home/bruce/lazarus/lcl/units/arm-linux/icnstypes.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpimgcmn.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/pngcomn.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/zstream.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/zbase.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/gzio.o /usr/local/lib/fpc/2.7.1/units/arm-linux/hash/crc.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/zdeflate.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/zinflate.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/trees.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/adler.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/infblock.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/infutil.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/infcodes.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/inftrees.o /usr/local/lib/fpc/2.7.1/units/arm-linux/paszlib/inffast.o /home/bruce/lazarus/lcl/units/arm-linux/graphics.o /home/bruce/lazarus/lcl/units/arm-linux/lclintf.o
/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpcanvas.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpreadpnm.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpwritepnm.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpreadjpeg.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpwritejpeg.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/fpreadgif.o /home/bruce/lazarus/lcl/units/arm-linux/lresources.o /home/bruce/lazarus/lcl/units/arm-linux/lclrescache.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-image/clipping.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jpeglib.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdapimin.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdatasrc.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdapistd.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jmorecfg.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdeferr.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jinclude.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jerror.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jmemmgr.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdmarker.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdinput.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcomapi.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jutils.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jmemnobs.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdmaster.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdcolor.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdsample.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdpostct.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jddctmgr.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdphuff.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdhuff.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdcoefct.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdmainct.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jquant1.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jquant2.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdmerge.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdct.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jidctfst.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jidctint.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jidctflt.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jidctred.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcapistd.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcapimin.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jdatadst.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcparam.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcinit.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcmarker.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcphuff.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jchuff.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcmaster.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jccolor.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcsample.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcprepct.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcdctmgr.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jccoefct.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jcmainct.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jfdctint.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jfdctfst.o /usr/local/lib/fpc/2.7.1/units/arm-linux/pasjpeg/jfdctflt.o /home/bruce/lazarus/lcl/units/arm-linux/dynqueue.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazconfigstorage.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-base/syncobjs.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/utf8process.o /home/bruce/lazarus/lcl/units/arm-linux/maps.o
/home/bruce/lazarus/components/lazutils/lib/arm-linux/lazutf8sysutils.o /home/bruce/lazarus/lcl/units/arm-linux/tmschema.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-process/process.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-process/pipes.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/termio.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2disableliboverlay.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2int.o /home/bruce/lazarus/lcl/units/arm-linux/forms.o
/usr/local/lib/fpc/2.7.1/units/arm-linux/x11/xlib.o /usr/local/lib/fpc/2.7.1/units/arm-linux/x11/x.o
/usr/local/lib/fpc/2.7.1/units/arm-linux/gtk2/gdk2x.o /home/bruce/lazarus/lcl/units/arm-linux/dialogs.o
/home/bruce/lazarus/lcl/units/arm-linux/controls.o /home/bruce/lazarus/lcl/units/arm-linux/dynhasharray.o /home/bruce/lazarus/lcl/units/arm-linux/menus.o
/home/bruce/lazarus/lcl/units/arm-linux/wslclclasses.o /home/bruce/lazarus/lcl/units/arm-linux/buttons.o
/home/bruce/lazarus/lcl/units/arm-linux/stdctrls.o /home/bruce/lazarus/lcl/units/arm-linux/checklst.o /home/bruce/lazarus/lcl/units/arm-linux/comctrls.o /home/bruce/lazarus/lcl/units/arm-linux/spin.o
/home/bruce/lazarus/lcl/units/arm-linux/extctrls.o /usr/local/lib/fpc/2.7.1/units/arm-linux/gtk2/gdk2pixbuf.o /usr/local/lib/fpc/2.7.1/units/arm-linux/gtk2/gtk2.o /usr/local/lib/fpc/2.7.1/units/arm-linux/gtk2/gdk2.o /usr/local/lib/fpc/2.7.1/units/arm-linux/gtk2/glib2.o /usr/local/lib/fpc/2.7.1/units/arm-linux/gtk2/pango.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2winapiwindow.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2globals.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2proc.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2def.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2fontcache.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2extra.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2msgqueue.o /usr/local/lib/fpc/2.7.1/units/arm-linux/x11/xrender.o /usr/local/lib/fpc/2.7.1/units/arm-linux/cairo/cairo.o /home/bruce/lazarus/lcl/units/arm-linux/buttonpanel.o /home/bruce/lazarus/lcl/units/arm-linux/lclclasses.o /home/bruce/lazarus/lcl/units/arm-linux/customtimer.o /home/bruce/lazarus/lcl/units/arm-linux/actnlist.o /home/bruce/lazarus/lcl/units/arm-linux/clipbrd.o
/usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-base/custapp.o /home/bruce/lazarus/lcl/units/arm-linux/helpintfs.o /home/bruce/lazarus/lcl/units/arm-linux/imglist.o
/home/bruce/lazarus/lcl/units/arm-linux/wsimglist.o /home/bruce/lazarus/lcl/units/arm-linux/wsproc.o
/home/bruce/lazarus/lcl/units/arm-linux/wsfactory.o /home/bruce/lazarus/lcl/units/arm-linux/propertystorage.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-base/rttiutils.o /home/bruce/lazarus/lcl/units/arm-linux/wsmenus.o
/home/bruce/lazarus/lcl/units/arm-linux/wscontrols.o /home/bruce/lazarus/lcl/units/arm-linux/wsforms.o
/home/bruce/lazarus/lcl/units/arm-linux/imagelistcache.o /home/bruce/lazarus/lcl/units/arm-linux/extendedstrings.o /home/bruce/lazarus/lcl/units/arm-linux/textstrings.o /home/bruce/lazarus/lcl/units/arm-linux/wsstdctrls.o /home/bruce/lazarus/lcl/units/arm-linux/wsbuttons.o /home/bruce/lazarus/lcl/units/arm-linux/popupnotifier.o /home/bruce/lazarus/lcl/units/arm-linux/wsextctrls.o /home/bruce/lazarus/lcl/units/arm-linux/wsdialogs.o /home/bruce/lazarus/lcl/units/arm-linux/wschecklst.o /home/bruce/lazarus/lcl/units/arm-linux/toolwin.o
/home/bruce/lazarus/lcl/units/arm-linux/wscomctrls.o /home/bruce/lazarus/lcl/units/arm-linux/wstoolwin.o /home/bruce/lazarus/lcl/units/arm-linux/wsspin.o
/usr/local/lib/fpc/2.7.1/units/arm-linux/gtk2/atk.o /usr/local/lib/fpc/2.7.1/units/arm-linux/gtk2/gtk2ext.o /home/bruce/lazarus/lcl/units/arm-linux/extdlgs.o
/home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2debug.o /home/bruce/lazarus/lcl/units/arm-linux/lclmessageglue.o /home/bruce/lazarus/lcl/units/arm-linux/calendar.o /home/bruce/lazarus/lcl/units/arm-linux/wscalendar.o /home/bruce/lazarus/lcl/units/arm-linux/wsextdlgs.o /home/bruce/lazarus/lcl/units/arm-linux/lclmemmanager.o /home/bruce/lazarus/lcl/units/arm-linux/messages.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsprivate.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-base/uriparser.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wscontrols.o /home/bruce/lazarus/lcl/units/arm-linux/lazlinkedlist.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsfactory.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsstdctrls.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wschecklst.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2themes.o /home/bruce/lazarus/lcl/units/arm-linux/grids.o
/home/bruce/lazarus/lcl/units/arm-linux/pairsplitter.o /home/bruce/lazarus/lcl/units/arm-linux/dynamicarray.o /home/bruce/lazarus/lcl/units/arm-linux/maskedit.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/laz2_xmlcfg.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazfilecache.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/laz2_dom.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/laz2_xmlread.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/laz2_xmlwrite.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/lazdbglog.o /usr/local/lib/fpc/2.7.1/units/arm-linux/fcl-base/avl_tree.o /home/bruce/lazarus/components/lazutils/lib/arm-linux/laz2_xmlutils.o /home/bruce/lazarus/lcl/units/arm-linux/wsgrids.o
/home/bruce/lazarus/lcl/units/arm-linux/wspairsplitter.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsbuttons.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wscalendar.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wscomctrls.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsdialogs.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsextctrls.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsextdlgs.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsforms.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsgrids.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsimglist.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsmenus.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wsspin.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2wspairsplitter.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2cellrenderer.o /home/bruce/lazarus/lcl/units/arm-linux/gtk2/gtk2listviewtreemodel.o )
INPUT(
-ldl
-lpthread
-lX11
-lgdk_pixbuf-2.0
-lgtk-x11-2.0
-lgdk-x11-2.0
-lgobject-2.0
-lglib-2.0
-lgthread-2.0
-lgmodule-2.0
-lpango-1.0
-lcairo
-latk-1.0
-lrt
-lgcc_s
-lpcre
)
GROUP(
-lc
)
INPUT(
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/gcc/arm-linux-gnueabihf/4.6/crtend.o /usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf/crtn.o )
ENTRY(_start)
SECTIONS
{

  PROVIDE (__executable_start = 0x010000); . = 0x010000 + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .hash           : { *(.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rel.dyn        :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
    }
  .rela.dyn       :
    {
      *(.rela.init)
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
      *(.rela.fini)
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
      *(.rela.got)
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
    }
  .rel.plt        : { *(.rel.plt) }
  .rela.plt       : { *(.rela.plt) }
  .init           :
  {
    KEEP (*(.init))
  } =0x90909090
  .plt            : { *(.plt) }
  .text           :
  {
    *(.text .stub .text.* .gnu.linkonce.t.*)
    KEEP (*(.text.*personality*))
    *(.gnu.warning)
  } =0x90909090
  .fini           :
  {
    KEEP (*(.fini))
  } =0x90909090
  PROVIDE (_etext = .);
  .rodata         :
  {
    *(.rodata .rodata.* .gnu.linkonce.r.*)
  }
  . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1));
  .dynamic        : { *(.dynamic) }
  .got            : { *(.got) }
  .got.plt        : { *(.got.plt) }
  .data           :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    KEEP (*(.fpc .fpc.n_version .fpc.n_links))
    KEEP (*(.gnu.linkonce.d.*personality*))
  }
  PROVIDE (_edata = .);
  PROVIDE (edata = .);
  .threadvar : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }
  __bss_start = .;
  .bss            :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   . = ALIGN(32 / 8);
  }
  . = ALIGN(32 / 8);
  PROVIDE (_end = .);
  PROVIDE (end = .);
  .stab          0 : { *(.stab) }
  .stabstr       0 : { *(.stabstr) }

}

Reply by email

Jonas Maebe
to Bruce Tulloch
Bruce Tulloch wrote
I cannot see any reason why arm-linux-ld is trying to link this statically on the basis of the arguments used in ppas.sh and the contents of the link.res based on the output of gcc in my previous email.

You can try passing --verbose to ld, maybe that will tell you something more.

Jonas

Reply by email

Bruce Tulloch
to Jonas Maebe

Thanks Jonas, I think I've nailed it with your help. The linker --verbose reports:

attempt to open
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.so failed
attempt to open
/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a succeeded
(/usr/local/opt/chroot/raspbian/rootfs/usr/lib/arm-linux-gnueabihf//libdl.a)dlopen.o /usr/local/lib/fpc/2.7.1/units/arm-linux/rtl/dynlibs.o: In function `DYNLIBS_$$_LOADLIBRARY$ANSISTRING$$LONGINT':
dynlibs.pas:(.text.n_dynlibs_$$_loadlibrary$ansistring$$longint+0x1c): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

That is, the attempt to open libdl.so failed so libdl.a was opened instead which is the immediate reason why the link tries to link statically; the linker did not find the .so!

The library libdl.so on the crossroot is in fact an absolute symlink:

libdl.so -> /lib/arm-linux-gnueabihf/libdl.so.2

so arm-linux-ld ends up looking for the target of symlink (/lib/arm-linux-gnueabihf/libdl.so.2) on the host and not on the crossroot. Hmm.

To solve this I've replaced the symlink with a linker script of the same name containing:

OUTPUT_FORMAT(elf32-littlearm)
GROUP ( /lib/arm-linux-gnueabihf/libdl.so.2
/usr/lib/arm-linux-gnueabihf/libdl.a AS_NEEDED (
/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 ) )

which seems to solve the problem; with a linker script the --sysroot prefix is applied correctly and the link completes successfully.

Thanks for all your pointers, I'm learning a lot about how ld actually works :-)

So this raises some questions perhaps you can answer or comment on for me:

1) it seems to me that the use of absolute symlinks to resolve library files (as opposed to relative links or linker scripts) is bad practice (at least insofar as one may want to use them for cross compilation) but it appears many libraries (as packaged for Debian at least) do this (use absolute links).

Is there a reason one might need to use absolute links? If so, is there a way (other than hacking the library files on the crossroot as I've done here) to make cross compiling work?

On the other hand, if there is no reason to use absolute symlinks then I'm thinking this may be worth me filing a bug report or two with Debian! It seems one Gentoo developer think so:

http://dev.gentoo.org/~zmedico/portage/doc/ch06s06.html

2) is there any reason linker scripts should be preferred to relative symlinks?

3) there remains one problem; dependencies on librt.so, libgcc_s.so and libpcre.so are not found by FPC (it does not put them in the link.res file). However, inspecting the crossroot I can see all these libraries are in fact absolute symlinks too so I'm guessing FPC cannot find them (when cross compiling) for the same reason; I will replace them with linker scripts too and try again.

Thanks for all your help and advice.

Bruce.

Reply by email