Page 2 of 3

Posted: Sun Apr 08, 2007 4:11 am
by supagu
okay i removed all underscore prefixes, this fixed a few problems, i also had to change nasm to use elf instead of coff, this fixed the rest

Posted: Sun Apr 08, 2007 5:01 am
by INF1n1t
Yes, I also had several problems (ld couldn't find kernel_main). I thought as they said on the tutorials, but when I looked at the KERNEL.O file, which gcc had produced, I saw that gcc did not put any underscores at all. So I learned my lesson!

But dude, check it out: ld give me something very funny. I have defined a symbol in the linkerscript, called phys. And when I try to use it, ld says that phys is not defined! It's very strange. What do you think about that?

And the last thing, the toolchain didn't worked, but the cross-compiler tutorial on the wiki works very well!

Posted: Sun Apr 08, 2007 5:24 am
by supagu
yeah i followed that tut, had some troubles with it, but managed to get it to work.

How ever i want to be able to compile c++ as well, which the wiki didnt cover enough.
I've downloaded the g++ tar file from the site (http://ftp.gnu.org/gnu/gcc/gcc-4.0.2/) extracted it over the top of the extracted core files.

Now i try to run "make all-gcc" which fails with the following:

checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... Invalid configuration `i585-elf': machine `i585'
not recognized
configure: error: /bin/sh ../../gcc-4.0.2/gcc/../config.sub i585-elf failed
make: *** [configure-gcc] Error 1

so once again im stuck

Posted: Sun Apr 08, 2007 6:02 am
by ehird
i586 not i585

Posted: Sun Apr 08, 2007 6:03 am
by INF1n1t
supagu wrote:yeah i followed that tut, had some troubles with it, but managed to get it to work.

How ever i want to be able to compile c++ as well, which the wiki didnt cover enough.
I've downloaded the g++ tar file from the site (http://ftp.gnu.org/gnu/gcc/gcc-4.0.2/) extracted it over the top of the extracted core files.

Now i try to run "make all-gcc" which fails with the following:

checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... Invalid configuration `i585-elf': machine `i585'
not recognized
configure: error: /bin/sh ../../gcc-4.0.2/gcc/../config.sub i585-elf failed
make: *** [configure-gcc] Error 1

so once again im stuck
Well, I can tell you that it is not i585 but i586...you have a wrong $TARGET. You should type i586-elf...

I've also created a makefile to compile my project and now I'm very happy. 10x to all of you, guys!

Edit: I just see now that ehird was faster then me! But I didn't see the post yesterday!

Posted: Sun Apr 08, 2007 11:47 pm
by supagu
okay a rebuild of gcc fixes it :)

Re: GCC and LD problem

Posted: Sun Feb 07, 2010 1:04 am
by evilhamburger
Yes, I'm bumping an old post.


I'm having trouble setting up my cross compiler.

I have versions of bin utils and GCC that the wiki says works, and I have cygwin.

it chokes on the
"make all-gcc"
line.

I have tried different targets, different versions of GCC and Binutils too.

I am trying to compile from 32bit Windows 7, targeting ELF on the x64 arch.

Does anyone have an existing cross compiler I can borrow?

Re: GCC and LD problem

Posted: Sun Feb 07, 2010 4:14 am
by skyking
evilhamburger wrote: I have versions of bin utils and GCC that the wiki says works, and I have cygwin.

it chokes on the
"make all-gcc"
line.
That's not a very distinctive description of the problem. What kind of diagnostics do the make/compiler output?

Re: GCC and LD problem

Posted: Sun Feb 07, 2010 4:52 am
by evilhamburger
oh it's something wrong with the makefile (I don't use make at all... so I'm not good with these errors)

../../gcc-4.4.2/gcc/cp/make-lang.in:190: *** target pattern contains no '%'. Stop.
make[1]: Leaving directory 'cygdrive/e/build-gcc/gcc'
make: *** [all-gcc] Error 2

Re: GCC and LD problem

Posted: Mon Feb 08, 2010 2:28 am
by Solar
  • Did you follow the tutorial exactly?
  • What is the version of binutils you're using?
  • Did you follow the tutorial exactly?
  • What is the version of GCC you're using? (Well, it appears to be v4.4.2, I just want to be a pain at this point. ;-) )
  • Did you follow the tutorial exactly?
  • What is the version of make you're using ('make -v')?
  • What is the exact command sequence you've been using (i.e., did you follow the tutorial exactly)?
  • Is that really the error message? (It is very important to post everything from the topmost, i.e., first error message.)

Re: GCC and LD problem

Posted: Wed Feb 10, 2010 8:23 am
by evilhamburger
Sorry, was on camp.

- Tutorial followed to the letter
- That is the first error message I get
- Bin utils V= 2.20 (Version I am building and version I am building with, but targeting a different platorm)
- GCC V = 4.4.2 (As above)
- GNU Make 3.81

Re: GCC and LD problem

Posted: Wed Feb 10, 2010 10:54 am
by Combuster
make[1]: Leaving directory 'cygdrive/e/build-gcc/gcc'
- Tutorial followed to the letter
I hate to ruin your dreams, but you didn't.

Re: GCC and LD problem

Posted: Thu Feb 11, 2010 1:41 am
by evilhamburger
I changed a folder. Hardly a tutorial breaker.

Re: GCC and LD problem

Posted: Thu Feb 11, 2010 1:42 am
by evilhamburger
Make that...

I changed the root folder.
The structure after that is the same.

Re: GCC and LD problem

Posted: Thu Feb 11, 2010 3:01 am
by AJ
evilhamburger wrote:I changed a folder. Hardly a tutorial breaker.
How many other things have been changed too?

Follow the tutorial to the letter and then when it works, try again with any changes you want to make.

Having said that, some things to consider:
* If you are running Windows 7, did you install and run Cygwin as an administrator? I believe this has made a difference to me in the past and could be worth a shot. I don't know how much difference this currently makes, because I run with UAC disabled.
* Are you able to build the basic i[5/6]86 version, or does it just fail with x64?
* What version of Cygwin are you using? TBH, I have never used the cross-compiler tutorial on 1.7 - I just transferred my version build on 1.5, but have just downloaded all the latest versions of GMP, MPFR, GCC and Binutils and am running through the tutorial on Cygwin 1.7 now. I'll post back any anomalies, but if (when ;) ) it works, will add a note on the wiki page.

I originally had problems with making the cross compiler, and never figured out what the problem was - probably not following something properly. Since that time, I've never since had an issue. In the meantime, I used someone else's precompiled versions, but it was never as satisfying!

Cheers,
Adam