[fpc-pascal] Compiling a program for openwrt?

Luca Olivetti luca at ventoso.org
Wed Sep 19 10:33:45 CEST 2007


Hello,

I received a message from a user that's trying to use my program with 
openwrt.
I provide a binary for arm that I compiled natively on my lspro and he 
cannot run it. I suspect a library problem (the lspro has a full-fledged 
linux system, while openwrt seems to be using uClibc).
This is what he told me it happens when he tries to run the program:

# botphone --help
/usr/bin/botphone: 1: Syntax error: word unexpected (expecting ")")



# strace botphone
execve("/usr/bin/botphone", ["botphone"], [/* 9 vars */]) = -1 ENOEXEC 
(Exec format error)
write(2, "strace: exec: Exec format error\n", 32strace: exec: Exec 
format error
) = 32
exit(1)                                 = ?
Process 13404 detached



This is result of ldd on my lspro:

$ ldd botphone
         liblinphone.so.1 => /usr/local/lib/liblinphone.so.1 (0x4001e000)
         libusb-0.1.so.4 => /lib/libusb-0.1.so.4 (0x40060000)
         libdl.so.2 => /lib/libdl.so.2 (0x40070000)
         libc.so.6 => /lib/libc.so.6 (0x4007b000)
         libquickstream.so.0 => /usr/local/lib/libquickstream.so.0 
(0x4018f000)
         libosip2.so.3 => /usr/lib/libosip2.so.3 (0x4019a000)
         libpthread.so.0 => /lib/libpthread.so.0 (0x401be000)
         libosipparser2.so.3 => /usr/lib/libosipparser2.so.3 (0x40218000)
         libnsl.so.1 => /lib/libnsl.so.1 (0x40258000)
         librt.so.1 => /lib/librt.so.1 (0x40273000)
         /lib/ld-linux.so.2 (0x40000000)
         libmediastreamer.so.0 => /usr/local/lib/libmediastreamer.so.0 
(0x4028d000)
         libortp.so.5 => /usr/local/lib/libortp.so.5 (0x402af000)
         libspeex.so.1 => /usr/lib/libspeex.so.1 (0x402cc000)
         libm.so.6 => /lib/libm.so.6 (0x402f4000)


and this is the result under openwrt:

# ldd botphone
libm.so.0 => /lib/libm.so.0 (0x2aaee000)
libcrypt.so.0 => /lib/libcrypt.so.0 (0x2ab35000)
libc.so.0 => /lib/libc.so.0 (0x2ab89000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x2aaa8000)



Do you know of anything special I should do to compile the program to 
work under openwrt?

Bye
-- 
Luca



More information about the fpc-pascal mailing list