Skip to contentSkip to conversation

C compiler cannot create executables

DISCUSSION Claudiu mdc 2 participants 3 messages Dec 17, 2008 – Dec 18, 2008

lore
Share & tools
lore
#0 lore raw

hi, I am trying to build bootstrap-image and I have this error when building libtool-cross:

| checking for i686-linux-gcc... i686-linux-gcc-4.3.1 -mcpu=pentiumpro
| checking for C compiler default output file name...
| configure: error: C compiler cannot create executables
| See `config.log' for more details.

I've built a custom toolchain which is in $PATH.
~/oe$ i686-linux<TAB><TAB> gives this output:
i686-linux-addr2line i686-linux-gccbug i686-linux-ranlib

i686-linux-ar                   i686-linux-gcov                     i686-linux-readelf
i686-linux-as                   i686-linux-gprof                    i686-linux-real-ld

i686-linux-c++filt i686-linux-i686-linux-gcc i686-linux-size
i686-linux-cpp i686-linux-ld i686-linux-strings
i686-linux-g++ i686-linux-nm i686-linux-strip
i686-linux-gcc i686-linux-objcopy
i686-linux-gcc-4.3.1 i686-linux-objdump

I've also tested the toolchain with hello.c program:
# ----------------------
#include<stdio.h>

int main(void)

{
    printf("Hello World!\n");
    return 0;
}

# ----------------------
~/tmpHello$ i686-linux-gcc-4.3.1 hello.c -o hello
and it works.

so, I don't understand why compile task fails with this error.

Some bits abountmy configuration:
I use org.openembedded.stable branch

Some lines from my local.conf:
MACHINE = "i686-generic"
TARGET_OS = "linux"
DISTRO = "unmaintained/generic"

ASSUME_PROVIDED += "virtual/${TARGET_PREFIX}gcc"
ASSUME_PROVIDED += "virtual/${TARGET_PREFIX}g++"

PREFERRED_PROVIDERS = "virtual/qte:qte virtual/libqpe:libqpe-opie" PREFERRED_PROVIDERS += " virtual/libsdl:libsdl-x11" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}gcc:gcc-cross" PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross"

###### stuff I added

TARGET_LDFLAGS_prepend = ", -L/home/claudiu/oe/myToolchain/cross/lib \
-Wl,-rpath-link,/home/claudiu/oe/myToolchain/cross/lib -Wl,-rpath-link "

TARGET_CPPFLAGS_append = ", -I/home/claudiu/oe/myToolchain/cross/include "

export CC="${CCACHE}i686-linux-gcc-4.3.1 ${HOST_CC_ARCH}" export CXX="${CCACHE}i686-linux-g++ ${HOST_CC_ARCH}" export CPP="i686-linux-gcc-4.3.1 -E"
export LD="i686-linux-ld"
export AR="i686-linux-ar"
export AS="i686-linux-as"
export RANLIB="i686-linux-ranlib"
export STRIP="i686-linux-strip"

Someone can help me?

From [email protected] Wed Dec 17 17:04:34 2008
Received: from [80.91.229.2] (helo

#1 lore raw
Quoted 5 lines · Claudiu mdc

hi, I am trying to build bootstrap-image and I have this error when building libtool-cross:

| checking for i686-linux-gcc... i686-linux-gcc-4.3.1 -mcpu=pentiumpro
| checking for C compiler default output file name...
| configure: error: C compiler cannot create executables
| See `config.log' for more details.

First: what does config.log say? (it's somewhere in work/i686*/libtool-cross/*)

Quoted 6 lines

I use org.openembedded.stable branch

Some lines from my local.conf:
MACHINE = "i686-generic"
TARGET_OS = "linux"
DISTRO = "unmaintained/generic"

Secondly, you can't build for x86 using the generic distro because of namespace clashes. Try using angstrom-2007.1.

regards,

Koen

author
#2 lore raw
Quoted 3 lines · Koen Kooi <k.kooi <at> student.utwente.nl> writes:
Quoted 1 line · Claudiu mdc

hi, I am trying to build bootstrap-image and I have this error when building

libtool-cross:

Quoted 15 lines
Quoted 4 lines
| checking for i686-linux-gcc... i686-linux-gcc-4.3.1 -mcpu=pentiumpro
| checking for C compiler default output file name...
| configure: error: C compiler cannot create executables
| See `config.log' for more details.

First: what does config.log say? (it's somewhere in work/i686*/libtool-cross/*)

Quoted 6 lines

I use org.openembedded.stable branch

Some lines from my local.conf:
MACHINE = "i686-generic"
TARGET_OS = "linux"
DISTRO = "unmaintained/generic"

Quoted 7 lines

Secondly, you can't build for x86 using the generic distro because of namespace clashes. Try using angstrom-2007.1.

regards,

Koen

Thank you Koen for the answer. I followed your istructions,

I tryed to use "angstrom-2007.1" DISTRO as you told me, but there are 2 different behaviours depending of kind of building:

Quoted 1 line
Quoted 1 line
Quoted 1 line

if I build a SINGLE PACKAGE (-b option)

for example:
~/oe$ bitbake -b myPackages/myhelloworld/myhelloworld_0.1.bb -DD

variables are exported CORRECTLY (with i686-linux- prefix) some examples:
+ export LD=i686-linux-ld
+ LD=i686-linux-ld

+ export 'CC=i686-linux-gcc-4.3.1 -mcpu=pentiumpro'
+ CC='i686-linux-gcc-4.3.1 -mcpu=pentiumpro'

+ export STRIP=i686-linux-strip
+ STRIP=i686-linux-strip

+ export RANLIB=i686-linux-ranlib
+ RANLIB=i686-linux-ranlib

these i686-linux-* are in ~/oe/myToolchain/cross/bin directory which is in my $PATH

but the build fails with: | i686-linux-gcc-4.3.1: Success
| + cd /home/claudiu/oe/oetmp/work/i686-angstrom-linux/myhelloworld-0.1-r0/ myhelloworld-0.1
| + do_compile
| + i686-linux-gcc-4.3.1 -mcpu=pentiumpro -isystem/home/claudiu/oe/oetmp/staging/i686-angstrom-linux/include, -I/home/claudiu/oe/myToolchain/cross/include -fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os , -L/home/claudiu/oe/myToolchain/cross/lib -Wl,-rpath-link,/home/claudiu/oe/myToolchain/cross/lib -Wl,-rpath-link -L/home/claudiu/oe/oetmp/staging/i686-angstrom-linux/lib -Wl,-rpath-link,/home/claudiu/oe/oetmp/staging/i686-angstrom-linux/lib -Wl,-O1 /home/claudiu/oe/oetmp/work/i686-angstrom-linux/myhelloworld-0.1-r0/ myhelloworld.c -o myhelloworld
| i686-linux-gcc-4.3.1: Success
NOTE: Task failed:
/home/claudiu/oe/oetmp/work/i686-angstrom-linux/myhelloworld-0.1-r0/temp/ log.do_compile.18268
NOTE: package myhelloworld-0.1-r0: task do_compile: failed

Quoted 1 line
Quoted 1 line
Quoted 1 line

if I build bootstrap-image or other package in the metadata

WITHOUT -b option

for example: ~/oe$ bitbake bootstrap-image -DD

variables are exported WRONGLY (WITHOUT i686-linux- prefix, even if in local.conf I specified the prefix, see the first post), because I want to use my toolchain. Some examples:
+ export LD=ld
+ LD=ld

+ export CC=gcc
+ CC=gcc

+ export RANLIB=ranlib
+ RANLIB=ranlib

+ export CXX=g++
+ CXX=g++

the build fails on "shasum-native" with: | collect2: cannot find 'ld'

| + export BUILD_STRIP=strip
| + BUILD_STRIP=strip
| + cd /home/claudiu/oe/oetmp/work/i686-linux/shasum-native-1.0-r1
| + do_compile
| + gcc -isystem/home/claudiu/oe/oetmp/staging/i686-linux/include -Os

-isystem/home/claudiu/oe/oetmp/staging/i686-linux/include -o oe_sha256sum main.c sha256.c
| collect2: cannot find 'ld'
NOTE: Task failed:
/home/claudiu/oe/oetmp/work/i686-linux/shasum-native-1.0-r1/temp/ log.do_compile.18246
NOTE: package shasum-native-1.0-r1: task do_compile: failed

Otherwise, if I still use "generic" DISTRO, I have the error specified in the first post.
The config.log (placed in :
oe/oetmp/work/i686-linux/libtool-cross-1.5.10-r9/temp/log.do_configure.5538) says the same things as above in the first post. It ends with these lines:
...
configure: loading site script /home/claudiu/oe/stuff/org.openembedded.stable/site/endian-little
configure: loading site script /home/claudiu/oe/stuff/org.openembedded.stable/site/common-glibc
configure: loading site script /home/claudiu/oe/stuff/org.openembedded.stable/site/ix86-common
configure: loading site script /home/claudiu/oe/stuff/org.openembedded.stable/site/common
configure: loading site script /home/claudiu/oe/stuff/org.openembedded.stable/site/common checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for i686-linux-gcc... i686-linux-gcc-4.3.1 -mcpu=pentiumpro checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
FATAL: oe_runconf failed