Page 1 of 1

Error building cross compiler

Posted: Fri Jan 08, 2016 1:28 am
by bilsch01
I'm using Ubuntu 14.04 on a 32-bit pc. I just compiled gcc 4.9.3 and binutils 2.25, per OSDev instructions. I have tried to compile a cross compiler but I am getting an error I can't resolve:

configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.

I read everything I could find about this error which mostly are written by people trying to build a cross compiler. The articles go back several years with different comments and suggestions on how to fix the problem. I've tried several of the recomendations such as editing lines in files 'libstdc++v3/acinclude.m4' and 'configure.ac', or adding other options after the 'configure' command.

Per OSDev I am using the command
../gcc-4.9.3/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers.

Does anyone here know how to resolve the error? I'can't go any further and I've run out of clues.

TIA. Bill S.

Re: Error building cross compiler

Posted: Fri Jan 08, 2016 1:32 am
by xenos
What is your target triplet?

Re: Error building cross compiler

Posted: Fri Jan 08, 2016 1:56 am
by bilsch01
XenOS wrote:What is your target triplet?
I'm not sure what 'target triplet' means. i686, ELF format. I will be developing for 32-bit pc. I am running Ubuntu 14.04.

Re: Error building cross compiler

Posted: Fri Jan 08, 2016 2:32 am
by iansjack
What have you set the environment variable $TARGET to? What about $PREFIX?

Re: Error building cross compiler

Posted: Fri Jan 08, 2016 12:47 pm
by bilsch01
iansjack wrote:What have you set the environment variable $TARGET to? What about $PREFIX?
export PREFIX="$HOME/cross"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"

Re: Error building cross compiler

Posted: Fri Jan 08, 2016 5:42 pm
by yr
I'm assuming you just typed "make" instead of "make all-gcc" followed by "make all-target-libgcc".

Just typing "make" tries to build libstdc++ as well, which can't be done in a freestanding configuration. Please read the instructions here.

Re: Error building cross compiler

Posted: Sat Jan 09, 2016 4:38 am
by bilsch01
yr wrote:I'm assuming you just typed "make" instead of "make all-gcc" followed by "make all-target-libgcc".

Just typing "make" tries to build libstdc++ as well, which can't be done in a freestanding configuration. Please read the instructions here.
I was doing:
make,
make all-gcc,
make all-target-libgcc.

Wrong. Thanks for your help.