Error building cross compiler

Programming, for all ages and all languages.
Post Reply
bilsch01
Member
Member
Posts: 42
Joined: Sat Dec 19, 2015 10:48 am

Error building cross compiler

Post 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.
User avatar
xenos
Member
Member
Posts: 1118
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Error building cross compiler

Post by xenos »

What is your target triplet?
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
bilsch01
Member
Member
Posts: 42
Joined: Sat Dec 19, 2015 10:48 am

Re: Error building cross compiler

Post 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.
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Error building cross compiler

Post by iansjack »

What have you set the environment variable $TARGET to? What about $PREFIX?
bilsch01
Member
Member
Posts: 42
Joined: Sat Dec 19, 2015 10:48 am

Re: Error building cross compiler

Post 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"
yr
Member
Member
Posts: 31
Joined: Sat Mar 28, 2015 12:50 pm

Re: Error building cross compiler

Post 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.
bilsch01
Member
Member
Posts: 42
Joined: Sat Dec 19, 2015 10:48 am

Re: Error building cross compiler

Post 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.
Post Reply