Probleme beim Cross-Compile
-
Moin Leute,
ich habe ein Problem beim Cross-Compile und hoffe mal daß mir hier jemand weiterhelfen kann oder mich zumindest wieder aufs richtige Pferd setzen kann...
Ich versuche unter Ubuntu die libxml2 für eine ARM-Architektur zu kompilieren. Das Kompilieren klappt auch, aber sobald ich die die Bibliothek in mein Projekt einbinde und versuche darauf zuzugreifen erhalte ich diverse "undefined reference" Fehlermeldungen. Die Bibliothek ist korrekt eingebunden (ich kann im Visual Studio mit "Go to Definition" zu den entsprechenden Funktionen springen), daher vermute ich mal daß ich beim Cross-Compile irgendwas an den Parametern falsch eingestellt habe - oder was anderes grundlegendes übersehen habe.
Das configure-Skript habe ich mit den folgenden Parametern aufgerufen:
--build=i686-pc-linux --host=arm-none-linux --target=host=arm-none-linux CC=arm-none-linux-gnueabi-gcc CFLAGS=-fPIC
(Ja, ich weiß - die Target-Angabe ist nicht zwingend notwendig, aber wenn ich die weglasse ändert das nichts am Ergebnis)
-
Ist die Bibliothek denn auch für ARM compiliert worden?
-
Davon bin ich aufgrund der angegebenen Parameter ausgegangen und in den Ausgaben von configure habe ich nichts Gegenteiliges gefunden (es wird zumindest angegeben, daß ein cross-compile durchgeführt wird). Wie kann ich das denn überprüfen, ob explizit für ARM kompiliert wurde?
-
Hellcat schrieb:
Davon bin ich aufgrund der angegebenen Parameter ausgegangen und in den Ausgaben von configure habe ich nichts Gegenteiliges gefunden (es wird zumindest angegeben, daß ein cross-compile durchgeführt wird). Wie kann ich das denn überprüfen, ob explizit für ARM kompiliert wurde?
Die einfachste Möglichkeit wäre wohl ein
file Bibliotheksdatei
. Aber wenn die Bibliothek ohnehin vom make mit erstellt wird, sollte das nicht das Problem sein. Ich hatte gedacht, dass die Bibliothek eventuell schon vorher compiliert wurde.
-
Nein, die Bibliotheksdatei wird vom make erstellt.
Ich poste hier noch mal die Ausgaben von configure, ich hoffe das wird nicht zu viel...
checking build system type... i686-pc-linux-gnu checking host system type... arm-none-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-none-linux-strip... no checking for strip... strip checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for arm-none-linux-gcc... arm-none-linux-gnueabi-gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... yes checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether arm-none-linux-gnueabi-gcc accepts -g... yes checking for arm-none-linux-gnueabi-gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of arm-none-linux-gnueabi-gcc... gcc3 checking for a BSD-compatible install... /usr/bin/install -c checking how to run the C preprocessor... arm-none-linux-gnueabi-gcc -E checking for rm... /bin/rm checking for mv... /bin/mv checking for tar... /bin/tar checking for perl... /usr/bin/perl checking for wget... /usr/bin/wget checking for xmllint... /usr/bin/xmllint checking for xsltproc... /usr/bin/xsltproc checking for function prototypes... yes 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 string.h... (cached) yes checking for a sed that does not truncate output... /bin/sed checking for fgrep... /bin/grep -F checking for ld used by arm-none-linux-gnueabi-gcc... /home/mwestphal/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/bin/ld checking if the linker (/home/mwestphal/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... no checking for arm-none-linux-dumpbin... no checking for arm-none-linux-link... no checking for dumpbin... no checking for link... link -dump -symbols checking the name lister (link -dump -symbols) 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 for /home/mwestphal/CodeSourcery/Sourcery_G++_Lite/arm-none-linux-gnueabi/bin/ld option to reload object files... -r checking for arm-none-linux-objdump... objdump checking how to recognize dependent libraries... pass_all checking for arm-none-linux-ar... no checking for ar... ar checking for arm-none-linux-strip... strip checking for arm-none-linux-ranlib... no checking for ranlib... ranlib checking command to parse link -dump -symbols output from arm-none-linux-gnueabi-gcc object... failed checking for dlfcn.h... yes checking for objdir... .libs checking if arm-none-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no checking for arm-none-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC checking if arm-none-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes checking if arm-none-linux-gnueabi-gcc static flag -static works... yes checking if arm-none-linux-gnueabi-gcc supports -c -o file.o... yes checking if arm-none-linux-gnueabi-gcc supports -c -o file.o... (cached) yes checking whether the arm-none-linux-gnueabi-gcc linker (/home/mwestphal/CodeSourcery/Sourcery_G++_Lite/arm-none-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 zlib checking zlib.h usability... no checking zlib.h presence... no checking for zlib.h... no Checking headers checking for dirent.h that defines DIR... yes checking for library containing opendir... none required checking for ANSI C header files... (cached) yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking for unistd.h... (cached) yes checking ctype.h usability... yes checking ctype.h presence... yes checking for ctype.h... yes checking dirent.h usability... yes checking dirent.h presence... yes checking for dirent.h... yes checking errno.h usability... yes checking errno.h presence... yes checking for errno.h... yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking stdarg.h usability... yes checking stdarg.h presence... yes checking for stdarg.h... yes checking for sys/stat.h... (cached) yes checking for sys/types.h... (cached) yes checking for stdint.h... (cached) yes checking inttypes.h.h usability... no checking inttypes.h.h presence... no checking for inttypes.h.h... no checking time.h usability... yes checking time.h presence... yes checking for time.h... yes checking ansidecl.h usability... no checking ansidecl.h presence... no checking for ansidecl.h... no checking ieeefp.h usability... no checking ieeefp.h presence... no checking for ieeefp.h... no checking nan.h usability... no checking nan.h presence... no checking for nan.h... no checking math.h usability... yes checking math.h presence... yes checking for math.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking fp_class.h usability... no checking fp_class.h presence... no checking for fp_class.h... no checking float.h usability... yes checking float.h presence... yes checking for float.h... yes checking for stdlib.h... (cached) yes checking for sys/socket.h... yes checking for netinet/in.h... yes checking for arpa/inet.h... yes checking netdb.h usability... yes checking netdb.h presence... yes checking for netdb.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking poll.h usability... yes checking poll.h presence... yes checking for poll.h... yes checking sys/mman.h usability... yes checking sys/mman.h presence... yes checking for sys/mman.h... yes checking sys/timeb.h usability... yes checking sys/timeb.h presence... yes checking for sys/timeb.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h... yes checking for arpa/nameser.h... yes checking for resolv.h... yes checking dl.h usability... no checking dl.h presence... no checking for dl.h... no checking for dlfcn.h... (cached) yes Checking libraries checking for strftime... yes checking for strdup... yes checking for strndup... yes checking for strerror... yes checking for finite... yes checking for isnand... no checking for fp_class... no checking for class... no checking for fpclass... no checking for strftime... (cached) yes checking for localtime... yes checking for gettimeofday... yes checking for ftime... yes checking for stat... yes checking for _stat... no checking for signal... yes checking for printf... yes checking for sprintf... yes checking for fprintf... yes checking for snprintf... yes checking for vfprintf... yes checking for vsprintf... yes checking for vsnprintf... yes checking for sscanf... yes checking for va_copy... yes checking for library containing gethostent... none required checking for library containing setsockopt... none required checking for library containing connect... none required checking for type of socket length (socklen_t)... socklen_t * checking whether to enable IPv6... yes checking struct sockaddr::ss_family... yes checking for getaddrinfo... yes checking for isnan... yes checking for isinf... yes checking for python... /usr/bin/python Found Python version 2.6 could not find python2.6/Python.h checking for shl_load... no checking for shl_load in -ldld... no checking for dlopen... no checking for dlopen in -ldl... yes Checking configuration requirements Enabling multithreaded support checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for pthread_join in -lpthread... yes Disabling ICONV support Enabled Schematron support Enabled Schemas/Relax-NG support Disabling code coverage for GCC configure: creating ./config.status config.status: creating libxml2.spec config.status: creating Makefile config.status: creating include/Makefile config.status: creating include/libxml/Makefile config.status: creating doc/Makefile config.status: creating doc/examples/Makefile config.status: creating doc/devhelp/Makefile config.status: creating example/Makefile config.status: creating python/Makefile config.status: creating python/tests/Makefile config.status: creating xstc/Makefile config.status: creating include/libxml/xmlversion.h config.status: creating xml2-config config.status: creating libxml-2.0.pc config.status: creating libxml-2.0-uninstalled.pc config.status: creating python/setup.py config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands config.status: executing libtool commands Done configuring