Page 1 of 2
[SOLVED]Problems with i686-elf-gcc
Posted: Mon Jan 19, 2015 5:05 pm
by bashcommando
Hello again, I am having problems with my cross-compiled version of gcc. Just like the tutorial I cross-compiled gcc and binutils(and had to build some packages from the source). Whenever I try to compile something with it it says it that ld can not find certain files and the build fails. Any help? I am currently using GNU/Linux(Pinguy 14.04) and I don't know what to do.
Please help?
Re: Problems with i686-elf-gcc
Posted: Mon Jan 19, 2015 6:06 pm
by gerryg400
bashcommando wrote:Hello again, I am having problems with my cross-compiled version of gcc. Just like the tutorial I cross-compiled gcc and binutils(and had to build some packages from the source). Whenever I try to compile something with it it says it that ld can not find certain files and the build fails. Any help? I am currently using GNU/Linux(Pinguy 14.04) and I don't know what to do.
Please help?
Please read your post. Do you really think that there is enough information there to guarantee that someone can provide constructive help ?
Hint: The answer is not "Yes".
Re: Problems with i686-elf-gcc
Posted: Mon Jan 19, 2015 7:01 pm
by bashcommando
gerryg400 wrote:bashcommando wrote:Hello again, I am having problems with my cross-compiled version of gcc. Just like the tutorial I cross-compiled gcc and binutils(and had to build some packages from the source). Whenever I try to compile something with it it says it that ld can not find certain files and the build fails. Any help? I am currently using GNU/Linux(Pinguy 14.04) and I don't know what to do.
Please help?
Please read your post. Do you really think that there is enough information there to guarantee that someone can provide constructive help ?
Hint: The answer is not "Yes".
I don't need the hint, what else can I provide? Oh wait, I am using gcc 4.9.2, binutils 2.25 and here is a error log(I got a different error this time):
Code: Select all
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 20 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 21 has invalid symbol index 22
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
Did that help?
Re: Problems with i686-elf-gcc
Posted: Mon Jan 19, 2015 9:54 pm
by ExeTwezz
bashcommando wrote:Code: Select all
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
Did you compile with
?
Re: Problems with i686-elf-gcc
Posted: Tue Jan 20, 2015 3:19 am
by Combuster
cross-compiler
Why is the only instance of "elf" in the thread title, and everything else "linux-gnu"? There's no cross-compiler involved anywhere.
Re: Problems with i686-elf-gcc
Posted: Tue Jan 20, 2015 3:34 am
by iansjack
Minimalism is all very well in its place, but you are still not providing enough information. At the least we need to know the contents of your $PATH variable and the command line that you are using to compile your program. The fact that it is trying to link against your normal library files rather than the cross-compiler ones indicates some fairly fundamental mistake.
Also note that whatever you are trying to compile does not contain a "main" function which C assumes exists (crt1.o will call it) unless you tell it otherwise. What are you trying to compile? A kernel, a user program, a library, or what?
Re: Problems with i686-elf-gcc
Posted: Tue Jan 20, 2015 9:20 am
by bashcommando
Combuster wrote:cross-compiler
Why is the only instance of "elf" in the thread title, and everything else "linux-gnu"? There's no cross-compiler involved anywhere.
ExeTwezz wrote:bashcommando wrote:Code: Select all
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
Did you compile with
?
Thanks for replying, no I didn't compile it with -ffreestanding and yes I am using a cross-compiler. It is located in ~/opt/cross/bin/i686-elf-gcc.
iansjack wrote:Minimalism is all very well in its place, but you are still not providing enough information. At the least we need to know the contents of your $PATH variable and the command line that you are using to compile your program. The fact that it is trying to link against your normal library files rather than the cross-compiler ones indicates some fairly fundamental mistake.
Also note that whatever you are trying to compile does not contain a "main" function which C assumes exists (crt1.o will call it) unless you tell it otherwise. What are you trying to compile? A kernel, a user program, a library, or what?
A program to test if it would work, my path was just like it said in the tutorial.
Code: Select all
void main() {
asm volatile("nop");
}
And sorry again for being a noob. OS development is confusing, I will try to read a lot more of the wiki and search ddg before posting my next question.
Re: Problems with i686-elf-gcc
Posted: Tue Jan 20, 2015 9:26 am
by bashcommando
ExeTwezz wrote:bashcommando wrote:Code: Select all
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
Did you compile with
?
So I compiled with -ffreestanding and it gave me the error I had before:
Code: Select all
ffreestanding
/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.9.2/../../../../i686-elf/bin/ld: cannot find crt0.o: No such file or directory
/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.9.2/../../../../i686-elf/bin/ld: cannot find crtbegin.o: No such file or directory
/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.9.2/../../../../i686-elf/bin/ld: cannot find -lgcc
/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.9.2/../../../../i686-elf/bin/ld: cannot find -lc
/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.9.2/../../../../i686-elf/bin/ld: cannot find -lgcc
/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.9.2/../../../../i686-elf/bin/ld: cannot find crtend.o: No such file or directory
collect2: error: ld returned 1 exit status
What noobish mistake did I do this time?
Edit: I figured it out. I don't have libgcc for i686-elf.
Re: Problems with i686-elf-gcc
Posted: Tue Jan 20, 2015 9:33 am
by bashcommando
ExeTwezz wrote:bashcommando wrote:Code: Select all
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
Did you compile with
?
I tried to recompile but:
Code: Select all
⏚ [bashcommando:/home … 86-elf-gcc/gcc-4.9.2] $ make all-target-libgcc
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libiberty'
make[2]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libiberty/testsuite'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libiberty/testsuite'
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libiberty'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/lto-plugin'
make all-am
make[2]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/lto-plugin'
make[2]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/lto-plugin'
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/lto-plugin'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/intl'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/intl'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/libiberty'
make[2]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/libiberty/testsuite'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/libiberty/testsuite'
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/libiberty'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/fixincludes'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/fixincludes'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/zlib'
true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS=-static-libstdc++ -static-libgcc " "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-g -O2" "MAKE=make" "MAKEINFO=makeinfo --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/bash" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/home/bashcommando/opt/cross" "infodir=/home/bashcommando/opt/cross/share/info" "libdir=/home/bashcommando/opt/cross/lib" "prefix=/home/bashcommando/opt/cross" "tooldir=/home/bashcommando/opt/cross/i686-elf" "AR=ar" "AS=as" "CC=gcc" "CXX=g++" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do # make
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/zlib'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libbacktrace'
make all-am
make[2]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libbacktrace'
true DO=all multi-do # make
make[2]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libbacktrace'
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libbacktrace'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libcpp'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libdecnumber'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libdecnumber'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/fixincludes'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/fixincludes'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/gcc'
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/gcc'
Checking multilib configuration for libgcc...
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/i686-elf/libgcc'
Makefile:165: ../.././gcc/libgcc.mvars: No such file or directory
make[1]: *** No rule to make target `../.././gcc/libgcc.mvars'. Stop.
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/i686-elf/libgcc'
make: *** [all-target-libgcc] Error 2
Re: Problems with i686-elf-gcc
Posted: Tue Jan 20, 2015 6:17 pm
by gardinirafael
bashcommando wrote:ExeTwezz wrote:bashcommando wrote:Code: Select all
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
Did you compile with
?
I tried to recompile but:
Code: Select all
⏚ [bashcommando:/home … 86-elf-gcc/gcc-4.9.2] $ make all-target-libgcc
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libiberty'
make[2]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libiberty/testsuite'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libiberty/testsuite'
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libiberty'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/lto-plugin'
make all-am
make[2]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/lto-plugin'
make[2]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/lto-plugin'
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/lto-plugin'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/intl'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/intl'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/libiberty'
make[2]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/libiberty/testsuite'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/libiberty/testsuite'
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/libiberty'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/fixincludes'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/build-i686-pc-linux-gnu/fixincludes'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/zlib'
true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS=-static-libstdc++ -static-libgcc " "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-g -O2" "MAKE=make" "MAKEINFO=makeinfo --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/bash" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/home/bashcommando/opt/cross" "infodir=/home/bashcommando/opt/cross/share/info" "libdir=/home/bashcommando/opt/cross/lib" "prefix=/home/bashcommando/opt/cross" "tooldir=/home/bashcommando/opt/cross/i686-elf" "AR=ar" "AS=as" "CC=gcc" "CXX=g++" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do # make
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/zlib'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libbacktrace'
make all-am
make[2]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libbacktrace'
true DO=all multi-do # make
make[2]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libbacktrace'
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libbacktrace'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libcpp'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libdecnumber'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/libdecnumber'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/fixincludes'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/fixincludes'
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/gcc'
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/host-i686-pc-linux-gnu/gcc'
Checking multilib configuration for libgcc...
make[1]: Entering directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/i686-elf/libgcc'
Makefile:165: ../.././gcc/libgcc.mvars: No such file or directory
make[1]: *** No rule to make target `../.././gcc/libgcc.mvars'. Stop.
make[1]: Leaving directory `/home/bashcommando/Desktop/Projects/i686-elf-gcc/gcc-4.9.2/i686-elf/libgcc'
make: *** [all-target-libgcc] Error 2
You did not follow gcc build recomendations.
Try to exit gcc directory and create another directory for call the make.
More instructions:
http://wiki.osdev.org/GCC_Cross-Compiler
Re: Problems with i686-elf-gcc
Posted: Wed Jan 21, 2015 8:37 am
by bashcommando
So I have to re-download gcc again? I already followed the instructions. I'll try again.
Re: Problems with i686-elf-gcc
Posted: Wed Jan 21, 2015 8:52 am
by gardinirafael
bashcommando wrote:
So I have to re-download gcc again? I already followed the instructions. I'll try again.
No, you haven't. re-extract GCC files and call make out of GCC dir
Example:
cd /home/user
extract command
mkdir build_dir
cd build_dir
Inside of build dir, you call the make
../gccdir/make
Re: Problems with i686-elf-gcc
Posted: Wed Jan 21, 2015 10:06 am
by max
gardinirafael wrote:... call make out of GCC dir
Example:
cd /home/user
extract command
mkdir build_dir
cd build_dir
Inside of build dir, you call the make
../gccdir/make
No, you don't do it like this, because it doesn't matter from where you 'make' the project, but from/to where you 'configure'd it.
You call the binutils/gcc/whatever configure scripts from within the build dir and then call make within the build dir.
Code: Select all
mkdir gcc-4.x-build
cd gcc-4.x-build
../gcc-4.x/configure yourflags
make
make install
Re: Problems with i686-elf-gcc
Posted: Wed Jan 21, 2015 10:59 am
by bashcommando
max wrote:gardinirafael wrote:... call make out of GCC dir
Example:
cd /home/user
extract command
mkdir build_dir
cd build_dir
Inside of build dir, you call the make
../gccdir/make
No, you don't do it like this, because it doesn't matter from where you 'make' the project, but from/to where you 'configure'd it.
You call the binutils/gcc/whatever configure scripts from within the build dir and then call make within the build dir.
Code: Select all
mkdir gcc-4.x-build
cd gcc-4.x-build
../gcc-4.x/configure yourflags
make
make install
gardinirafael wrote:bashcommando wrote:
So I have to re-download gcc again? I already followed the instructions. I'll try again.
No, you haven't. re-extract GCC files and call make out of GCC dir
Example:
cd /home/user
extract command
mkdir build_dir
cd build_dir
Inside of build dir, you call the make
../gccdir/make
I followed the tutorial as accurate as possible and downgraded to gcc 4.8.3 and binutils 2.24. I got this:
Code: Select all
/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.8.3/../../../../i686-elf/bin/ld: cannot find crt0.o: No such file or directory
/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.8.3/../../../../i686-elf/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
What else am I doing wrong?
Re: Problems with i686-elf-gcc
Posted: Wed Jan 21, 2015 12:46 pm
by Combuster
What else am I doing wrong?
Reading, as usual:
GCC Cross-Compiler wrote:Note how this compiler is not able to compile normal C programs.