Page 1 of 1

Cross Compiler problem

Posted: Tue Jun 19, 2007 6:50 pm
by Candamir
I knew it was no good idea to reinstall Cygwin... :?

As i was exactly following the instructions in the tutorial (downloaded latest versions of binutils and gcc-core), in the step 'make all' of bootstrapping binutils, this was the output:

Code: Select all

make[1]: Entering directory '/usr/src/build-binutils'
mkdir --p -- ./libiberty
Configuring in ./libiberty
Configure: error: invalid feature name: nls
make[1]: *** [configure-libiberty] Error 1
make[1]: Leaving directory '/usr/src/build-binutils'
make: *** [all] Error 2
As for the nls, I did use --disable-nls in the configure process. Googling for 'invalid feature name nls make' didn't help, either.

Thanks for your help

Candamir

Posted: Tue Jun 19, 2007 7:06 pm
by Brynet-Inc
Are you sure you obtained these sources from the PROPER location? via official mirrors not the "Cygwin" modified sources.

http://ftp.gnu.org/gnu/binutils/
http://ftp.gnu.org/gnu/gcc/

I'm positive you'll find the right archives above lol 8)

(Also, Post your complete ./configure command next time as it's not possible to us to read minds..)

Posted: Tue Jun 19, 2007 7:18 pm
by Candamir
Sorry, but I did get my archives from the GNU website:

http://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2
http://ftp.gnu.org/gnu/gcc/gcc-4.2.0/gc ... .0.tar.bz2

Is there a chance the procedure doesn't work with this versions? (GCC 4.2.0 isn't mentioned in the Wiki, I did, however, get binutils 2.17 which is mentioned in the wiki and was stuck at bootstrapping binutils, not gcc).
(Also, Post your complete ./configure command next time as it's not possible to us to read minds..)
Sorry; here it is (the one from the Wiki, which is the one I used):

Code: Select all

../binutils-2.17/configure --target=$TARGET --prefix=$PREFIX --disable-nls
Thanks

Candamir

Edit: I have now tried a few things... I installed bison, flex and byacc because I remember that I had them too on my old installation... I tried setting the target to i386-elf and i486-elf instead of i586-elf... but the error message is always the same... I also took a look at the configure output, and there it stated that it needed a program called cmp but didn't find it and cmp wasn't on the package list in setup.exe... :?

Posted: Wed Jun 20, 2007 3:19 am
by Combuster
Candamir wrote:I also took a look at the configure output, and there it stated that it needed a program called cmp but didn't find it and cmp wasn't on the package list in setup.exe... :?
It's supposedly part of the rootkit. A default cygwin install should provide it. Installing again cleanly from a different mirror might solve that (it fixed my install a few times already :shock:)

Posted: Wed Jun 20, 2007 4:02 am
by AJ
Hi,

You're not the only one - I have tried the build with 4.2.0 and have exactly the same problems. Having said that, the same happens with 4.1.2. If I follow the instructions with Damn Small Linux running in Virtual PC, no problems - but I am much more familiar with Windows for devving.

[verypolitetone]
A few days/weeks ago, someone kindly posted a zipped version of their cleanly-built "/usr/cross" directory which worked very well for me. If anyone wanted to do that for a version including g++ too, that would be extremely nice of them... :D

Cheers,
Adam

Posted: Wed Jun 20, 2007 4:13 am
by jnc100
AJ wrote:A few days/weeks ago, someone kindly posted a zipped version of their cleanly-built "/usr/cross" directory
I posted a cygwin hosted cross compiler targeting i586-elf, based upon gcc 4.1.2 and binutils 2.17. Its available here but I'd really appreciate it if someone mirrored it somewhere with a better bandwidth as at the moment its just running off my server sitting next to me with a rather slow upstream. The page above has one known problem (+ fix) with the package - if anyone else finds other problems please let me know.
AJ wrote:If anyone wanted to do that for a version including g++ too, that would be extremely nice of them...
Might do, if I get a chance. I don't use c++ for my os, so didn't bother, and at the time I created the last archive it was in response to a request for a small download for someone who had a dial-up connection, so I tried to keep it as small as possible.

Regards,
John.

Posted: Wed Jun 20, 2007 5:01 am
by jnc100
GNU 4.1.2 C++ cross compiler running on Windows available here. Again, if anyone could mirror these I'd be grateful. Note that I haven't tested the C++ compiler in this package, except by running the --version command, which seems to work. The C compiler is also included and seems to work okay at compiling my kernel.

Regards,
John.

Posted: Wed Jun 20, 2007 5:08 am
by AJ
Fantastic, thank you!

If I find somewhere to host these files, are you happy for me to distribute them for others?

Cheers,
Adam

Posted: Wed Jun 20, 2007 5:14 am
by jnc100
AJ wrote:If I find somewhere to host these files, are you happy for me to distribute them for others?
Of course, please could you test them first though. They're under the GPL after all.

Regards,
John.

Posted: Wed Jun 20, 2007 5:25 am
by AJ
OK.

So far I have compiled a few elf test binaries and my kernel's exe loader seems to load them fine. I'll do a few more tests then scratch around for some bandwidth :)

I'm currently a very happy bloke!

Cheers,
Adam

Posted: Wed Jun 20, 2007 11:11 am
by frank
@Candamir
When you reinstalled cygwin did you set the mode to text? It must be set to binary in order to build gcc and binutils.

Posted: Wed Jun 20, 2007 6:50 pm
by Kevin McGuire

Posted: Wed Jun 20, 2007 9:11 pm
by Candamir
Thank you all, I could solve my problem. The problem was (as frank pointed out) that my Cygwin was running in text mode and I had to run setup.exe again in order to enable binary / UNIX mode.

Thanks

Candamir

Edit: Maybe this would be worthy for the wiki article, but I haven't yet been approved as an editor, so I'll do it when my application gets through or maybe someone else would do it?

Posted: Thu Jun 21, 2007 7:53 am
by Combuster
Candamir wrote:Edit: Maybe this would be worthy for the wiki article, but I haven't yet been approved as an editor, so I'll do it when my application gets through or maybe someone else would do it?
chase wrote:I've opened up the wiki editing to any registered forum member.
I added a note here, but you should have had the required access already :?

Posted: Thu Jun 21, 2007 12:14 pm
by AJ
Hi,

For anyone who is interested, as I was, a link to the crosscompiler provided by jnc100 is now in my sig. I switched it to zip format. Much as I think anyone owning Windows should have 7 zip (which provides much better compression), I did it so that anyone using XP+ can just open the folder directly.

Cheers,
Adam