Hallo All, I have the problem that a bit more complex programs just crash with segfault. Simpler programs work. I had a lot of problems to get things done, and perhaps I did something wrong. So I describe my setup as detailed as possible:
I use the crosscompiler version 2.3.1 for windows from ftp://ftp.freepascal.org/pub/fpc/snapshot/v23/arm-linux/ I use Windows XP as compile host. with the standard setup I can compile simpler programs, and they run fine on the target ( Calao USB-A9263 http://www.calao-systems.com ) To get more complex things done I did the following: my fpc.cfg -Tlinux -FuC:\Programme\fpc4arm\units\arm-linux -FlC:\Programme\fpc4arm\libs\arm-linux -XParm-linux- -FDC:\Programme\fpc4arm -FDC:\Programme\fpc4arm\bin\arm-linux in C:\Programme\fpc4arm\libs\arm-linux I copied the libs from /lib of the target system. Heres the list of the libs ( don't be confused I use cygwin ) rwxr-xr-x 1 root Kein 18768 Aug 25 13:27 ld-uClibc-0.9.28.so rwxr-xr-x 1 root Kein 18768 Aug 25 15:02 ld-uClibc.so.0 rwxrwxrwx+ 2 root Kein 0 Aug 25 22:52 lib rwxr-xr-x 1 root Kein 321756 Aug 26 16:43 libc.so rwxr-xr-x 1 root Kein 321756 Aug 26 16:40 libc.so.0 rwxr-xr-x 1 root Kein 10612 Aug 25 22:51 libcrypt-0.9.28.so rwxr-xr-x 1 root Kein 6900 Aug 25 22:51 libdl-0.9.28.so rwxr-xr-x 1 root Kein 6900 Aug 25 22:51 libdl.so rwxr-xr-x 1 root Kein 53672 Aug 25 22:51 libm-0.9.28.so rwxr-xr-x 1 root Kein 256220 Aug 25 22:51 libncurses.so.5.5 rwxr-xr-x 1 root Kein 1172 Aug 25 22:51 libnsl-0.9.28.so rwxr-xr-x 1 root Kein 83058 Aug 25 22:51 libpthread-0.9.28.so rwxr-xr-x 1 root Kein 1176 Aug 25 22:51 libresolv-0.9.28.so rwxr-xr-x 1 root Kein 3048 Aug 25 22:51 librt-0.9.28.so rwxr-xr-x 1 root Kein 321756 Aug 25 22:51 libuClibc-0.9.28.so rwxr-xr-x 1 root Kein 3948 Aug 25 22:51 libutil-0.9.28.so rwxr-xr-x 1 root Kein 72020 Aug 25 22:51 libz.so.1.2.3 I copied libuClibc-0.9.28.so to libc.so Because the linker comlained about missing symbols I got deeper in and did: fetched uprt0.as from the compiler source package and assembled it on windows with arm-linux-as.exe. I named the resulting object file cprt21.o to satisfy the linker. Now I use the commandline: ppcarm -FL/lib/ld-uClibc.so.0 -Fl/lib/ thread.pas to compile the following program: {$mode objfpc} uses sysutils {$ifdef unix},cthreads{$endif} ; const threadcount = 100; stringlen = 10000; var finished : longint; threadvar thri : longint; function f(p : pointer) : longint; var s : ansistring; begin Writeln('thread ',longint(p),' started'); thri:=0; while (thri>0) do begin s:=s+'1'; inc(thri); end; Writeln('thread ',longint(p),' finished'); InterLockedIncrement(finished); f:=0; end; var i : longint; begin finished:=0; for i:=1 to threadcount do BeginThread(@f,pointer(i)); while (finished=0) do Writeln(finished); end. Now everything compiles and links fine, but the program crashes on the target platform with segmentation fault. even with strace I get: # /root/thread Segmentation fault # strace /root/thread execve("/root/thread", ["/root/thread"], [/* 16 vars */]) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Process 1403 detached Can anybody give me hints how to tackle down this problem ? Thanks a lot for your help regards Hartmut -- Hartmut Eilers <hart...@eilers.net> Dorffer Str. 53 http://www.eilers.net 52076 Aachen 01522/1656914 _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal