PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : prob beim compilieren von binutils



spoensche
27.05.06, 12:34
hi leutz, hab ein prob beim compilieren der binutils.

hab die binutils entpackt, mir noch ein build verzeichnis angelegt und versuche dann wie folgt zu kompilieren:



../binutils-<version>/configure --prefix=/mnt/tools --disable-nls


und erhalte folgende ausgabe:



loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether ln works... (cached) yes
checking whether ln -s works... (cached) yes
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... yes
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gnatbind... no
checking whether compiler driver understands Ada... (cached) no
checking how to compare bootstrapped objects... (cached) cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... yes
checking for MPFR... yes
checking for bison... (cached) bison -y
checking for bison... (cached) bison
checking for gm4... (cached) m4
checking for flex... (cached) flex
checking for flex... (cached) flex
checking for makeinfo... (cached) makeinfo
checking for expect... no
checking for runtest... no
checking for i686-pc-linux-gnu-ar... (cached) ar
checking for i686-pc-linux-gnu-as... (cached) as
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... no
checking for i686-pc-linux-gnu-ld... (cached) /usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld
checking for i686-pc-linux-gnu-lipo... no
checking for lipo... no
checking for i686-pc-linux-gnu-nm... (cached) nm
checking for i686-pc-linux-gnu-ranlib... (cached) ranlib
checking for i686-pc-linux-gnu-strip... (cached) strip
checking for i686-pc-linux-gnu-windres... no
checking for windres... no
checking for i686-pc-linux-gnu-objcopy... (cached) objcopy
checking for i686-pc-linux-gnu-objdump... (cached) objdump
checking for i686-pc-linux-gnu-gcj... no
checking for gcj... no
checking for i686-pc-linux-gnu-gfortran... no
checking for gfortran... no
checking for ar... no
checking for as... no
checking for dlltool... no
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... no
checking for ld... no
checking for lipo... no
checking for i686-pc-linux-gnu-lipo... no
checking for lipo... no
checking for nm... no
checking for objdump... no
checking for ranlib... no
checking for strip... no
checking for windres... no
checking for i686-pc-linux-gnu-windres... no
checking for windres... no
checking where to find the target ar... just compiled
checking where to find the target as... just compiled
checking where to find the target cc... host tool
checking where to find the target c++... host tool
checking where to find the target c++ for libstdc++... host tool
checking where to find the target dlltool... just compiled
checking where to find the target gcc... host tool
checking where to find the target gcj... host tool
checking where to find the target gfortran... host tool
checking where to find the target ld... just compiled
checking where to find the target lipo... host tool
checking where to find the target nm... just compiled
checking where to find the target objdump... just compiled
checking where to find the target ranlib... just compiled
checking where to find the target strip... just compiled
checking where to find the target windres... just compiled
checking whether to enable maintainer-specific portions of Makefiles... no
creating ./config.status
creating Makefile


wenn ich jetzt mit make compilieren will bekomme ich folgende meldung:



make[1]: Entering directory `/home/marco/software/src/gnu_linux/binutils-build'
Configuring in ./libiberty
configure: loading cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... makeinfo --split-size=5000000
checking for perl... perl
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for i686-pc-linux-gnu-ar... ar
checking for i686-pc-linux-gnu-ranlib... ranlib
checking for i686-pc-linux-gnu-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[1]: *** [configure-libiberty] Fehler 1
make[1]: Leaving directory `/home/marco/software/src/gnu_linux/binutils-build'
make: *** [all] Fehler 2


auch wenn ich --host=i686-pc-linux-gnu beim aufruf von configure übergebe und vorher export CC="gcc -mcpu=i686" bzw. export CC="gcc" ausgeführt habe tut sich nix.

weiss jemand wieso?

hp_tux
27.05.06, 13:09
Hallo,


See `config.log' for more details.

Gruß

hp_tux

spoensche
27.05.06, 13:29
Die hilft mir ja leider auch nicht weiter.

hier mal die config.log:



This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:605: checking host system type
configure:626: checking target system type
configure:644: checking build system type
configure:699: checking for a BSD compatible install
configure:752: checking whether ln works
configure:776: checking whether ln -s works
configure:1861: checking for gcc
configure:1974: checking whether the C compiler (gcc ) works
configure:1990: gcc -o conftest conftest.c 1>&5
configure:2016: checking whether the C compiler (gcc ) is a cross-compiler
configure:2021: checking whether we are using GNU C
configure:2049: checking whether gcc accepts -g
configure:2116: checking for gnatbind
configure:2181: checking whether compiler driver understands Ada
configure:2213: checking how to compare bootstrapped objects
configure:2311: checking for correct version of gmp.h
configure:2324: gcc -c -g -O2 conftest.c 1>&5
configure:2337: checking for MPFR
configure:2350: gcc -o conftest -g -O2 conftest.c -lmpfr -lgmp 1>&5
configure:3401: checking for bison
configure:3441: checking for bison
configure:3480: checking for gm4
configure:3519: checking for flex
configure:3559: checking for flex
configure:3598: checking for makeinfo
configure:3651: checking for expect
configure:3692: checking for runtest
configure:3740: checking for i686-pc-linux-gnu-ar
configure:3815: checking for i686-pc-linux-gnu-as
configure:3890: checking for i686-pc-linux-gnu-dlltool
configure:3921: checking for dlltool
configure:3965: checking for i686-pc-linux-gnu-ld
configure:4040: checking for i686-pc-linux-gnu-lipo
configure:4071: checking for lipo
configure:4115: checking for i686-pc-linux-gnu-nm
configure:4190: checking for i686-pc-linux-gnu-ranlib
configure:4260: checking for i686-pc-linux-gnu-strip
configure:4330: checking for i686-pc-linux-gnu-windres
configure:4361: checking for windres
configure:4405: checking for i686-pc-linux-gnu-objcopy
configure:4480: checking for i686-pc-linux-gnu-objdump
configure:4860: checking for i686-pc-linux-gnu-gcj
configure:4891: checking for gcj
configure:4951: checking for i686-pc-linux-gnu-gfortran
configure:4982: checking for gfortran
configure:5107: checking for ar
configure:5260: checking for as
configure:5413: checking for dlltool
configure:5467: checking for i686-pc-linux-gnu-dlltool
configure:5498: checking for dlltool
configure:5566: checking for ld
configure:5719: checking for lipo
configure:5773: checking for i686-pc-linux-gnu-lipo
configure:5804: checking for lipo
configure:5872: checking for nm
configure:6025: checking for objdump
configure:6178: checking for ranlib
configure:6331: checking for strip
configure:6484: checking for windres
configure:6538: checking for i686-pc-linux-gnu-windres
configure:6569: checking for windres
configure:6617: checking where to find the target ar
configure:6650: checking where to find the target as
configure:6683: checking where to find the target cc
configure:6716: checking where to find the target c++
configure:6752: checking where to find the target c++ for libstdc++
configure:6788: checking where to find the target dlltool
configure:6821: checking where to find the target gcc
configure:6854: checking where to find the target gcj
configure:6890: checking where to find the target gfortran
configure:6926: checking where to find the target ld
configure:6959: checking where to find the target lipo
configure:6982: checking where to find the target nm
configure:7015: checking where to find the target objdump
configure:7048: checking where to find the target ranlib
configure:7081: checking where to find the target strip
configure:7114: checking where to find the target windres
configure:7175: checking whether to enable maintainer-specific portions of Makefiles

derguteweka
27.05.06, 13:55
Moin,


checking whether the C compiler works... configure: error: cannot run C compiled programs.

Das scheint mir das Problem zu sein.

Was passiert denn, wenn du folgendes eingibst:

echo "main(){}" > dummy.c
gcc -v dummy.c

Gruss
WK

spoensche
27.05.06, 18:21
er kompiliert ganz normal, habe auch schon ne vermutung woran es liegen könnte. werd mich dransetzten und mich dann melden.

spoensche
28.05.06, 01:21
ich komm im mom nicht da hinter wieso ich keine c programme ausführen kann.
jedesmal bekomme ich die meldung datei oder verzeichnis nicht gefunden.

derguteweka
28.05.06, 08:12
Moin,


ich komm im mom nicht da hinter wieso ich keine c programme ausführen kann.
jedesmal bekomme ich die meldung datei oder verzeichnis nicht gefunden.

Ich glaub' ich komm' drauf:

checking whether the C compiler (gcc ) is a cross-compiler... yes

Sieht so aus, als haettest du dir deinen gcc (wahrscheinlich eher unabsichtlich) ueberinstalliert - mit nem Crosscompiler - oder hast nen Crosscompiler gebaut, der gcc heisst und irgendwo steht, wo er im $PATH vor dem "richtigen" gcc drankommt. Oder du hast mal versucht selbst deinen gcc "upzugraden", was schiefgelaufen ist.

Wenn du das dummy.c compiliert hast, und es hat funktioniert (das compilieren), dann mach' doch noch mal ein

file a.out

Gruss
WK

spoensche
28.05.06, 10:15
die ausgabe von file a.out:



a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped


in meiner $PATH variable steht unteranderem /usr/bin drin, wo ja auch die execs von gcc drin sind, habe sonst noch nix gefunden. würde zur nor auch deinstallieren und wieder installieren helfen?

derguteweka
28.05.06, 12:46
Moin,

Hab' zwar von Suse keinen Plan, aber das mit dem Deinstallieren und neu installieren koennt' schon was helfen. Was kommt den fuer ne Fehlermeldung, wenn du ./a.out versuchst auszufuehren?
Vielleicht hats dir irgendwas an den Pfaden fuer den dyn. Linker zerlegt - ist jetzt aber bloss mal so ins Blaue ueberlegt.

Gruss
WK

spoensche
28.05.06, 16:32
wenn ich ./a.out in dem ausführe bekomme ich die meldung befehl oder dateiname nicht gefunden (bin aber im richtigen verzeichnis)

derguteweka
28.05.06, 16:47
Moin,

Guck' doch mal, was rauskommt, wenn du

readelf -l a.out | grep interpreter schreibst. Dabei sollte dann z.b. sowas rauskommen:
[Requesting program interpreter: /lib/ld-linux.so.2]
Wenn nicht, dann isses schon mal verdaechtig.

Dann kannste mal noch probieren, ob sich statisch gelinkte binaries noch erzeugen und ausfuehren lassen, z.b. mit

gcc -static dummy.c
./a.out

Aber das wuerd' ich nur machen, wenns dich wirklich brennend interessiert, was da bei dir schiefgelaufen ist - sonst isses mit der Re-installationsmethode sicher schneller :)

Gruss
WK

spoensche
29.05.06, 08:05
[Requesting program interpreter: /tools/lib/ld-linux.so.2] bekomme ich ausgegeben.

ich weis auch warum das so ist, weil ich mit LFS gearbeitet habe. Wie krieg ich das jetzt wieder weg?

derguteweka
29.05.06, 08:38
Moin,

Ahaaa, das wars also. Da hast du wohl das falsche specs file abgeaendert.
Guck' dir nochmal im LFS Buch an, wo das specs file abgeaendert wird. Irgendwo im Kapitel 6. wird das wieder von /tools auf die "normale" version abgeaendert.
Musst nur noch gucken, dass du auch das richtige File (von deinem gcc, nicht dem unter /tools installiertem) nimmst.

Gruss
WK