Source : dbus-glib-0.82
cd dbus-glib-0.82
mkdir x86
cd x86
../configure
產生的Makefile會使用builddir這個變數但compile時卻沒有定義,因此用以下方式make
builddir=$PWD/dbus make
OK 成功
cd ..
CFLAGS=-I/home/gigijoe/OMAP3530/MSN/rootfs/include LDFLAGS=-L/home/gigijoe/OMAP3530/MSN/rootfs/lib USE_ARCH=32 NM=nm PKG_CONFIG_PATH=/home/gigijoe/OMAP3530/MSN/rootfs/lib/pkgconfig CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ AR=arm-none-linux-gnueabi-ar RANLIB=arm-none-linux-gnueabi-ranlib ./configure --host=arm-linux --target=arm-linux --prefix=/home/gigijoe/OMAP3530/MSN/rootfs --with-xml=expat --with-dbus-binding-tool=$PWD/x86/dbus/.libs/dbus-binding-tool --cache-file=arm.cache
...
checking for library containing socket... none required
checking whether socklen_t is defined... yes
checking abstract socket namespace... configure: error: cannot run test program while cross compiling
See `config.log' for more details.
錯誤發生了
強制將abstract socket namespace定義為yes並寫入cach file
echo ac_cv_have_abstract_sockets=yes > arm.cache
再試一次
OK ,成功
builddir=$PWD/dbus make
...
make[2]: Entering directory `/home/gigijoe/OMAP3530/MSN/dbus-glib-0.82/tools'
DBUS_TOP_BUILDDIR=.. /home/gigijoe/OMAP3530/MSN/rootfs/bin/dbus-daemon --introspect > dbus-bus-introspect.xml.tmp && mv dbus-bus-introspect.xml.tmp dbus-bus-introspect.xml
/home/gigijoe/OMAP3530/MSN/dbus-glib-0.82/x86/dbus/.libs/dbus-binding-tool --mode=glib-client --prefix=dbus_bus --output=dbus-glib-bindings.h dbus-bus-introspect.xml
/home/gigijoe/OMAP3530/MSN/dbus-glib-0.82/x86/dbus/.libs/dbus-binding-tool: symbol lookup error: /home/gigijoe/OMAP3530/MSN/dbus-glib-0.82/x86/dbus/.libs/dbus-binding-tool: undefined symbol: dbus_g_signature_get_g_type
make[2]: *** [dbus-glib-bindings.h] Error 127
make[2]: Leaving directory `/home/gigijoe/OMAP3530/MSN/dbus-glib-0.82/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/gigijoe/OMAP3530/MSN/dbus-glib-0.82'
make: *** [all] Error 2
不需要dbus tools for ARM,修改Makefile
#SUBDIRS = dbus tools test doc
SUBDIRS = dbus test doc
再make一次
OK,成功了
builddir=$PWD/dbus make install
2010年1月21日 星期四
2010年1月19日 星期二
Cross Compile Mozilla NSS for ARM
Source : nss-3.12.5-with-nspr-4.8.2
Path : /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2
1.Build for X86 first
make build_coreconf
cd ../../nsprpub
./configure --with-dist-prefix='/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/../../dist/Linux2.6_x86_glibc_PTH_DBG.OBJ' --with-dist-includedir='/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/../../dist/Linux2.6_x86_glibc_PTH_DBG.OBJ/include' --cache-file=/dev/null
make
cd ../security/nss/
make build_dbm
make
2.Build for ARM
Build arm
Modify ../coreconf/arch.mk
Set
OS_TEST := arm
Modify ../coreconf/Linux.mk
CC = arm-none-linux-gnueabi-gcc
CCC = arm-none-linux-gnueabi-g++
RANLIB = arm-none-linux-gnueabi-ranlib
cd ../../nsprpub
CC=arm-none-linux-gnueabi-gcc AR=arm-none-linux-gnueabi-ar RANLIB=arm-none-linux-gnueabi-ranlib ./configure --target=arm-linux --with-dist-prefix='/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ' --with-dist-includedir='/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/include' --cache-file=/dev/null
make
cd ../security/nss/
make build_dbm
make
Then there's error
make[3]: Leaving directory `/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/mangle'
cd Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ ; sh /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/./sign.sh /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ \
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ Linux \
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib/libsoftokn3.so
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/shlibsign -v -i /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib/libsoftokn3.so
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/shlibsign: 1: Syntax error: word unexpected (expecting ")")
make[2]: *** [../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib/libsoftokn3.chk] Error 2
make[2]: Leaving directory `/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign'
make[1]: *** [libs] Error 2
make[1]: Leaving directory `/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd'
make: *** [libs] Error 2
很明顯是無法執行shlibsign,把X86 build的binary拿來取代就行
cd cmd/shlibsign/
cp Linux2.6_x86_glibc_PTH_DBG.OBJ/shlibsign Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/
cd ../..
繼續
make
make[3]: Leaving directory `/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/mangle'
cd Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ ; sh /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/./sign.sh /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ \
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ Linux \
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib/libsoftokn3.so
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/shlibsign -v -i /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib/libsoftokn3.so
shlibsign: shlibsign.c:772: main: Assertion `lib != ((void *)0)' failed.
Aborted
應該也是相同的問題,換成X86 build的library
cd ../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib
cp -a ../../Linux2.6_x86_glibc_PTH_DBG.OBJ/lib/libsoftokn* .
cd ../../../security/nss/
make
完成囉
Path : /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2
1.Build for X86 first
make build_coreconf
cd ../../nsprpub
./configure --with-dist-prefix='/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/../../dist/Linux2.6_x86_glibc_PTH_DBG.OBJ' --with-dist-includedir='/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/../../dist/Linux2.6_x86_glibc_PTH_DBG.OBJ/include' --cache-file=/dev/null
make
cd ../security/nss/
make build_dbm
make
2.Build for ARM
Build arm
Modify ../coreconf/arch.mk
Set
OS_TEST := arm
Modify ../coreconf/Linux.mk
CC = arm-none-linux-gnueabi-gcc
CCC = arm-none-linux-gnueabi-g++
RANLIB = arm-none-linux-gnueabi-ranlib
cd ../../nsprpub
CC=arm-none-linux-gnueabi-gcc AR=arm-none-linux-gnueabi-ar RANLIB=arm-none-linux-gnueabi-ranlib ./configure --target=arm-linux --with-dist-prefix='/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ' --with-dist-includedir='/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/include' --cache-file=/dev/null
make
cd ../security/nss/
make build_dbm
make
Then there's error
make[3]: Leaving directory `/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/mangle'
cd Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ ; sh /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/./sign.sh /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ \
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ Linux \
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib/libsoftokn3.so
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/shlibsign -v -i /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib/libsoftokn3.so
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/shlibsign: 1: Syntax error: word unexpected (expecting ")")
make[2]: *** [../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib/libsoftokn3.chk] Error 2
make[2]: Leaving directory `/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign'
make[1]: *** [libs] Error 2
make[1]: Leaving directory `/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd'
make: *** [libs] Error 2
很明顯是無法執行shlibsign,把X86 build的binary拿來取代就行
cd cmd/shlibsign/
cp Linux2.6_x86_glibc_PTH_DBG.OBJ/shlibsign Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/
cd ../..
繼續
make
make[3]: Leaving directory `/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/mangle'
cd Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ ; sh /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/./sign.sh /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ \
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ Linux \
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib/libsoftokn3.so
/home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/shlibsign -v -i /home/gigijoe/OMAP3530/MSN/nss-3.12.5-with-nspr-4.8.2/mozilla/security/nss/cmd/shlibsign/../../../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib/libsoftokn3.so
shlibsign: shlibsign.c:772: main: Assertion `lib != ((void *)0)' failed.
Aborted
應該也是相同的問題,換成X86 build的library
cd ../../dist/Linux2.6_arm_arm-none-linux-gnueabi-gcc_glibc_PTH_DBG.OBJ/lib
cp -a ../../Linux2.6_x86_glibc_PTH_DBG.OBJ/lib/libsoftokn* .
cd ../../../security/nss/
make
完成囉
2010年1月12日 星期二
Dynamic Link Program Tips
1.Information of program
$ file pjsua-arm-unknown-linux-gnu
pjsua-arm-unknown-linux-gnu: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped
顯示program為dynamic link, 未最佳化
2.Strip
$ arm-none-linux-gnueabi-strip pjsua-arm-unknown-linux-gnu
pjsua-arm-unknown-linux-gnu: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), stripped
最佳化最明顯的效果是size變小
3.Shared Libraries
$ arm-none-linux-gnueabi-readelf -a pjsua-arm-unknown-linux-gnu | grep "Shared\ library"
0x00000001 (NEEDED) Shared library: [libm.so.6]
0x00000001 (NEEDED) Shared library: [libnsl.so.1]
0x00000001 (NEEDED) Shared library: [librt.so.1]
0x00000001 (NEEDED) Shared library: [libpthread.so.0]
0x00000001 (NEEDED) Shared library: [libc.so.6]
顯示必須的shared library
$ file pjsua-arm-unknown-linux-gnu
pjsua-arm-unknown-linux-gnu: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped
顯示program為dynamic link, 未最佳化
2.Strip
$ arm-none-linux-gnueabi-strip pjsua-arm-unknown-linux-gnu
pjsua-arm-unknown-linux-gnu: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), stripped
最佳化最明顯的效果是size變小
3.Shared Libraries
$ arm-none-linux-gnueabi-readelf -a pjsua-arm-unknown-linux-gnu | grep "Shared\ library"
0x00000001 (NEEDED) Shared library: [libm.so.6]
0x00000001 (NEEDED) Shared library: [libnsl.so.1]
0x00000001 (NEEDED) Shared library: [librt.so.1]
0x00000001 (NEEDED) Shared library: [libpthread.so.0]
0x00000001 (NEEDED) Shared library: [libc.so.6]
顯示必須的shared library
2010年1月6日 星期三
libtool: Version mismatch error
碰到一個關於libtool版本的問題,先記錄下來.
libtool: Version mismatch error. This is libtool 2.2.6, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6
libtool: and run autoconf again.
解決的方式是進入project 最上層目錄(也就是含有configure檔案的目錄)
autoreconf -f -l
./configure ...
libtool: Version mismatch error. This is libtool 2.2.6, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6
libtool: and run autoconf again.
解決的方式是進入project 最上層目錄(也就是含有configure檔案的目錄)
autoreconf -f -l
./configure ...
訂閱:
文章 (Atom)