Moin! Ich möchte unter einem Linux mit einem Crosscompiler eine Bibliothek compilieren. Es handelt sich um die cgicc Blibliothek. Im Download ist eine configure Datei dabei, die natürlich den GCC nicht finden kann. Wie kann ich dem configure sagen dass mein Compiler anders heißt und in einem bestimmten Pfad liegt? Das Gastsystem ist ein Ubuntu mit Eclipse, der Crosscompiler ist der arm-linux-gnueabi-gcc. Wie kann ich dann, wenn das geklappt hat, dem Ecipse sagen die Blibliothek zu benutzen? Gruß Stefan
Hi, Lies dir doch mal das hier durch. Dann weist du für nächstes mal bescheid. https://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/Specifying-Target-Triplets.html Nur so nebenbei, hättest du in z.B. google nach "configure" und "arm-linux-gnueabi-gcc" gesucht, hättest du schon im ersten Treffer deine Antwort gefunden. Dieses Forum hat auch eine Suchfunktion die in etwa das gleiche Ergebnis erzielt hätte. ./configure --host=arm-linux-gnueabi Auf deine zweite Frage -> google -> "Ecipse Blibliothek benutzen"
:
Bearbeitet durch User
Wenn das Gastsystem bereits ein Linux ist, warum dann nicht dort generieren? Dort heißt der Compiler dann einfach gcc.
Stefan schrieb: > Ich möchte unter einem Linux mit einem Crosscompiler eine Bibliothek > compilieren. Es handelt sich um die cgicc Blibliothek. Im Download ist > eine configure Datei dabei, die natürlich den GCC nicht finden kann. Wie > kann ich dem configure sagen dass mein Compiler anders heißt und in > einem bestimmten Pfad liegt? Der Pfad muß in deinem PATH stehen. Und dem configure gibst du nicht direkt den zu verwendenen GCC, sondern den Namen der Zielplattform an, für die übersetzt werden soll. Der Compiler ist ja nicht der einzige Unterschied. Bei configure gibt es dafür den Kommandozeilenparameter --target.
Ups, Eduard hat natürlich recht. Es ist --host, und nicht --target.
Danke für die Antworten und die Infos. Ich habe nun in einem Terminal zunächst den Pfad erweitert, so dass mein Crosscompiler gefunden wird: export $PATH bash: export: `/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux- gnueabi/:/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/bin/armv5te-li nux-gnueabi/:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/us r/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/gnublin/eclipse': not a valid identifier Den Compiler kann ich mit arm-linux-gnueabi-gcc im Terminal aufrufen. Dann rufe ich das config wie vorgeschlagen auf: sudo ./configure --host=arm-linux-gnueabi Die Ausgabe sieht so aus: configure: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used 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 whether build environment is sane... yes checking for arm-linux-gnueabi-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 configure: libconfig - made with pride in California checking for style of include used by make... GNU checking for arm-linux-gnueabi-gcc... no checking for gcc... 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... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 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 minix/config.h usability... no checking minix/config.h presence... no checking for minix/config.h... no checking whether it is safe to define _EXTENSIONS_... yes checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... no checking for arm-linux-gnueabi-dumpbin... no checking for arm-linux-gnueabi-link... no checking for dumpbin... no checking for link... link -dump checking the name lister (nm) 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/bin/ld option to reload object files... -r checking for arm-linux-gnueabi-objdump... no checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for arm-linux-gnueabi-dlltool... no checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for arm-linux-gnueabi-ar... no checking for ar... ar checking for archiver @FILE support... @ checking for arm-linux-gnueabi-strip... strip checking for arm-linux-gnueabi-ranlib... no checking for ranlib... ranlib checking command to parse nm output from gcc object... ok checking for sysroot... no checking for arm-linux-gnueabi-mt... no checking for mt... mt checking if mt is a manifest tool... no checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/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... gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking whether gcc and cc understand -c and -o together... yes checking for arm-linux-gnueabi-g++... no checking for arm-linux-gnueabi-c++... no checking for arm-linux-gnueabi-gpp... no checking for arm-linux-gnueabi-aCC... no checking for arm-linux-gnueabi-CC... no checking for arm-linux-gnueabi-cxx... no checking for arm-linux-gnueabi-cc++... no checking for arm-linux-gnueabi-cl.exe... no checking for arm-linux-gnueabi-FCC... no checking for arm-linux-gnueabi-KCC... no checking for arm-linux-gnueabi-RCC... no checking for arm-linux-gnueabi-xlC_r... no checking for arm-linux-gnueabi-xlC... no checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for flex... no checking for lex... no ******************************************************************* You do not seem to have flex. While flex is not required to build libconfig, you may need it to regenerate the lexer if you change the scanner.l file. Flex 2.5.33 or newer is recommended. ******************************************************************* checking for bison... no checking for byacc... no ******************************************************************* You do not seem to have bison. While bison is not required to build libconfig, you may need it to regenerate the parser if you change the grammar.y file. ******************************************************************* checking for compiler switch to enable full C/C++ warnings... -Wall -Wshadow -Wextra -Wdeclaration-after-statement -Wno-unused-parameter, -Wall -Wshadow -Wextra -Wno-unused-parameter checking for ANSI C header files... (cached) yes checking for unistd.h... (cached) yes checking for stdint.h... (cached) yes checking xlocale.h usability... yes checking xlocale.h presence... yes checking for xlocale.h... yes checking for an ANSI C-conforming const... yes checking for newlocale... yes checking for uselocale... yes checking for freelocale... yes configure: creating ./config.status config.status: creating Makefile config.status: creating lib/Makefile config.status: creating lib/libconfig.pc config.status: creating lib/libconfig++.pc config.status: creating doc/Makefile config.status: creating examples/Makefile config.status: creating examples/c/Makefile config.status: creating examples/c++/Makefile config.status: creating tinytest/Makefile config.status: creating tests/Makefile config.status: creating libconfig.spec config.status: creating ac_config.h config.status: ac_config.h is unchanged config.status: executing depfiles commands config.status: executing libtool commands gnublin@ubuntu:~/Downloads/libconfig-1.4.9$ ^C gnublin@ubuntu:~/Downloads/libconfig-1.4.9$ arm-linux-gnueabi-c arm-linux-gnueabi-c++filt arm-linux-gnueabi-cpp Ist das soweit gut? Wie geht es dann weiter? Ich habe dann make aufgerufen, oder da scheint der normale gcc benutzt zu werden, nicht der Crosscompiler... Stefan
Stefan schrieb: > Danke für die Antworten und die Infos. > > Ich habe nun in einem Terminal zunächst den Pfad erweitert, so dass mein > Crosscompiler gefunden wird: > > export $PATH Gemeint ist wohl "echo $PATH"? Die Syntax für export ist z.B. "export var=$wert". > bash: export: > `/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux- gnueabi/:/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/bin/armv5te-li nux-gnueabi/:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/us r/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/gnublin/eclipse': > not a valid identifier Die Pfade sehen für eine gcc-Installation ungewöhnlich aus; die enden üblicherweise auf bin; nicht auf $target. Programme, die unter $target/bin liegen (ld, gcc, ...), sollten nicht sichtbar sein; die werden von GCC intern verwendet. Gleiches gilt übrigens auch für die Programme in libexec/gcc/$target/$version (cc1, cc1plus, ...) > Den Compiler kann ich mit arm-linux-gnueabi-gcc im Terminal aufrufen. > Dann rufe ich das config wie vorgeschlagen auf: > > sudo ./configure --host=arm-linux-gnueabi Du willst definitiv nicht root sein für configure oder make! Wer schlägt denn sowas vor??? Bestenfalls "make install" als root und falls man sicher ist, daß man sich nicht das System zerschießt. Außerdem kann es die Dinge sehr vereinfachen, wenn man nicht im Quellverzeichnis configuriert / generiert. Nach fehlgeschlagenem configure / make funktioniert distclean oder realclean nicht immer wie erwartet. Bei eigenem build-Verzeichnis kann man dieses dann einfach löschen und "verseucht" so nicht den Quellbaum mit Überresten fehlgeschlagener Builds. > Die Ausgabe sieht so aus: > > configure: WARNING: if you wanted to set the --build type, don't use > --host. Evtl. hilft --build=i686-pc-linux-gnu --host=arm-linux-gnueabi um die Warnung zu beseitigen und configure früher abbrechen zu lassen, falls es Probleme gibt. > If a cross compiler is detected then cross compile mode will be used > 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 arm-linux-gnueabi-strip... no Er findet die cross-Binutils nicht oder diese sind unvollständig. > checking for strip... strip > [...] > checking for arm-linux-gnueabi-gcc... no Er findet den cross-Compiler nicht. > checking for gcc... gcc > [...] > checking whether we are cross compiling... no > Ist das soweit gut? Wonach sieht's denn aus wenn du die vorangehenden Zeilen liest? Evtl. gibt das entsprechende config.log mehr Auskunft. Und wie gesagt: PATH sieht nicht gut aus.
>Gemeint ist wohl "echo $PATH"? Natürlich... Der Kopf... >Die Pfade sehen für eine gcc-Installation ungewöhnlich aus; Hmm, ich kann nachsehen was da so drin ist; In diesem Verzeichnis /opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux- gnueabi/ sind diese Dateiein: ./arm-linux-gnueabi-addr2line ./arm-linux-gnueabi-gcc ./arm-linux-gnueabi-readelf ./arm-linux-gnueabi-size ./arm-linux-gnueabi-objcopy ./arm-linux-gnueabi-as ./arm-linux-gnueabi-gprof ./arm-linux-gnueabi-nm ./arm-linux-gnueabi-gdb ./arm-linux-gnueabi-elfedit ./arm-linux-gnueabi-strip ./arm-linux-gnueabi-ld ./arm-linux-gnueabi-gcov ./arm-linux-gnueabi-g++ ./arm-linux-gnueabi-cpp ./arm-linux-gnueabi-ar ./arm-linux-gnueabi-strings ./arm-linux-gnueabi-ranlib ./arm-linux-gnueabi-c++filt ./arm-linux-gnueabi-ld.bfd ./arm-linux-gnueabi-objdump Und das zweite Verzeichnis im Pfad /opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/bin/armv5te-linux-gnuea bi/ scheint nicht zu existieren. Warum kann autoconfig den Crosscompiler nicht finden, obwohl ich ja auch direkt im Terminal Selbigen starten kann? Ich habe nochmal einen Versuch gemacht mit: ./configure --build=i686-pc-linux-gnu --host=arm-linux-gnueabi Das ist die Ausgabe, sieht das jetzt besser aus? 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 whether build environment is sane... yes checking for arm-linux-gnueabi-strip... arm-linux-gnueabi-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 configure: libconfig - made with pride in California checking for style of include used by make... GNU 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 dependency style of arm-linux-gnueabi-gcc... gcc3 checking how to run the C preprocessor... arm-linux-gnueabi-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 minix/config.h usability... no checking minix/config.h presence... no checking for minix/config.h... no checking whether it is safe to define _EXTENSIONS_... yes checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for fgrep... /bin/grep -F checking for ld used by arm-linux-gnueabi-gcc... /opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/libexec/armv5te-lin ux-gnueabi/gcc/arm-linux-gnueabi/4.6.4/ld checking if the linker (/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/libexec/armv5te-li nux-gnueabi/gcc/arm-linux-gnueabi/4.6.4/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-g nueabi/arm-linux-gnueabi-nm -B checking the name lister (/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux- gnueabi/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 /opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/libexec/armv5te-lin ux-gnueabi/gcc/arm-linux-gnueabi/4.6.4/ld option to reload object files... -r checking for arm-linux-gnueabi-objdump... arm-linux-gnueabi-objdump checking how to recognize dependent libraries... pass_all checking for arm-linux-gnueabi-dlltool... no checking for dlltool... no 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... (cached) arm-linux-gnueabi-strip checking for arm-linux-gnueabi-ranlib... arm-linux-gnueabi-ranlib checking command to parse /opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-g nueabi/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 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... no 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 (/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/libexec/armv5te-li nux-gnueabi/gcc/arm-linux-gnueabi/4.6.4/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 dependency style of arm-linux-gnueabi-gcc... (cached) gcc3 checking whether arm-linux-gnueabi-gcc and cc understand -c and -o together... yes checking for arm-linux-gnueabi-g++... arm-linux-gnueabi-g++ checking whether we are using the GNU C++ compiler... yes checking whether arm-linux-gnueabi-g++ accepts -g... yes checking dependency style of arm-linux-gnueabi-g++... gcc3 checking how to run the C++ preprocessor... arm-linux-gnueabi-g++ -E checking for ld used by arm-linux-gnueabi-g++... /opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/libexec/armv5te-lin ux-gnueabi/gcc/arm-linux-gnueabi/4.6.4/ld checking if the linker (/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/libexec/armv5te-li nux-gnueabi/gcc/arm-linux-gnueabi/4.6.4/ld) is GNU ld... yes checking whether the arm-linux-gnueabi-g++ linker (/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/libexec/armv5te-li nux-gnueabi/gcc/arm-linux-gnueabi/4.6.4/ld) supports shared libraries... yes checking for arm-linux-gnueabi-g++ option to produce PIC... -fPIC -DPIC checking if arm-linux-gnueabi-g++ PIC flag -fPIC -DPIC works... yes checking if arm-linux-gnueabi-g++ static flag -static works... no checking if arm-linux-gnueabi-g++ supports -c -o file.o... yes checking if arm-linux-gnueabi-g++ supports -c -o file.o... (cached) yes checking whether the arm-linux-gnueabi-g++ linker (/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/libexec/armv5te-li nux-gnueabi/gcc/arm-linux-gnueabi/4.6.4/ld) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for flex... no checking for lex... no ******************************************************************* You do not seem to have flex. While flex is not required to build libconfig, you may need it to regenerate the lexer if you change the scanner.l file. Flex 2.5.33 or newer is recommended. ******************************************************************* checking for bison... no checking for byacc... no ******************************************************************* You do not seem to have bison. While bison is not required to build libconfig, you may need it to regenerate the parser if you change the grammar.y file. ******************************************************************* checking for compiler switch to enable full C/C++ warnings... (cannot determine) checking for ANSI C header files... (cached) yes checking for unistd.h... (cached) yes checking for stdint.h... (cached) yes checking xlocale.h usability... yes checking xlocale.h presence... yes checking for xlocale.h... yes checking for an ANSI C-conforming const... yes checking for newlocale... yes checking for uselocale... yes checking for freelocale... yes configure: creating ./config.status config.status: creating Makefile config.status: creating lib/Makefile config.status: creating lib/libconfig.pc config.status: creating lib/libconfig++.pc config.status: creating doc/Makefile config.status: creating examples/Makefile config.status: creating examples/c/Makefile config.status: creating examples/c++/Makefile config.status: creating tinytest/Makefile config.status: creating tests/Makefile config.status: creating libconfig.spec config.status: creating ac_config.h config.status: ac_config.h is unchanged config.status: executing depfiles commands config.status: executing libtool commands Wenn ja, wie geht's weiter? Stefan
Möglicherweise hier sinnvoll, ansonsten falls jemand mal über die Suche sich hierher verirrt: Ich habe neulich noch von einem ganz anderen interessanten Weg gelesen, wie man cross-kompilieren kann... Voraussetzung ist, - daß auf dem Target erstens etwas Linux-ähnliches läuft (z.B. Raspberry, Beaglebone oder eines der vielen anderen neumodischen Boards mit ARM). - daß man vom PC aus auf das Dateisystem des Targets zugreifen kann (falls z.B. alles auf eine SDCard installiert, die man am PC mounten kann, oder auf dem Target läuft ein SSH-Server und man mounted mit sshfs in den PC). Zudem muß auf dem Zielsystem eine passende Toolchain installiert sein, man will aber wegen der Rechenleistung dort gerade nicht kompilieren, sondern auf einem PC (der natürlich auch unter Linux läuft). Dann kann man qemu auf dem PC installieren. Dadurch ist der PC in der Lage, ELF-Binaries auszuführen, die eigentlich ARM-Code enthalten, indem bei Bedarf der Emulator bemüht wird. Zum Crosskompilieren geht man jetzt her und mounted irgendwie das gesamte Dateisystem des Targets irgendwo in den PC rein, startet auf dem PC eine (ba)sh mit chroot in das Wurzelverzeichnis des gemounteten Targets und damit sehen alle über die sh gestarteten Komandos nur noch das Dateisystem des Targets, laufen aber in Wirklichkeit auf dem PC. Ruft man den gcc oder make oder was auch immer auf, dann wird die Original-Toolchain des Targets bemüht, hat aber die Rechenleistung des PC (abzüglich der Verluste durch qemu). Erzeugte Binaries landen direkt im Dateisystem des Targets, also kein Kopieren mehr nötig. Ich werde es die kommenden Tage mal probieren; der Weg hört sich kompliziert aber plausibel an.
so, make laufen lassen, das läuft recht schön durch, ich habe nun in einem Unterordner (/lib.libs) libconfig.a und noch vieles andere... Mit zusammengegooltem Halbwissen habe ich sudo make install prefix=/opt/eldk-5.2.1/arm5te/sysroots/i686-eldk-linux/usr strip=arm-linux-gnueabi ausgeführt. in /opt/eldk-5.2.1/arm5te/sysroots/i686-eldk-linux/usr/lib habe ich nun libconfig.a liegen, das ist aber komischerweise die einzige .a Datei die ich in dem Verzeichnis finde, obwohl ich in meiner Applikation z.B. -lpthread benutze. Wie könnte es weitergehen?
Du linkst deine Programme gegen libconfig, d.h. rufst den Linker(treiber) mit -lconfig auf. Zusätzlich sollte libconfig Header mitbringen, welche die Interfaces zu den Bibliotheksfunktionen zur Verfügung stellen. Diese includierst du wo benötigt und rufst Funktionen auf wie dokumentiert. Klaus Wachtler schrieb: > Ich habe neulich noch von einem ganz anderen interessanten Weg gelesen, > wie man cross-kompilieren kann... [...] > > Ruft man den gcc oder make oder was auch immer auf, dann wird die > Original-Toolchain des Targets bemüht, hat aber die Rechenleistung des > PC (abzüglich der Verluste durch qemu). Formal handelt es sich dabei nicht um einen cross-Compile, denn es ist build = host = target. Es setzt natürlich voraus, daß das zu erzeugende Paket die Plattform als build-Plattform unterstützt (analog wie oben die Voraussetzung ist, dass die Plattform als host-Plattform unterstützt wird).
Also die Geschichte mit dem make install habe ich nach ewigem rumprobieren nicht hinbekommen, kann ich die Headerdateien und die -a Datei irgendwo manuell hinkopieren so dass der Kompiler/Linker die findet? Wo? Stefan
So, bin wieder ein kleines Stück weitergekommen. Die Ausgabe mit sudo make install sieht soweit ganz gut aus, die .a und .so Dateien werden umkopiert, aber dann will make "arm-linux-gnueabi-ranlib" benutzen, das scheint es einfach nicht zu geben... Welchen Job sollte das erledigen? hier die Ausgabe: Making install in lib make[1]: Entering directory `/home/gnublin/Downloads/libconfig-1.4.9/lib' make install-am make[2]: Entering directory `/home/gnublin/Downloads/libconfig-1.4.9/lib' make[3]: Entering directory `/home/gnublin/Downloads/libconfig-1.4.9/lib' test -z "/opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib" || /bin/mkdir -p "/opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib" /bin/bash ../libtool --mode=install /usr/bin/install -c libconfig.la libconfig++.la '/opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib' libtool: install: /usr/bin/install -c .libs/libconfig.so.9.1.3 /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib/libconfig .so.9.1.3 libtool: install: (cd /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib && { ln -s -f libconfig.so.9.1.3 libconfig.so.9 || { rm -f libconfig.so.9 && ln -s libconfig.so.9.1.3 libconfig.so.9; }; }) libtool: install: (cd /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib && { ln -s -f libconfig.so.9.1.3 libconfig.so || { rm -f libconfig.so && ln -s libconfig.so.9.1.3 libconfig.so; }; }) libtool: install: /usr/bin/install -c .libs/libconfig.lai /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib/libconfig .la libtool: install: /usr/bin/install -c .libs/libconfig++.so.9.1.3 /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib/libconfig ++.so.9.1.3 libtool: install: (cd /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib && { ln -s -f libconfig++.so.9.1.3 libconfig++.so.9 || { rm -f libconfig++.so.9 && ln -s libconfig++.so.9.1.3 libconfig++.so.9; }; }) libtool: install: (cd /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib && { ln -s -f libconfig++.so.9.1.3 libconfig++.so || { rm -f libconfig++.so && ln -s libconfig++.so.9.1.3 libconfig++.so; }; }) libtool: install: /usr/bin/install -c .libs/libconfig++.lai /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib/libconfig ++.la libtool: install: /usr/bin/install -c .libs/libconfig.a /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib/libconfig .a libtool: install: chmod 644 /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib/libconfig .a libtool: install: arm-linux-gnueabi-ranlib /opt/eldk-5.2.1/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib/libconfig .a ../libtool: line 1102: arm-linux-gnueabi-ranlib: command not found make[3]: *** [install-libLTLIBRARIES] Error 127 make[3]: Leaving directory `/home/gnublin/Downloads/libconfig-1.4.9/lib' make[2]: *** [install-am] Error 2 make[2]: Leaving directory `/home/gnublin/Downloads/libconfig-1.4.9/lib' make[1]: *** [install] Error 2 make[1]: Leaving directory `/home/gnublin/Downloads/libconfig-1.4.9/lib' make: *** [install-recursive] Error 1 Stefan
Aha, noch ein Puzzlestück: ich rufe in der Konsole auf: arm-linux-gnueabi-ranlib geht... dann sudo arm-linux-gnueabi-ranlib sudo: arm-linux-gnueabi-ranlib: command not found Wie sag ichs dem sudo?
Mach doch mal: sudo echo $PATH echo $PATH Vielleicht sieht man dann einen Unterschied?
Schon probiert, da steht komischerweise jeweils das gleiche drin... wenn ich den ganzen Vorgang nach "sudo su -" mache klappt übrigens alles und ich kann die Bibliothek mit meiner Toolchain benutzen. Das ist aber halt nicht der "amtliche" Weg... S
Warum es so ist, weiß ich auch nicht. Aber ich habe eh immer keine Lust, ständig sudo... zu schreiben. Deshalb habe ich bei solchen Gelegenheiten immer ein Fenster offen, indem ich einmal ein sudo bash bzw. ssh -l root localhost mache, und ein anderes als normaler Benutzer. Dann kann ich je nach gewünschtem Benutzer einfach das Fenster wechseln. Vielleicht klappt es ja damit zufällig.
Also mit folgender Prozedur funktioniert alles, allerdings scheint mir noch das ein oder andere überflüssig zu sein, vielleicht kann das noch eben jemand "sortieren"? Erst sudo su - Datei set.sh mit folgendem Inhalt erstellen: P1=/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linu x-gnueabi/ P2=/opt/eldk-5.2.1/armv5te/sysroots/i686-eldk-linux/bin/armv5te-linux-gn ueabi/ export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabi- export PATH=$P1:$P2:$PATH Dann ./configure --build=i686-pc-linux-gnu --host=arm-linux-gnueabi Dann make install prefix=/opt/eldk-5.2.1/arm5te/sysroots/i686-eldk-linux/usr strip=arm-linux-gnueabi Kommentare?
Für alle die auf das gleiche Problem stoßen: Auf einem aktuellen Host (z.B: lubuntu 15) geht es einfach so: ./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi sudo make install Voraussetung ist, dass der Crosscompiler im Pfad ist. --host sagt welcher Crosscompiler genommen werden soll, --prefix gibt an wo die Bibliotheken für den Compiler hininstalliert werden sollen. Stefan
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.