2

初投稿〜

ActiveMQ-cpp クライアントを ARM プラットフォーム (Beaglebone/BeagleBoard) に移植しようとしています。PC で開発を行っているため、実行するには ActiveMQ-cpp ライブラリをクロスコンパイルする必要があります。 ARM システム上。

以下を使用して APR と APR-util ライブラリをコンパイルすることを除いて、ビルド手順の手順に従います。

4 月の場合:

./configure --prefix=/usr/arm-linux-gnueabi/apr --host=arm-linux-gnueabi CC="arm-linux-gnueabi-gcc" CXX="arm-linux-gnueabi-g++" 実行しますインストールを行い、問題ありません。

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++" make install を実行すると、次のようになりました。

/home/peter/apache/Apache_apr/apr-util-1.5.1/xml/expat/.libs/libexpat.so: could not read symbols: File in wrong format

いくつかの検索の後、問題はlibexpatが間違った形式であることにあると「思います」(i386用にコンパイルされていますか?)

私の質問は: ARM プラットフォーム用に ActiveMQ-cpp ライブラリを適切にコンパイルするにはどうすればよいですか? libexpat.so を修正する方法はありますか? またはApr-utilをスキップしますか?または Apr-util の ./configure のオプションですか?

フォローアップ: configure を実行したときのログ ファイルは次のとおりです。

checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabi
checking target system type... arm-unknown-linux-gnueabi
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.5.1
checking for chosen layout... apr-util
checking for arm-linux-gnueabi-gcc... arm-linux-gnueabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gnueabi-gcc accepts -g... yes
checking for arm-linux-gnueabi-gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for arm-unknown-linux-gnueabi
checking 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 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for ldap support...
checking for default DBM... sdbm (default)
checking for pg_config... no
checking libpq-fe.h usability... no
checking libpq-fe.h presence... no
checking for libpq-fe.h... no
checking postgresql/libpq-fe.h usability... no
checking postgresql/libpq-fe.h presence... no
checking for postgresql/libpq-fe.h... no
checking sqlite3.h usability... no
checking sqlite3.h presence... no
checking for sqlite3.h... no
checking sqlite.h usability... no
checking sqlite.h presence... no
checking for sqlite.h... no
checking sybdb.h usability... no
checking sybdb.h presence... no
checking for sybdb.h... no
checking freetds/sybdb.h usability... no
checking freetds/sybdb.h presence... no
checking for freetds/sybdb.h... no
checking for odbc_config... no
checking sql.h usability... no
checking sql.h presence... no
checking for sql.h... no
checking odbc/sql.h usability... no
checking odbc/sql.h presence... no
checking for odbc/sql.h... no
checking Expat 1.95.x... no
checking old Debian-packaged expat... no
checking old FreeBSD-packaged expat... no
checking Expat 1.0/1.1... no
  setting LDFLAGS to "-L/usr/local/lib"
  adding "-I/usr/local/include" to CPPFLAGS
checking Expat 1.95.x in /usr/local... no
  nulling LDFLAGS
  removed "-I/usr/local/include" from CPPFLAGS
configuring package in xml/expat now
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabi
checking target system type... arm-unknown-linux-gnueabi
checking how to print strings... printf
checking for arm-linux-gnueabi-gcc... arm-linux-gnueabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gnueabi-gcc accepts -g... yes
checking for arm-linux-gnueabi-gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by arm-linux-gnueabi-gcc... /usr/arm-linux-gnueabi/bin/ld
checking if the linker (/usr/arm-linux-gnueabi/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/arm-linux-gnueabi-nm -B
checking the name lister (/usr/bin/arm-linux-gnueabi-nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to arm-unknown-linux-gnueabi format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/arm-linux-gnueabi/bin/ld option to reload object files... -r
checking for arm-linux-gnueabi-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-gnueabi-dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-gnueabi-ar... arm-linux-gnueabi-ar
checking for archiver @FILE support... @
checking for arm-linux-gnueabi-strip... arm-linux-gnueabi-strip
checking for arm-linux-gnueabi-ranlib... arm-linux-gnueabi-ranlib
checking for gawk... no
checking for mawk... mawk
checking command to parse /usr/bin/arm-linux-gnueabi-nm -B output from arm-linux-gnueabi-gcc object... ok
checking for sysroot... no
checking for arm-linux-gnueabi-mt... no
checking for mt... mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool... no
checking how to run the C preprocessor... arm-linux-gnueabi-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC
checking if arm-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes
checking if arm-linux-gnueabi-gcc static flag -static works... yes
checking if arm-linux-gnueabi-gcc supports -c -o file.o... yes
checking if arm-linux-gnueabi-gcc supports -c -o file.o... (cached) yes
checking whether the arm-linux-gnueabi-gcc linker (/usr/arm-linux-gnueabi/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for arm-linux-gnueabi-gcc... (cached) arm-linux-gnueabi-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether arm-linux-gnueabi-gcc accepts -g... (cached) yes
checking for arm-linux-gnueabi-gcc option to accept ISO C89... (cached) none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking for ANSI C header files... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for memmove... yes
checking for bcopy... yes
checking check.h usability... no
checking check.h presence... no
checking for check.h... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating expat_config.h
config.status: expat_config.h is unchanged
config.status: executing libtool commands
xml/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... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for type of inbuf parameter to iconv... char **
checking for iconv.h... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for nl_langinfo... yes
checking for CODESET in langinfo.h... yes
checking whether APR has DSO support... yes
checking for library containing crypt... -lcrypt
checking if system crypt() function is threadsafe... no
checking for crypt_r... yes
checking 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_LIBS
configure: creating ./config.status
config.status: creating Makefile
config.status: creating export_vars.sh
config.status: creating build/pkg/pkginfo
config.status: creating apr-util.pc
config.status: creating apu-1-config
config.status: creating include/private/apu_select_dbm.h
config.status: creating include/apr_ldap.h
config.status: creating include/apu.h
config.status: creating include/apu_want.h
config.status: creating test/Makefile
config.status: creating include/private/apu_config.h
config.status: executing default commands

私が見る限り、xml/expat は適切に構成されています。私は考えました-gcc-arm-linuxでexpatライブラリをコンパイルする必要があるのではないでしょうか? 私は続けて、それを行い、構成を再度実行しました。

./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++"

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"

make を実行すると、同じエラーが発生しました。

libexpat.so に関連するエラーを検索しました。クロスコンパイルしたい人は通常、この「libexpat.so」エラーを見ることに気付きました: with centos 5.2 64bits , with or another case with Xeon 64bit.

以下は、実際にエラーを引き起こすコマンドです。

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 format
collect2: ld returned 1 exit status
make[1]: *** [libaprutil-1.la] Error 1
make[1]: Leaving directory `/home/jacky/apache/Apache_apr/apr-util-1.5.1'
make: *** [all-recursive] Error 1

あなたの助けに感謝します!

4

1 に答える 1

0

以前に別の形式でビルドされたライブラリがあるようです。エラーが発生しているため、次のエラーが発生します: File in wrong format collect2: ld returned 1 exit status Run file command over /usr/arm-linux-gnueabi/expat/lib/libexpat.so いくつかの異なる形式が表示される場合は、必要ですそれを再構築します。しかし、ビルド前のアームライブラリであり、正しい形式である必要があるため、奇妙です。

于 2015-02-20T05:47:05.067 に答える