OSDev.org
https://forum.osdev.org/

GCC is broken
https://forum.osdev.org/viewtopic.php?f=13&t=31413
Page 2 of 2

Author:  zaval [ Sun Mar 12, 2017 4:38 pm ]
Post subject:  Re: GCC is broken

You should ensure that i686-elf-as binary has been properly built, check its --target-help options for example. from its output it should be clear (hopefully) for what target it has been built. if it shows apple specific things, then you configured your build wrong. if it is for i686-elf, as it was intended for, then your build is OK, and you have some trouble with environment settings. it's easier. unfortunately I barely could help with this, because my working machine is Windows and it's quite easy to set up the environment for cross-compile tools here. I have 3 different gcc builds for aarch64, arm and mips on x86 machine and setting it up was as easy as writing a few of lines in a .cmd file for the particular tool. but it differs from what you have.
So check the output your as first.

Author:  DridriLaBastos [ Mon Mar 13, 2017 8:26 am ]
Post subject:  Re: GCC is broken

zaval wrote:
You should ensure that i686-elf-as binary has been properly built, check its --target-help options for example. from its output it should be clear (hopefully) for what target it has been built. if it shows apple specific things, then you configured your build wrong. if it is for i686-elf, as it was intended for, then your build is OK, and you have some trouble with environment settings.


I think I found the problem, when I try i686-elf-as --target-help, everything looks good, but when I try i686-elf-gcc --target-help, in the section "Assembler options" it sais "clang: warning: argument unused during compilation: '--target-help'" so, I think that my i686-elf-gcc uses as, located in /usr/bin/as instead of i686-elf-as, and I think that the same thing happens to ld

Author:  DridriLaBastos [ Mon Mar 13, 2017 8:43 am ]
Post subject:  Re: GCC is broken

Ok, the problem was that, so I modified my PATH so that binutils points to /.../binutils/i686-elf/bin where there is i686-elf binutils but without the suffix "i686-elf-" and now everything work properly, so I will search in the configuration options of gcc if there is something to specify that it must uses "i686-elf-ld" and "i686-elf-as" instead of "ld" and "as", and I will rebuild it

Author:  DridriLaBastos [ Mon Mar 13, 2017 10:46 am ]
Post subject:  Re: GCC is broken

I built gcc with --with-as= and --with-ld= options, and all works well now, thank you all for the help

Page 2 of 2 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/