Sign in Join

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

Mailing lists / fpc-pascal / 2008-01

arm-linux, program does not start when using unit pthreads

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Bernd Mueller

Hello,

when I try to start a simple "Hello"-Program, which uses the unit pthreads, on an arm-linux target (uClibc), I get the message "not found". The program is crosscompiled from win32, using the fpc 2.2.0 compiler:

program project1;
{$mode objfpc}{$H+}
uses pthreads;
begin
    Writeln('Hello');
end.

There seems to be a problem with the shared libraries. I checked the directory /lib for the libraries and symlinks, but the required libraries seem to be present.

ldd project1
checking sub-depends for '/lib/libpthread.so.0'
checking sub-depends for '/lib/libc.so.0'
libpthread.so.0 => /lib/libpthread.so.0 (0x00000000) libc.so.0 => /lib/libc.so.0 (0x00000000)
/lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)

Then I compiled a gcc "Hello"-program with the library pthread linked in. This program runs fine. This is the ldd output:

ldd p
libpthread.so.0 => /lib/libpthread.so.0 (0x4000e000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40028000)
libc.so.0 => /lib/libc.so.0 (0x40038000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x40000000)

I am also wondering about the differences in the address fields of the ldd ouput. All fpc address fields are set to 0x00000000, while the gcc address fields have different values.

Thank you for any hints and pointers.

Regards, Bernd.

Reply by email

Bernd Mueller
to Bernd Mueller
Bernd Mueller wrote 16 lines
when I try to start a simple "Hello"-Program, which uses the unit pthreads, on an arm-linux target (uClibc), I get the message "not found". The program is crosscompiled from win32, using the fpc 2.2.0 compiler: program project1; {$mode objfpc}{$H+} uses pthreads; begin Writeln('Hello'); end. There seems to be a problem with the shared libraries. I checked the directory /lib for the libraries and symlinks, but the required libraries seem to be present.

the reason for the "not found" message was, that the dynamic linker on my target was not found. I fixed that, but I get now an Segmentation fault :-( I fear this one will be hard to find. Thanks.

Regards, Bernd.

Reply by email

Koenraad Lelong
to Bernd Mueller
Bernd Mueller wrote 24 lines
Bernd Mueller wrote: > when I try to start a simple "Hello"-Program, which uses the unit > pthreads, on an arm-linux target (uClibc), I get the message "not > found". The program is crosscompiled from win32, using the fpc 2.2.0 > compiler: > program project1; > {$mode objfpc}{$H+} > uses pthreads; > > begin > Writeln('Hello'); > end. > > There seems to be a problem with the shared libraries. I checked the > directory /lib for the libraries and symlinks, but the required > libraries seem to be present. the reason for the "not found" message was, that the dynamic linker on my target was not found. I fixed that, but I get now an Segmentation fault :-( I fear this one will be hard to find. Thanks. Regards, Bernd.

I tried on my arm-linux board, AFAIK NOT uClibc. It works fine. Regards,
Koenraad.

Reply by email

Koenraad Lelong
to Bernd Mueller
Bernd Mueller wrote 8 lines
Koenraad Lelong wrote: > > I tried on my arm-linux board, AFAIK NOT uClibc. It works fine. Thanks. Are you crosscompiling? Do you use static or dynamic linking? Regards, Bernd.

When I read you reply about linking I realised I didn't think about the fact that the linker would remove unused units (does it, without adding smartlining ?). Sorry about this.
I crosscompiled the program with dynamic linking, at least I didn't add a switch for static linking. Maybe you can send me you command-line. Regards,
Koenraad.

Reply by email

Bernd Mueller
to Koenraad Lelong
Koenraad Lelong wrote 13 lines
Bernd Mueller schreef: > Koenraad Lelong wrote: >> I tried on my arm-linux board, AFAIK NOT uClibc. It works fine. > Thanks. > Are you crosscompiling? Do you use static or dynamic linking? > > Regards, Bernd. > When I read you reply about linking I realised I didn't think about the fact that the linker would remove unused units (does it, without adding smartlining ?). Sorry about this. I crosscompiled the program with dynamic linking, at least I didn't add a switch for static linking. Maybe you can send me you command-line.

Dynamic linking seems to work for me now too. It was mainly a linker issue. Thanks.

Regards, Bernd.

Reply by email