Page 1 of 1

cross complier with mips

Posted: Thu Jul 07, 2011 4:03 pm
by yukoj2004
HI all
i want porting to embbeded mips board how to fix link error
i sucess cross complier openssl ,libevent,zlib,libcurl
but have link error
how solve the question

Code: Select all

extras make[1]: Entering directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/extras' make[1]: Nothing to be done for all'. make[1]: Leaving directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/extras' Making all in third-party make[1]: Entering directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party' Making all in dht make[2]: Entering directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party/dht' make[2]: Nothing to be done for all'. make[2]: Leaving directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party/dht' Making all in libnatpmp make[2]: Entering directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party/libnatpmp' make[2]: Nothing to be done for all'. make[2]: Leaving directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party/libnatpmp' Making all in miniupnp make[2]: Entering directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party/miniupnp' make all-am make[3]: Entering directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party/miniupnp' make[3]: Nothing to be done for all-am'. make[3]: Leaving directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party/miniupnp' make[2]: Leaving directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party/miniupnp' Making all in libutp make[2]: Entering directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party/libutp' make[2]: Nothing to be done for all'. make[2]: Leaving directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party/libutp' make[2]: Entering directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party' make[2]: Nothing to be done for all-am'. make[2]: Leaving directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party' make[1]: Leaving directory /home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/third-party' Making all in libtransmission make[1]: Entering directory `/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/libtransmission' 

[color=#FF0000]CCLD blocklist-test 

[color=#FF0000]/home/KKK/MIPS_1.7_SDK/tools-gcc-4.1/bin/../lib/gcc/mips64-linux-gnu/4.1.2/../../../../mips64-linux-[color=#FF0000]gnu/bin/ld: cannot find -lopenssl collect2: ld returned 1 exit status make[1]: * [blocklist-test] Error 1 make[color=#FF0000][1]: Leaving directory `/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-[color=#FF0000]2.32/libtransmission' [/color]
MY build script

Code: Select all

exportOPENSSL_CFLAGS="-I/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/openssl-1.0.0d/include" 
export LIBCURL_CFLAGS="-I/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/curl-7.21.7/include" 
export CC="mips64-linux-gnu-gcc" export CXX="mips64-linux-gnu-g++" 
export LIBCURL_LIBS="-L/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/curl-7.21.7/lib/.libs -lcurl" 
export OPENSSL_LIBS="-L/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/openssl-1.0.0d/build/usr/local/ssl/lib -lopenssl" 
export LIBEVENT_CFLAGS="-I/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/libevent-2.0.12-stable/include" 
export LIBEVENT_LIBS="-L/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/ibevent-2.0.12-stable/build/lib -levent" export ZLIB_LIBS="-L/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/zlib-1.2.5/build/lib/" 
export ZLIB_CFLAGS="-I/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/zlib-1.2.5/build/include" 
export LIBS="-L/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/zlib-1.2.5/build/lib/" 
export CFLAGS="-I/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/zlib-1.2.5/build/include" 
./configure --build=mips64-linux-gnu --target=mips64 \ 
--program-prefix=/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/transmission-2.32/build/ \ 
export LD_LIBRARY_PATH="/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/libevent-2.0.12-stable/build/lib -levent":"/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/curl-7.21.7/lib/.libs -lcurl":"/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/openssl-1.0.0d/build/usr/local/ssl/lib -lopenssl" 

Re: cross complier with mips

Posted: Sun Jul 10, 2011 5:49 pm
by Jordan
Two possibilities:

1. You might want to link against -lssl rather than -lopenssl

2. It looks like there's a missing space before OPENSSL_CFLAGS in line 1 of the build script.

Re: cross complier with mips

Posted: Thu Jul 14, 2011 3:23 am
by yukoj2004
hi Jordan
thank your help :)
my plan is design BT download machine
but i have some question

1.how to change lib search path(RPATH) in my embedded board
how make a static link transmission file and how to reduce image size
i just try --enable-static=yes and --enable-shared=no
[root@localhost bin]# mips64-linux-gnu-readelf -d transmission-daemon

Dynamic section at offset 0x1e80 contains 32 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [librt.so.1]
0x0000000000000001 (NEEDED) Shared library: [libevent-2.0.so.5]
0x0000000000000001 (NEEDED) Shared library: [libcurl.so.4]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libz.so.1]
0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000f (RPATH) Library rpath: [/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/libevent-2.0.12-stable/build/lib
:/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/bt/curl-7.21.7/build/lib]
0x000000000000000c (INIT) 0x120013b68
0x000000000000000d (FINI) 0x1200eacd0
0x0000000000000004 (HASH) 0x1200020d0

2. how change web path
it find /home/KKK/MIPS_1.7_SDK/........

dht.transmissionbt.com:6881: Temporary failure in name resolution (tr-dht.c:125
)
Jan 1 00:14:54 (none) daemon.err transmission-daemon[834]: DHT dht.transmission
bt.com:6881: Temporary failure in name resolution (tr-dht.c:125)
Jan 1 00:15:00 (none) daemon.info transmission-daemon[834]: Searching for web i
nterface file "//.local/share/transmission/web/index.html" (platform.c:540)
Jan 1 00:15:00 (none) daemon.info transmission-daemon[834]: Searching for web i
nterface file "/home/KKK/MIPS_1.7_SDK/linux/embedded_rootfs/
bt/transmission-2.32/build/share/transmission/web/index.html" (platform.c:540)
Jan 1 00:15:00 (none) daemon.info transmission-daemon[834]: Searching for web i
nterface file "/usr/local/share/transmission/web/index.html" (platform.c:540)
Jan 1 00:15:00 (none) daemon.info transmission-daemon[834]: Searching for web i
nterface file "/usr/share/transmission/web/index.html" (platform.c:540)
Jan 1 00:15:22 (none) daemon.err transmission-daemon[834]: DHT dht.transmission
bt.com:6881: Temporary failure in name resolution (tr-dht.c:125)

3.transmission file
i need copy all to my embedded board?

[root@localhost bin]# ls -al
total 50032
drwxr-xr-x 2 root root 4096 Jul 13 16:41 .
drwxr-xr-x 4 root root 4096 Jul 13 16:41 ..
-rwxr-xr-x 1 root root 8434480 Jul 13 16:41 transmission-cli
-rwxr-xr-x 1 root root 8676174 Jul 13 16:41 transmission-create
-rwxr-xr-x 1 root root 8539986 Jul 13 16:41 transmission-daemon
-rwxr-xr-x 1 root root 8448613 Jul 13 16:41 transmission-edit
-rwxr-xr-x 1 root root 8557189 Jul 13 16:41 transmission-remote
-rwxr-xr-x 1 root root 8461308 Jul 13 16:41 transmission-show