Page 2 of 2
Re: GCC is broken
Posted: Sun Mar 12, 2017 4:38 pm
by zaval
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.
Re: GCC is broken
Posted: Mon Mar 13, 2017 8:26 am
by DridriLaBastos
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
Re: GCC is broken
Posted: Mon Mar 13, 2017 8:43 am
by DridriLaBastos
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
Re: GCC is broken
Posted: Mon Mar 13, 2017 10:46 am
by DridriLaBastos
I built gcc with --with-as= and --with-ld= options, and all works well now, thank you all for the help