activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kururuKT <kt2...@gmail.com>
Subject Cross-compile Apache APR-util library for ARM-linux
Date Fri, 12 Oct 2012 20:35:58 GMT
first post~
I'm trying to port ActiveMQ-cpp client to an ARM platform
(Beaglebone/BeagleBoard) - since I'm doing my development on my PC, I'll
need to cross-compile the ActiveMQ-cpp library in order for it to run on the
ARM systems.
I follow through the steps in their  building instruction
<http://activemq.apache.org/cms/building.html>  , except I compile the APR
and the APR-util library using the following:
For APR:
./configure --prefix=/usr/arm-linux-gnueabi/apr --host=arm-linux-gnueabi
CC="arm-linux-gnueabi-gcc" CXX="arm-linux-gnueabi-g++"I run make install and
things are fine.
For APR-util:
./configure --prefix=/usr/arm-linux-gnueabi/apr-util
--host=arm-linux-gnueabi -with-apr=/usr/arm-linux-gnueabi/apr
CC="arm-linux-gnueabi-gcc" CXX="arm-linux-gnueabi-g++"I run make install and
got this:
/home/peter/apache/Apache_apr/apr-util-1.5.1/xml/expat/.libs/libexpat.so:
could not read symbols: File in wrong format
After some search, I 'think' the issue is with libexpat being the in the
wrong format (compiled for i386?)
My question is: How to I properly compile ActiveMQ-cpp library for a
ARM-platform? Is there some way I can fix the libexpat.so? or skip Apr-util?
or some option in the ./configure for Apr-util?
Follow-up:Here is the log file from running configure:
checking build system type... i686-pc-linux-gnuchecking host system type...
arm-unknown-linux-gnueabichecking target system type...
arm-unknown-linux-gnueabichecking for a BSD-compatible install...
/usr/bin/install -cchecking for working mkdir -p... yesAPR-util Version:
1.5.1checking for chosen layout... apr-utilchecking for
arm-linux-gnueabi-gcc... arm-linux-gnueabi-gccchecking whether the C
compiler works... yeschecking for C compiler default output file name...
a.outchecking for suffix of executables... checking whether we are cross
compiling... yeschecking for suffix of object files... ochecking whether we
are using the GNU C compiler... yeschecking whether arm-linux-gnueabi-gcc
accepts -g... yeschecking for arm-linux-gnueabi-gcc option to accept ISO
C89... none neededApplying apr-util hints file rules for
arm-unknown-linux-gnueabichecking for APR... yes  setting CPP to "gcc -E" 
adding "-pthread" to CFLAGS  setting CPPFLAGS to " -D_REENTRANT
-D_GNU_SOURCE -D_LARGEFILE64_SOURCE"checking how to run the C
preprocessor... gcc -Echecking for grep that handles long lines and -e...
/bin/grepchecking for egrep... /bin/grep -Echecking for ANSI C header
files... yeschecking for sys/types.h... yeschecking for sys/stat.h...
yeschecking for stdlib.h... yeschecking for string.h... yeschecking for
memory.h... yeschecking for strings.h... yeschecking for inttypes.h...
yeschecking for stdint.h... yeschecking for unistd.h... yeschecking for ldap
support...checking for default DBM... sdbm (default)checking for
pg_config... nochecking libpq-fe.h usability... nochecking libpq-fe.h
presence... nochecking for libpq-fe.h... nochecking postgresql/libpq-fe.h
usability... nochecking postgresql/libpq-fe.h presence... nochecking for
postgresql/libpq-fe.h... nochecking sqlite3.h usability... nochecking
sqlite3.h presence... nochecking for sqlite3.h... nochecking sqlite.h
usability... nochecking sqlite.h presence... nochecking for sqlite.h...
nochecking sybdb.h usability... nochecking sybdb.h presence... nochecking
for sybdb.h... nochecking freetds/sybdb.h usability... nochecking
freetds/sybdb.h presence... nochecking for freetds/sybdb.h... nochecking for
odbc_config... nochecking sql.h usability... nochecking sql.h presence...
nochecking for sql.h... nochecking odbc/sql.h usability... nochecking
odbc/sql.h presence... nochecking for odbc/sql.h... nochecking Expat
1.95.x... nochecking old Debian-packaged expat... nochecking old
FreeBSD-packaged expat... nochecking Expat 1.0/1.1... no  setting LDFLAGS to
"-L/usr/local/lib"  adding "-I/usr/local/include" to CPPFLAGSchecking Expat
1.95.x in /usr/local... no  nulling LDFLAGS  removed "-I/usr/local/include"
from CPPFLAGSconfiguring package in xml/expat nowchecking build system
type... i686-pc-linux-gnuchecking host system type...
arm-unknown-linux-gnueabichecking target system type...
arm-unknown-linux-gnueabichecking how to print strings... printfchecking for
arm-linux-gnueabi-gcc... arm-linux-gnueabi-gccchecking whether the C
compiler works... yeschecking for C compiler default output file name...
a.outchecking for suffix of executables... checking whether we are cross
compiling... yeschecking for suffix of object files... ochecking whether we
are using the GNU C compiler... yeschecking whether arm-linux-gnueabi-gcc
accepts -g... yeschecking for arm-linux-gnueabi-gcc option to accept ISO
C89... none neededchecking for a sed that does not truncate output...
/bin/sedchecking for grep that handles long lines and -e...
/bin/grepchecking for egrep... /bin/grep -Echecking for fgrep... /bin/grep
-Fchecking for ld used by arm-linux-gnueabi-gcc...
/usr/arm-linux-gnueabi/bin/ldchecking if the linker
(/usr/arm-linux-gnueabi/bin/ld) is GNU ld... yeschecking for BSD- or
MS-compatible name lister (nm)... /usr/bin/arm-linux-gnueabi-nm -Bchecking
the name lister (/usr/bin/arm-linux-gnueabi-nm -B) interface... BSD
nmchecking whether ln -s works... yeschecking the maximum length of command
line arguments... 1572864checking whether the shell understands some XSI
constructs... yeschecking whether the shell understands "+="... yeschecking
how to convert i686-pc-linux-gnu file names to arm-unknown-linux-gnueabi
format... func_convert_file_noopchecking how to convert i686-pc-linux-gnu
file names to toolchain format... func_convert_file_noopchecking for
/usr/arm-linux-gnueabi/bin/ld option to reload object files... -rchecking
for arm-linux-gnueabi-objdump... objdumpchecking how to recognize dependent
libraries... pass_allchecking for arm-linux-gnueabi-dlltool...
dlltoolchecking how to associate runtime and link libraries... printf
%s\nchecking for arm-linux-gnueabi-ar... arm-linux-gnueabi-archecking for
archiver @FILE support... @checking for arm-linux-gnueabi-strip...
arm-linux-gnueabi-stripchecking for arm-linux-gnueabi-ranlib...
arm-linux-gnueabi-ranlibchecking for gawk... nochecking for mawk...
mawkchecking command to parse /usr/bin/arm-linux-gnueabi-nm -B output from
arm-linux-gnueabi-gcc object... okchecking for sysroot... nochecking for
arm-linux-gnueabi-mt... nochecking for mt... mtconfigure: WARNING: using
cross tools not prefixed with host tripletchecking if mt is a manifest
tool... nochecking how to run the C preprocessor... arm-linux-gnueabi-gcc
-Echecking for ANSI C header files... yeschecking for sys/types.h...
yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for
string.h... yeschecking for memory.h... yeschecking for strings.h...
yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for
unistd.h... yeschecking for dlfcn.h... yeschecking for objdir...
.libschecking if arm-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions...
nochecking for arm-linux-gnueabi-gcc option to produce PIC... -fPIC
-DPICchecking if arm-linux-gnueabi-gcc PIC flag -fPIC -DPIC works...
yeschecking if arm-linux-gnueabi-gcc static flag -static works...
yeschecking if arm-linux-gnueabi-gcc supports -c -o file.o... yeschecking if
arm-linux-gnueabi-gcc supports -c -o file.o... (cached) yeschecking whether
the arm-linux-gnueabi-gcc linker (/usr/arm-linux-gnueabi/bin/ld) supports
shared libraries... yeschecking whether -lc should be explicitly linked
in... nochecking dynamic linker characteristics... GNU/Linux ld.sochecking
how to hardcode library paths into programs... immediatechecking whether
stripping libraries is possible... yeschecking if libtool supports shared
libraries... yeschecking whether to build shared libraries... yeschecking
whether to build static libraries... yeschecking for
arm-linux-gnueabi-gcc... (cached) arm-linux-gnueabi-gccchecking whether we
are using the GNU C compiler... (cached) yeschecking whether
arm-linux-gnueabi-gcc accepts -g... (cached) yeschecking for
arm-linux-gnueabi-gcc option to accept ISO C89... (cached) none
neededchecking for a BSD-compatible install... /usr/bin/install -cchecking
for ANSI C header files... (cached) yeschecking for an ANSI C-conforming
const... yeschecking for size_t... yeschecking for memmove... yeschecking
for bcopy... yeschecking check.h usability... nochecking check.h presence...
nochecking for check.h... noconfigure: creating
./config.statusconfig.status: creating Makefileconfig.status: creating
expat_config.hconfig.status: expat_config.h is unchangedconfig.status:
executing libtool commandsxml/expat configured properly  setting
APRUTIL_INCLUDES to
"-I/home/jacky/apache/Apache_apr/apr-util-1.5.1/xml/expat/lib"  setting
LDFLAGS to "-L/home/jacky/apache/Apache_apr/apr-util-1.5.1/xml/expat/lib" 
setting APRUTIL_EXPORT_LIBS to
"/home/jacky/apache/Apache_apr/apr-util-1.5.1/xml/expat/libexpat.la" 
setting APRUTIL_LIBS to
"/home/jacky/apache/Apache_apr/apr-util-1.5.1/xml/expat/libexpat.la"checking
iconv.h usability... yeschecking iconv.h presence... yeschecking for
iconv.h... yeschecking for type of inbuf parameter to iconv... char
**checking for iconv.h... (cached) yeschecking langinfo.h usability...
yeschecking langinfo.h presence... yeschecking for langinfo.h... yeschecking
for nl_langinfo... yeschecking for CODESET in langinfo.h... yeschecking
whether APR has DSO support... yeschecking for library containing crypt...
-lcryptchecking if system crypt() function is threadsafe... nochecking for
crypt_r... yeschecking style of crypt_r... struct_crypt_data  adding
"/usr/arm-linux-gnueabi/apr/lib/libapr-1.la" to APRUTIL_LIBS  adding
"-luuid" to APRUTIL_LIBS  adding "-lrt" to APRUTIL_LIBS  adding "-lcrypt" to
APRUTIL_LIBS  adding "-lpthread" to APRUTIL_LIBS  adding "-ldl" to
APRUTIL_LIBSconfigure: creating ./config.statusconfig.status: creating
Makefileconfig.status: creating export_vars.shconfig.status: creating
build/pkg/pkginfoconfig.status: creating apr-util.pcconfig.status: creating
apu-1-configconfig.status: creating
include/private/apu_select_dbm.hconfig.status: creating
include/apr_ldap.hconfig.status: creating include/apu.hconfig.status:
creating include/apu_want.hconfig.status: creating
test/Makefileconfig.status: creating
include/private/apu_config.hconfig.status: executing default commands
>From what I can see, xml/expat configured properly. I thought - maybe I need
to compile expat library in gcc-arm-linux? I went on, do that, and run the
configure again:
./configure --prefix=/usr/arm-linux-gnueabi/apr-util
--host=arm-linux-gnueabi -with-apr=/usr/arm-linux-gnueabi/apr
-with-expat=/usr/arm-linux-gnueabi/expat CC="arm-linux-gnueabi-gcc"
CXX="arm-linux-gnueabi-g++"
I got similar result in the log, except I now have Expat 1.95.x:
checking for odbc/sql.h... no  setting LDFLAGS to
"-L/usr/arm-linux-gnueabi/expat/lib"  adding
"-I/usr/arm-linux-gnueabi/expat/include" to CPPFLAGS  setting
APRUTIL_INCLUDES to "-I/usr/arm-linux-gnueabi/expat/include"  setting
APRUTIL_LDFLAGS to "-L/usr/arm-linux-gnueabi/expat/lib"checking Expat
1.95.x... yes  setting APRUTIL_EXPORT_LIBS to "-lexpat"  setting
APRUTIL_LIBS to "-lexpat"
run make, same error occurred.
I did a search on errors related to libexpat.so. I notice those who wants to
cross-compile usually see this "libexpat.so" error: with  centos 5.2 64bits
<http://www.directadmin.com/forum/showthread.php?t=27045&amp;page=1>  , with
or another case with Xeon 64bit.
Below is the command that actually cause the error:
make[1]: Entering directory
`/home/jacky/apache/Apache_apr/apr-util-1.5.1'/bin/bash
/usr/arm-linux-gnueabi/apr/build-1/libtool --silent --mode=link  gcc -g -O2
-pthread   -DHAVE_CONFIG_H -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE  
-I/home/jacky/apache/Apache_apr/apr-util-1.5.1/include
-I/home/jacky/apache/Apache_apr/apr-util-1.5.1/include/private 
-I/usr/arm-linux-gnueabi/apr/include/apr-1 
-I/usr/arm-linux-gnueabi/expat/include  -version-info 5:1:5    -o
libaprutil-1.la -rpath /usr/arm-linux-gnueabi/apr-util/lib
buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo
buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo
buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo
buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo
buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo
buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo
crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo
crypto/apr_passwd.lo crypto/apr_sha1.lo crypto/crypt_blowfish.lo
crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo
dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo
dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo
hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo
memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo
misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo
misc/apu_version.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo
xml/apr_xml.lo    -luuid -lrt -lcrypt  -lpthread -ldl
-L/usr/arm-linux-gnueabi/expat/lib -lexpat
/usr/arm-linux-gnueabi/apr/lib/libapr-1.la -luuid -lrt -lcrypt -lpthread
-ldl/usr/arm-linux-gnueabi/expat/lib/libexpat.so: could not read symbols:
File in wrong formatcollect2: ld returned 1 exit statusmake[1]: ***
[libaprutil-1.la] Error 1make[1]: Leaving directory
`/home/jacky/apache/Apache_apr/apr-util-1.5.1'make: *** [all-recursive]
Error 1
Many thanks to your help!




--
View this message in context: http://activemq.2283324.n4.nabble.com/Cross-compile-Apache-APR-util-library-for-ARM-linux-tp4657772.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message