# configuration problem: C compiler cannot create executables

## xlyz

postato anche su Portage & Programming

https://forums.gentoo.org/viewtopic.php?t=71951&highlight=

vediamo se qui siete + veloci  :Wink: 

----------

## paolo

Boh. Nessuna idea.

Io quell'errore lo vedo quando scrivo male le CFLAGS e quindi non compila una cippa  :Smile: 

(tipo ieri ho scritto -mcpu=686 senza la i)

ByEZz,

Paolo

----------

## cerri

Dai un'occhiata al file config.log.

----------

## cerri

L'ho fatto io.

```
configure:751: checking whether the C compiler (gcc -march=pentium4 -O3 -pipe -Wall -Wmissing-prototypes  -I/usr/X11R6/include -D_FILE_OFFSET_BITS=64 `pkg-config --cflags gtk+-2.0 libxml-2.0` ) works

configure:767: gcc -o conftest -march=pentium4 -O3 -pipe -Wall -Wmissing-prototypes  -I/usr/X11R6/include -D_FILE_OFFSET_BITS=64 `pkg-config --cflags gtk+-2.0 libxml-2.0`   conftest.c  1>&5

gcc: `pkg-config: No such file or directory

gcc: gtk+-2.0: No such file or directory

gcc: libxml-2.0`: No such file or directory

cc1: unrecognized option `-fcflags'

```

Non puoi usare pkg-config tra apici perche' quel comando viene richiamato da questa stringa:

```
configure:ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
```

quindi le tue apici interrompono le apici del configure, generando l'errore.

Devi sostituire pkg-config direttamente con l'output.

----------

## xlyz

guarda che veramente fa tutto l'ebuild di rox (emerge rox)

btw chroottando da un livecd sono riuscito a compilarlo

anche se vorrei capire dov'è il problema per evitarlo

il comando con cui pkg-config viene chiamato dov'è?

----------

## cerri

rox si compila con

```
ROX-Filer/AppRun --compile
```

e infatti tale comando è anche dentro l'ebuild.

Fatto a mano questo e' l'output:

```
cerrito ROX-Filer # ./AppRun --compile

Compiling /root/rox-2.0.0/ROX-Filer... please wait...

creating cache ./config.cache

checking that pkg-config runs... yes

checking that gtk+-2.0 (version >= 2.0.1) is installed... yes

checking that glib-2.0 (version >= 2.0.3) is installed... yes

checking that libxml-2.0 (version >= 2.0.0) is installed... yes

checking if pango (version >= 1.1.2) is installed... yes; enabling better wrapping

checking for gcc... gcc

checking whether the C compiler (gcc  ) works... yes

```

Fatto con l'ebuild questo e' l'output:

```
Compiling /root/rox-2.0.0/ROX-Filer... please wait...

creating cache ./config.cache 

checking that pkg-config runs... yes

checking that gtk+-2.0 (version >= 2.0.1) is installed... yes

checking that glib-2.0 (version >= 2.0.3) is installed... yes

checking that libxml-2.0 (version >= 2.0.0) is installed... yes

checking if pango (version >= 1.1.2) is installed... yes; enabling better wrapping

checking for gcc... gcc

checking whether the C compiler (gcc -march=pentium3 -mfpmath=sse -O2 -pipe -fomit-frame-pointer -mmmx -msse -falign-functions=4 -fforce-addr ) works... yes
```

Sei sicuro di non avere pkg-config in /etc/make.conf? Mi sembra strano, ma da me il configure si e' preso la stringa esatta delle mie CFLAGS, quindi posso pensare che abbia fatto altrettanto da te. Il pkg-config viene usato in genere durante il make, non durante il configure (non ha senso, serve per avere i corretti include, ma il configure deve solo testare se il gcc funziona).

----------

## xlyz

```
 grep pkg /etc/make.conf 

#     with '--buildpkg' or '-b' while emerging a package. This can get

#     developers as well. 'buildpkg' is an always-on setting for the emerge

#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork"
```

direi di no

----------

## cerri

```
# echo $CFLAGS

# echo $LDFLAGS
```

dalla shell dalla quale lanci emerge rox?

----------

## xlyz

cmq a mano compilava. è con l'emerge che si incasina

----------

## xlyz

 *cerri wrote:*   

> 
> 
> ```
> # echo $CFLAGS
> 
> ...

 

restituiscono una riga vuota   :Confused: 

cmq questo è quello che da emerge info

```
Portage 2.0.48-r5 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1)

=================================================================

System uname: 2.6.0-test2 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz

GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http:

//gentoo.oregonstate.edu/ http://www.ibiblio.org/pub/Linux/distributions/gentoo"

CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/confi

g /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb"

CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"

PORTDIR="/usr/portage"

DISTDIR="/usr/portage/distfiles"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR_OVERLAY=""

USE="x86 oss apm avi gpm jpeg libwww mad gdbm perl python X gtk -gnome alsa -3dn

ow -arts -berkdb crypt cups dvd encode foomaticdb gif gtk2 imlib java -kde -libg

++ -mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl pam pdflib png -q

t -quicktime -readline sdl -slang -spell sse ssl svga tcpd truetype usb xml2 xmm

s xv zlib"

COMPILER="gcc3"

CHOST="i686-pc-linux-gnu"

CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays -f

force-addr  -falign-functions=4"

CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays 

-fforce-addr  -falign-functions=4"

ACCEPT_KEYWORDS="x86"

MAKEOPTS="-j2"

AUTOCLEAN="yes"

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

FEATURES="sandbox ccache"

```

----------

## cerri

Ho provato con le tue USE, ma non ho problemi.

Qual'e' l'output di

```
# emerge -d rox
```

?

----------

## xlyz

```
emerge rox -d

Calculating dependencies  

Parent:    None

Depstring: app-misc/rox

Candidates: ['app-misc/rox']

ebuild: app-misc/rox-2.0.0

\

Parent:    ebuild / app-misc/rox-2.0.0 merge

Depstring: >=x11-libs/gtk+-2.0.5 >=dev-libs/glib-2.0.4 >=dev-libs/libxml2-2.4.23 >=x11-misc/shared-mime-info-0.9 >=x11-libs/gtk+-2.0.5 >=dev-libs/glib-2.0.4 >=dev-libs/libxml2-2.4.23 >=x11-misc/shared-mime-info-0.9

Candidates: []

Exiting... ebuild / app-misc/rox-2.0.0 merge

Exiting... None

 ...done!

>>> emerge (1 of 1) app-misc/rox-2.0.0 to /

+ /usr/sbin/ebuild.sh clean

+ dyn_clean

+ rm -rf /var/tmp/portage/rox-2.0.0/image

+ rm -rf /var/tmp/portage/rox-2.0.0/build-info

+ has keeptemp sandbox ccache

+ local x

+ local me

+ me=keeptemp

+ shift

+ '[' sandbox == keeptemp ']'

+ '[' ccache == keeptemp ']'

+ return 1

+ rm -rf /var/tmp/portage/rox-2.0.0/temp/eclass-debug.log /var/tmp/portage/rox-2.0.0/temp/environment

+ has keepwork sandbox ccache

+ local x

+ local me

+ me=keepwork

+ shift

+ '[' sandbox == keepwork ']'

+ '[' ccache == keepwork ']'

+ return 1

+ rm -rf /var/tmp/portage/rox-2.0.0/.compiled

+ rm -rf /var/tmp/portage/rox-2.0.0/.unpacked

+ rm -rf /var/tmp/portage/rox-2.0.0/work

+ '[' -f /var/tmp/portage/rox-2.0.0/.unpacked ']'

+ true

+ set +x

>>> md5 src_uri ;-) rox-2.0.0.tgz

+ /usr/sbin/ebuild.sh setup

+ dyn_setup

+ '[' GNU == Linux ']'

+ pkg_setup

+ return

+ set +x

+ dyn_unpack

+ trap abort_unpack SIGINT SIGQUIT

+ local newstuff=no

+ '[' -e /var/tmp/portage/rox-2.0.0/work ']'

+ '[' -e /var/tmp/portage/rox-2.0.0/work ']'

+ install -m0700 -d /var/tmp/portage/rox-2.0.0/work

+ '[' -d /var/tmp/portage/rox-2.0.0/work ']'

+ cd /var/tmp/portage/rox-2.0.0/work

+ echo '>>> Unpacking source...'

>>> Unpacking source...

+ src_unpack

+ '[' rox-2.0.0.tgz '!=' '' ']'

+ unpack rox-2.0.0.tgz

+ local x

+ local y

+ local myfail

+ local tarvars

+ '[' GNU == BSD ']'

+ tarvars=--no-same-owner

+ myfail=failure unpacking rox-2.0.0.tgz

++ pwd

+ echo '>>> Unpacking rox-2.0.0.tgz to /var/tmp/portage/rox-2.0.0/work'

>>> Unpacking rox-2.0.0.tgz to /var/tmp/portage/rox-2.0.0/work

++ echo rox-2.0.0.tgz

++ sed 's:.*\.\(tar\)\.[a-zA-Z0-9]*:\1:'

+ y=rox-2.0.0.tgz

+ tar --no-same-owner -xzf /usr/portage/distfiles/rox-2.0.0.tgz

+ touch /var/tmp/portage/rox-2.0.0/.unpacked

+ echo '>>> Source unpacked.'

>>> Source unpacked.

+ cd /var/tmp/portage/rox-2.0.0

+ trap SIGINT SIGQUIT

+ set +x

+ dyn_compile

+ trap abort_compile SIGINT SIGQUIT

+ '[' '-march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr  -falign-functions=4' '!=' unset ']'

+ export CFLAGS

+ '[' '-march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr  -falign-functions=4' '!=' unset ']'

+ export CXXFLAGS

+ '[' unset '!=' unset ']'

+ '[' unset '!=' unset ']'

+ '[' unset '!=' unset ']'

+ '[' unset '!=' unset ']'

+ has noauto sandbox ccache

+ cd /var/tmp/portage/rox-2.0.0

+ '[' '!' -e build-info ']'

+ mkdir build-info

+ cp /usr/portage/app-misc/rox/rox-2.0.0.ebuild build-info/rox-2.0.0.ebuild

+ '[' /var/tmp/portage/rox-2.0.0/.compiled -nt /var/tmp/portage/rox-2.0.0/work ']'

+ '[' -d /var/tmp/portage/rox-2.0.0/work/rox-2.0.0 ']'

+ cd /var/tmp/portage/rox-2.0.0/work/rox-2.0.0

+ export S D

+ export PWORKDIR=/var/tmp/portage/rox-2.0.0/work

+ PWORKDIR=/var/tmp/portage/rox-2.0.0/work

+ src_compile

+ '[' -x ./configure ']'

+ cd /var/tmp/portage/rox-2.0.0

+ touch .compiled

+ cd build-info

+ echo ''

+ echo gcc

+ echo ''

+ echo '-march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr  -falign-functions=4'

+ echo i686-pc-linux-gnu

+ echo g++

+ echo '-march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr  -falign-functions=4'

+ echo '>=x11-libs/gtk+-2.0.5

        >=dev-libs/glib-2.0.4

        >=dev-libs/libxml2-2.4.23

        >=x11-misc/shared-mime-info-0.9 '

+ echo ''

+ echo GPL-2

+ echo app-misc

+ echo ''

+ echo rox-2.0.0

+ echo ''

+ echo '>=x11-libs/gtk+-2.0.5

        >=dev-libs/glib-2.0.4

        >=dev-libs/libxml2-2.4.23

        >=x11-misc/shared-mime-info-0.9 '

+ echo 0

+ echo 'x86 oss apm avi gpm jpeg libwww mad gdbm perl python X gtk -gnome alsa -3dnow -arts -berkdb crypt cups dvd encode foomaticdb gif gtk2 imlib java -kde -libg++ -mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl pam pdflib png -qt -quicktime -readline sdl -slang -spell sse ssl svga tcpd truetype usb xml2 xmms xv zlib'

+ set

+ bzip2 -9 -

+ cp /usr/portage/app-misc/rox/rox-2.0.0.ebuild rox-2.0.0.ebuild

+ has nostrip sandbox ccache

+ local x

+ local me

+ me=nostrip

+ shift

+ '[' sandbox == nostrip ']'

+ '[' ccache == nostrip ']'

+ return 1

+ trap SIGINT SIGQUIT

+ set +x

+ dyn_install

+ trap abort_install SIGINT SIGQUIT

+ rm -rf /var/tmp/portage/rox-2.0.0/image

+ mkdir /var/tmp/portage/rox-2.0.0/image

+ '[' -d /var/tmp/portage/rox-2.0.0/work/rox-2.0.0 ']'

+ cd /var/tmp/portage/rox-2.0.0/work/rox-2.0.0

+ echo

+ echo '>>> Install rox-2.0.0 into /var/tmp/portage/rox-2.0.0/image/ category app-misc'

>>> Install rox-2.0.0 into /var/tmp/portage/rox-2.0.0/image/ category app-misc

+ export S D

+ export PWORKDIR=/var/tmp/portage/rox-2.0.0/work

+ PWORKDIR=/var/tmp/portage/rox-2.0.0/work

+ src_install

+ cd /var/tmp/portage/rox-2.0.0/work/rox-2.0.0/Choices

+ dodir /usr/share/Choices

+ cp -rf MIME-icons/ /var/tmp/portage/rox-2.0.0/image//usr/share/Choices/

+ cp -rf MIME-types/ /var/tmp/portage/rox-2.0.0/image//usr/share/Choices/

+ cd /var/tmp/portage/rox-2.0.0/work/rox-2.0.0

+ doman rox.1

+ dodir /usr/bin

+ cp -rf ROX-Filer/ /var/tmp/portage/rox-2.0.0/image//usr/share/

+ /var/tmp/portage/rox-2.0.0/image//usr/share/ROX-Filer/AppRun --compile

Compiling /var/tmp/portage/rox-2.0.0/image/usr/share/ROX-Filer... please wait...

creating cache ./config.cache

checking that pkg-config runs... yes

checking that gtk+-2.0 (version >= 2.0.1) is installed... yes

checking that glib-2.0 (version >= 2.0.3) is installed... yes

checking that libxml-2.0 (version >= 2.0.0) is installed... yes

checking if pango (version >= 1.1.2) is installed... yes; enabling better wrapping

checking for gcc... gcc

checking whether the C compiler (gcc -march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr  -falign-functions=4 ) works... yes

checking whether the C compiler (gcc -march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr  -falign-functions=4 ) is a cross-compiler... no

checking whether we are using GNU C... yes

checking whether gcc accepts -g... yes

checking how to run the C preprocessor... gcc -E

checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include

checking for dnet_ntoa in -ldnet... no

checking for dnet_ntoa in -ldnet_stub... no

checking for gethostbyname... yes

checking for connect... yes

checking for remove... yes

checking for shmat... yes

checking for IceConnectionNumber in -lICE... yes

checking whether file -b works... yes

checking for large file support... yes

checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include

checking for dirent.h that defines DIR... yes

checking for opendir in -ldir... no

checking for ANSI C header files... yes

checking for sys/wait.h that is POSIX.1 compatible... yes

checking for fcntl.h... yes

checking for sys/time.h... yes

checking for unistd.h... yes

checking for mntent.h... yes

checking for sys/ucred.h... no

checking for sys/mntent.h... no

checking for working const... yes

checking for uid_t in sys/types.h... yes

checking for size_t... yes

checking for gethostname... yes

checking for unsetenv... yes

checking for mkdir... yes

checking for rmdir... yes

checking for strdup... yes

checking for strtol... yes

checking for getopt_long... yes

checking extracting version information... version 2.0.0

updating cache ./config.cache

creating ./config.status

creating Makefile

creating config.h

autoconf

./configure --with-platform="Linux-ix86" --enable-rox

loading cache ./config.cache

checking that pkg-config runs... yes

checking that gtk+-2.0 (version >= 2.0.1) is installed... yes

checking that glib-2.0 (version >= 2.0.3) is installed... yes

checking that libxml-2.0 (version >= 2.0.0) is installed... yes

checking if pango (version >= 1.1.2) is installed... yes; enabling better wrapping

checking for gcc... (cached) gcc

checking whether the C compiler (gcc  -march=pentium4 -O2 -pipe -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr  -falign-functions=4 -Wall -Wmissing-prototypes  -I/usr/X11R6/include -D_FILE_OFFSET_BITS=64 `pkg-config --cflags gtk+-2.0 libxml-2.0` ) works... no

configure: error: installation or configuration problem: C compiler cannot create executables.

make: *** [config.status] Error 1

Compile failed

Press Return...

```

----------

## cerri

Aggiungerei: l'emerge di rox si prende delle variabili a cavolo! Da dove prende quella riga di gcc? Hai settato CFLAGS in maniera totalmente diversa... puoi provare a emergere rox in un'altra shell?

----------

## xlyz

CFLAGS l'ho cambiato io un paio di ore fa  :Wink: 

cmq non funzionava prima e non funziona adesso

fermo restando che da livecd -> chroot -> env-update -> source /etc/profile ha funzionato

----------

## cerri

sto cercando di patchare il makefile. appena ci riesco posto la patch.

----------

## cerri

non ci sto riuscendo.

Cmq il problema e' che durante l'ebuild viene rifatto il configure dopo l'autoconf, la variabile LDFLAGS modificata con il pkg-config, il che genera l'errore per il motivo di cui sopra.

----------

## xlyz

sarà il caldo, ma non ho capito

soprattutto x' su alcuni sistemi funziona e su altri no?

----------

## cerri

Non riesco a capirlo. Ho capito solo da cosa e' generato l'errore, ma non il motivo  :Smile: 

----------

## darge0flex

Hi, I have the same problem, but my italian is very bad: do your guys have a   solution for the compiler problem?

THX

----------

## xlyz

according to Cerri configure runs twice, and this create the problem

in my case I was able to emerge it chrooting from a livecd 

do not ask me why, but it worked   :Wink: 

EDIT

posted on bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=26162

----------

## cerri

Forgotten: had you tried

```
USE="" emerge rox
```

???

----------

