[fpc-pascal] Re: Linking Problems while cross compiling for arm

Hartmut Eilers hartmut at eilers.net
Tue Dec 8 11:18:23 CET 2009


@Marco

I recompiled the crosscompiler with the OPT ... parameter
the result is the same, linker complains that he couldn't find
libdl

@Dariusz
I added lib to the Xr Param with no effort

ubuntu at kubuntu904:~/OpenLabTools/DeviceServer$ ls
/usr/local/xtools/arm-unknown-linux-uclibc/arm-unknown-linux-uclibc/bin
-la
insgesamt 7884
dr-xr-xr-x 2 ubuntu ubuntu    4096 2009-05-10 12:06 .
dr-xr-xr-x 6 ubuntu ubuntu    4096 2009-05-10 12:06 ..
-r-xr-xr-x 2 ubuntu ubuntu  703681 2009-05-10 11:48 ar
-r-xr-xr-x 2 ubuntu ubuntu 1167387 2009-05-10 11:48 as
-r-xr-xr-x 2 ubuntu ubuntu  260738 2009-05-10 12:06 c++
-r-xr-xr-x 2 ubuntu ubuntu  260738 2009-05-10 12:06 g++
-r-xr-xr-x 1 ubuntu ubuntu  256607 2009-05-10 12:06 gcc
-r-xr-xr-x 2 ubuntu ubuntu 1170229 2009-05-10 11:48 ld
-r-xr-xr-x 2 ubuntu ubuntu  685506 2009-05-10 11:48 nm
-r-xr-xr-x 2 ubuntu ubuntu  876640 2009-05-10 11:48 objcopy
-r-xr-xr-x 2 ubuntu ubuntu 1036007 2009-05-10 11:48 objdump
-r-xr-xr-x 2 ubuntu ubuntu  703712 2009-05-10 11:48 ranlib
-r-xr-xr-x 2 ubuntu ubuntu  876639 2009-05-10 11:48 strip


ubuntu at kubuntu904:~/OpenLabTools/DeviceServer$ ls
/usr/local/xtools/arm-unknown-linux-uclibc//bin -la
insgesamt 12188
dr-xr-xr-x 2 ubuntu ubuntu    4096 2009-05-10 12:13 .
dr-xr-xr-x 8 ubuntu ubuntu    4096 2009-05-10 12:13 ..
-r-xr-xr-x 1 ubuntu ubuntu  674923 2009-05-10 11:48
arm-unknown-linux-uclibc-addr2line
-r-xr-xr-x 2 ubuntu ubuntu  703681 2009-05-10 11:48 arm-unknown-linux-uclibc-ar
-r-xr-xr-x 2 ubuntu ubuntu 1167387 2009-05-10 11:48 arm-unknown-linux-uclibc-as
-r-xr-xr-x 2 ubuntu ubuntu  260738 2009-05-10 12:06 arm-unknown-linux-uclibc-c++
lrwxrwxrwx 1 ubuntu ubuntu      28 2009-05-10 12:06
arm-unknown-linux-uclibc-cc -> arm-unknown-linux-uclibc-gcc
-r-xr-xr-x 1 ubuntu ubuntu  674384 2009-05-10 11:48
arm-unknown-linux-uclibc-c++filt
-r-xr-xr-x 1 ubuntu ubuntu  256638 2009-05-10 12:06 arm-unknown-linux-uclibc-cpp
-r-xr-xr-x 1 ubuntu ubuntu    2190 2009-05-10 11:42
arm-unknown-linux-uclibc-ct-ng.config
-r-xr-xr-x 2 ubuntu ubuntu  260738 2009-05-10 12:06 arm-unknown-linux-uclibc-g++
-r-xr-xr-x 2 ubuntu ubuntu  256607 2009-05-10 12:06 arm-unknown-linux-uclibc-gcc
-r-xr-xr-x 2 ubuntu ubuntu  256607 2009-05-10 12:06
arm-unknown-linux-uclibc-gcc-4.3.2
-r-xr-xr-x 1 ubuntu ubuntu   16579 2009-05-10 12:06
arm-unknown-linux-uclibc-gccbug
-r-xr-xr-x 1 ubuntu ubuntu   38729 2009-05-10 12:06
arm-unknown-linux-uclibc-gcov
-r-xr-xr-x 1 ubuntu ubuntu  746363 2009-05-10 11:48
arm-unknown-linux-uclibc-gprof
-r-xr-xr-x 2 ubuntu ubuntu 1170229 2009-05-10 11:48 arm-unknown-linux-uclibc-ld
-r-xr-xr-x 1 ubuntu ubuntu    9868 2009-05-10 12:07 arm-unknown-linux-uclibc-ldd
-r-xr-xr-x 2 ubuntu ubuntu  685506 2009-05-10 11:48 arm-unknown-linux-uclibc-nm
-r-xr-xr-x 2 ubuntu ubuntu  876640 2009-05-10 11:48
arm-unknown-linux-uclibc-objcopy
-r-xr-xr-x 2 ubuntu ubuntu 1036007 2009-05-10 11:48
arm-unknown-linux-uclibc-objdump
-r-xr-xr-x 1 ubuntu ubuntu    6368 2009-05-10 12:13
arm-unknown-linux-uclibc-populate
-r-xr-xr-x 2 ubuntu ubuntu  703712 2009-05-10 11:48
arm-unknown-linux-uclibc-ranlib
-r-xr-xr-x 1 ubuntu ubuntu  315412 2009-05-10 11:48
arm-unknown-linux-uclibc-readelf
-r-xr-xr-x 1 ubuntu ubuntu  675670 2009-05-10 11:48
arm-unknown-linux-uclibc-size
-r-xr-xr-x 1 ubuntu ubuntu  674978 2009-05-10 11:48
arm-unknown-linux-uclibc-strings
-r-xr-xr-x 2 ubuntu ubuntu  876639 2009-05-10 11:48
arm-unknown-linux-uclibc-strip


ubuntu at kubuntu904:~/OpenLabTools/DeviceServer$ cat link.res
SEARCH_DIR(/home/ubuntu/OpenLabTools/webserver/)
SEARCH_DIR(/home/ubuntu/OpenLabTools/PhysMach/)
SEARCH_DIR(/home/ubuntu/OpenLabTools/divLibs/pwu-1.6.0.2-src/main/)
SEARCH_DIR(/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/)
SEARCH_DIR(/usr/local/lib/fpc/2.4.0/)
INPUT(
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/ucprt0.o
DeviceServer.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/system.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/lineinfo.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/exeinfo.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/strings.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/objpas.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/cthreads.o
/home/ubuntu/OpenLabTools/PhysMach/PhysMach.o
/home/ubuntu/OpenLabTools/webserver/webserver.o
telnetserver.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/classes.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/crt.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/baseunix.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/unix.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/unixtype.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/initc.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/dl.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/unixutil.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/syscall.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/ctypes.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/linux.o
/home/ubuntu/OpenLabTools/PhysMach/dil_io_access.o
/home/ubuntu/OpenLabTools/PhysMach/lp_io_access.o
/home/ubuntu/OpenLabTools/PhysMach/pio_io_access.o
/home/ubuntu/OpenLabTools/PhysMach/joy_io_access.o
/home/ubuntu/OpenLabTools/PhysMach/rnd_io_access.o
/home/ubuntu/OpenLabTools/PhysMach/http_io_access.o
/home/ubuntu/OpenLabTools/PhysMach/funk_io_access.o
/home/ubuntu/OpenLabTools/PhysMach/exec_io_access.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/sysutils.o
/home/ubuntu/OpenLabTools/PhysMach/CommonHelper.o
/home/ubuntu/OpenLabTools/divLibs/pwu-1.6.0.2-src/main/http.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/errors.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/sysconst.o
/home/ubuntu/OpenLabTools/divLibs/pwu-1.6.0.2-src/main/hostname.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/sockets.o
/home/ubuntu/OpenLabTools/divLibs/pwu-1.6.0.2-src/main/substrings.o
/home/ubuntu/OpenLabTools/divLibs/pwu-1.6.0.2-src/main/pwutypes.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/termio.o
/home/ubuntu/OpenLabTools/webserver/inetaux.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/dos.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/types.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/typinfo.o
/usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/rtlconsts.o
)
INPUT(
-ldl
)
GROUP(
-lc
)
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) }
}


I'm trying hard for 5 days now and I'm really frustrated, can anybody
give me advice which toolchain may work or how my error can be resolved?

The toolchain I use is from free electron an embedded company which
uses this toolchain to build kernels for the USB9263. From my point of
view it must be possible to link against this toolchain.

Thank you for your help
regards
Hartmut



More information about the fpc-pascal mailing list