Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
{PHP 4.4.9 --Emerge} C++ compiler cannot create executables
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
yodi
Tux's lil' helper
Tux's lil' helper


Joined: 14 May 2004
Posts: 88
Location: Liverpool, England

PostPosted: Wed Nov 17, 2004 2:53 pm    Post subject: {PHP 4.4.9 --Emerge} C++ compiler cannot create executables Reply with quote

Hey there, I'm having a few problems installing PHP, never had this one before...

The error that occurs is
Code:
 checking whether the C++ compiler (g++ -O2 -march=athlon-xp -fomit-frame-pointer -L/usr/lib -ldb-4.1  -L/usr/X11R6/lib -ltiff -L/usr/lib -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib -Wl,-rpath,/opt/sun-jdk-1.5.0/jre/lib/i386/server -L/opt/sun-jdk-1.5.0/jre/lib/i386/server -Wl,-rpath,/opt/sun-jdk-1.5.0/jre/lib/i386/native_threads -L/opt/sun-jdk-1.5.0/jre/lib/i386/native_threads -Wl,-rpath,/opt/sun-jdk-1.5.0/jre/lib/i386 -L/opt/sun-jdk-1.5.0/jre/lib/i386 -Wl,-rpath,/usr/qt/3/lib -L/usr/qt/3/lib) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.

!!! ERROR: dev-php/php-4.3.9 failed.
!!! Function econf, Line 449, Exitcode 1
!!! econf failed
 


Searching the forum points to my compile flags but as you can see from below :

Code:
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"


they seem fine and ever other package has compiled fine.

The only odd thing in the error message is the use of Sun Java 1.5.0 but this is down to the fact that I need to use the latest version for my development work so it's just about one of the only packages compiled with ACCECPT_KEYWORDS set.

My processor is a Athlon xp so that can't be it, I have no knowledge of any memeory trouble on my computer as things seem stable enough and the computer runs fine (apart from this odd compile error).

Any run into this or think they know of a solution?
_________________
All Servers :: Offline [no connection]
Gallery :: Visit Here
Homepage :: Visit Here
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Wed Nov 17, 2004 11:14 pm    Post subject: Reply with quote

It's not actually using sun-java it seems to be just pulling in the path elements containing this.

I presume this corresponds with echo $PATH on your machine.

As a hack test I just cut & pasted from your post to my command line and got this.

Code:
g++ -O2 -march=athlon-xp -fomit-frame-pointer -L/usr/lib -ldb-4.1  -L/usr/X11R6/lib -ltiff -L/usr/lib -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib -Wl,-rpath,/opt/sun-jdk-1.5.0/jre/lib/i386/server -L/opt/sun-jdk-1.5.0/jre/lib/i386/server -Wl,-rpath,/opt/sun-jdk-1.5.0/jre/lib/i386/native_threads -L/opt/sun-jdk-1.5.0/jre/lib/i386/native_threads -Wl,-rpath,/opt/sun-jdk-1.5.0/jre/lib/i386 -L/opt/sun-jdk-1.5.0/jre/lib/i386 -Wl,-rpath,/usr/qt/3/lib -L/usr/qt/3/lib

/usr/lib/gcc/i686-pc-linux-gnu/3.4.2/../../../crt1.o(.text+0x18): In function `_start':
: undefined reference to `main'
collect2: ld returned 1 exit status



Do you see different?

8)
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
yodi
Tux's lil' helper
Tux's lil' helper


Joined: 14 May 2004
Posts: 88
Location: Liverpool, England

PostPosted: Wed Nov 17, 2004 11:47 pm    Post subject: Reply with quote

Firstly thank you for your reply,

I get exactly the same output from running the output from the error message, just for refence I have copied and pasted that output from my shell ::
Code:

g++ -O2 -march=athlon-xp -fomit-frame-pointer -L/usr/lib -ldb-4.1  -L/usr/X11R6/lib -ltiff -L/usr/lib -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib -Wl,-rpath,/opt/sun-jdk-1.5.0/jre/lib/i386/server -L/opt/sun-jdk-1.5.0/jre/lib/i386/server -Wl,-rpath,/opt/sun-jdk-1.5.0/jre/lib/i386/native_threads -L/opt/sun-jdk-1.5.0/jre/lib/i386/native_threads -Wl,-rpath,/opt/sun-jdk-1.5.0/jre/lib/i386 -L/opt/sun-jdk-1.5.0/jre/lib/i386 -Wl,-rpath,/usr/qt/3/lib -L/usr/qt/3/lib
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/../../../crt1.o(.text+0x18): In function `_start':
: undefined reference to `main'
collect2: ld returned 1 exit status


I have also added the following to /etc/portage/package.keywords if this helps ::

Code:
x11-base/xorg-x11 ~x86
sys-devel/gcc ~x86
sys-libs/glibc ~x86
net-www/mozilla-firefox ~x86
media-video/nvidia-glx ~x86
media-video/nvidia-kernel ~x86
media-video/xine-ui ~x86
media-video/mplayer ~x86
dev-java/sun-jdk ~x86
sys-libs/libstdc++ ~x86
sys-libs/libstdc++-v3 ~x86
media-libs/win32codecs ~x86


They are just about the only things that I would really think I require using untested (unstable) ebuilds of.
[/code]
_________________
All Servers :: Offline [no connection]
Gallery :: Visit Here
Homepage :: Visit Here
Back to top
View user's profile Send private message
cypherscout
n00b
n00b


Joined: 25 Aug 2004
Posts: 13

PostPosted: Tue Dec 14, 2004 5:33 pm    Post subject: Reply with quote

I too am having the same problem with emerging php.
I had it installed and working fine and then I unmerged x11 because for whatever reason I had forgotten to specify a USE flag of "-X" and it compiled and installed X11 as well. This caused a problem and in following the forums, I tried unmerging and emerging php. Unfortunatly I have been recieving the same C++ error every time since then.
Code:

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


Per another post I remerged glibc. I have not seen any success. Perhaps someone with a greater understanding could shed some light on this issue?
Back to top
View user's profile Send private message
gentsquash
l33t
l33t


Joined: 03 Nov 2004
Posts: 753
Location: Still a Gentoo beginner.

PostPosted: Thu Jan 27, 2005 9:52 pm    Post subject: Reply with quote

Does

Code:
gcc --version


show 3.3.4 or 3.3.5 or something else? If the pkgs you compile
are looking for a different version of `gcc', then perhaps these
threads

https://forums.gentoo.org/viewtopic.php?t=282418
https://forums.gentoo.org/viewtopic.php?t=285487
https://forums.gentoo.org/viewtopic.php?t=278673


are relevant?
_________________
Your thread resolved? Putting [SOLVED] in its title helps all Gentooers. (Button "edit" , first post)
Prof. Jonathan LF King, Mathematics dept., University of Florida
Back to top
View user's profile Send private message
msulli1355
Apprentice
Apprentice


Joined: 24 Nov 2005
Posts: 179
Location: OKlahoma, USA

PostPosted: Thu Nov 24, 2005 5:11 pm    Post subject: C compiler cannot create executables Reply with quote

I tried to create a cross-compilation environment last night for an i586 on my i686 box and now every time I try to emerge anything I get this errror:

error: C compiler cannot create executables

It's effecting the system even outside the cross-compilation environment. Here's some info:

/etc/make.conf:

# These settings were set by the catalyst build script that automatically built this stage
# Please consult /etc/make.conf.example for a more detailed example
CFLAGS="-O2 -march=i686 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
USE="candy apache2 oss apm alsa arts avi berkdb bitmap-fonts cdr crypt cups doc encode
fortran f77 foomaticdb gdbm gif gpm gnome gstreamer gtk gtk2 imlib jpeg kde libg++
libwww mad mbox mikmod motif mpeg ncurses nls oggvorbis opengl pam pdflib png ppds
python qt quicktime readline samba sasl sdl threads nntp spell ssl svga tcltk tcpd
truetype usb X xml xml2 xmms xv zlib x86 imap offensive java mysql examples mmx mmx2
perl divx4linux real mmxext audiofile nas snmp hal unicode guile slp tidy dvd dvdr
dvdread flash glut mono new-login browserplugin nsplugin bzip2 win32codecs v4l v4l2 ruby sql lirc mythtv dvb ffmpeg userlocales php"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo"
FEATURES="keepwork"
ALSA_CARDS="hda-intel"

camille ~ # gcc --version
gcc (GCC) 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

camille ~ # gcc-config -l
[1] i686-pc-linux-gnu-3.3.6 *
[2] i686-pc-linux-gnu-3.3.6-hardened
[3] i686-pc-linux-gnu-3.3.6-hardenednopie
[4] i686-pc-linux-gnu-3.3.6-hardenednopiessp
[5] i686-pc-linux-gnu-3.3.6-hardenednossp

I'll be happy to provide any other information you think is necessary to solve my problem....
-Michael Sullivan
Back to top
View user's profile Send private message
msulli1355
Apprentice
Apprentice


Joined: 24 Nov 2005
Posts: 179
Location: OKlahoma, USA

PostPosted: Thu Nov 24, 2005 5:19 pm    Post subject: Re: C compiler cannot create executables Reply with quote

msulli1355 wrote:
I tried to create a cross-compilation environment last night for an i586 on my i686 box and now every time I try to emerge anything I get this errror:

error: C compiler cannot create executables

It's effecting the system even outside the cross-compilation environment. Here's some info:

/etc/make.conf:

# These settings were set by the catalyst build script that automatically built this stage
# Please consult /etc/make.conf.example for a more detailed example
CFLAGS="-O2 -march=i686 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
USE="candy apache2 oss apm alsa arts avi berkdb bitmap-fonts cdr crypt cups doc encode
fortran f77 foomaticdb gdbm gif gpm gnome gstreamer gtk gtk2 imlib jpeg kde libg++
libwww mad mbox mikmod motif mpeg ncurses nls oggvorbis opengl pam pdflib png ppds
python qt quicktime readline samba sasl sdl threads nntp spell ssl svga tcltk tcpd
truetype usb X xml xml2 xmms xv zlib x86 imap offensive java mysql examples mmx mmx2
perl divx4linux real mmxext audiofile nas snmp hal unicode guile slp tidy dvd dvdr
dvdread flash glut mono new-login browserplugin nsplugin bzip2 win32codecs v4l v4l2 ruby sql lirc mythtv dvb ffmpeg userlocales php"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo"
FEATURES="keepwork"
ALSA_CARDS="hda-intel"

camille ~ # gcc --version
gcc (GCC) 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

camille ~ # gcc-config -l
[1] i686-pc-linux-gnu-3.3.6 *
[2] i686-pc-linux-gnu-3.3.6-hardened
[3] i686-pc-linux-gnu-3.3.6-hardenednopie
[4] i686-pc-linux-gnu-3.3.6-hardenednopiessp
[5] i686-pc-linux-gnu-3.3.6-hardenednossp

I'll be happy to provide any other information you think is necessary to solve my problem....
-Michael Sullivan


Some extra information I forgot to add:

I sent a question about this error into the gentoo-user list last night and got a reply that suggested that I create a simple C program and try to compile it. I created a simple Hello World program in C and tried to compile it:

camille ~ # gcc hello.c gcc: installation problem, cannot exec `as': No such file or directory

I did "equery belongs as":

camille ~ # equery belongs as
[ Searching for file(s) as in *... ]
dev-java/xerces-2.6.2-r2 (/usr/share/doc/xerces-2.6.2-r2/html/javadocs/dom3-api/org/apache/xerces/dom3/as)
dev-libs/atk-1.10.1 (/usr/share/locale/as)
gnome-base/gail-1.8.4 (/usr/share/locale/as)
kde-base/kdebase-3.4.1-r1 (/usr/kde/3.4/share/locale/l10n/as)
sys-devel/binutils-2.16.1 (/usr/i686-pc-linux-gnu/binutils-bin/2.16.1/as)
cross-i586-pc-linux-gnu/binutils-2.16.1 (/usr/i586-pc-linux-gnu/binutils-bin/2.16.1/as)

I suspect that the "as" it wants it the binutils one:

camille ~ # /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/as
-bash: /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/as: No such file or directory

However I can't rebuild binutils because gcc isn't working. Is there a way to rebuild binutils without using gcc?
Back to top
View user's profile Send private message
jmp_
Apprentice
Apprentice


Joined: 02 Oct 2005
Posts: 294
Location: BCN / Catalonia (Spain)

PostPosted: Sat Nov 26, 2005 12:47 am    Post subject: Reply with quote

I think the problem is binutils, an incorrect version is referenced, you should create or fix the symlinks... try to emerge a new binutils version if possible.

Look at this, I solved this problem before:
https://forums.gentoo.org/viewtopic-t-387201-highlight-.html (spanish sorry).
https://forums.gentoo.org/viewtopic-p-2769680-highlight-.html#2769680 (english).

Anyway commands are international :P

Code:

Creo que ya está solucionado.

He estado mirando /etc/env.d y la jerarquía de /usr/lib && /usr/i686-bla-bla y he visto que al parecer era algo relacionado con binutils.
Código:

$ binutils-config -l
 [1] i686-pc-linux-gnu-2.16.1

Esa era la versión actual, pero al parecer había varias menciones a "2.16" de manera que he creado un enlace simbólico en:
Código:

$ pwd
/usr/i686-pc-linux-gnu/binutils-bin


Corrigiendo el problema con el número de versión (ln -s 2.16.1 2.16):
Código:

lrwxrwxrwx  1 root root   6 Oct  2 22:11 2.16 -> 2.16.1
drwxr-xr-x  2 root root 392 Jun 13 11:11 2.16.1


greetings.
Back to top
View user's profile Send private message
pigge2
n00b
n00b


Joined: 22 Aug 2009
Posts: 1
Location: Europe/Stockholm

PostPosted: Sat Aug 22, 2009 11:40 pm    Post subject: Binutils Reply with quote

Yeah, it was binutils that had missed to update some symlinks for me as well, on two installs it did the same thing

links I've updated manually:

/usr/powerpc-unknown-linux-gnu/bin/addr2line -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/addr2line
/usr/powerpc-unknown-linux-gnu/bin/ar -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/ar
/usr/powerpc-unknown-linux-gnu/bin/as -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/as
/usr/powerpc-unknown-linux-gnu/bin/c++filt -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/c++filt
/usr/powerpc-unknown-linux-gnu/bin/embedspu -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/embedspu
/usr/powerpc-unknown-linux-gnu/bin/gprof -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/gprof
/usr/powerpc-unknown-linux-gnu/bin/ld -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/ld
/usr/powerpc-unknown-linux-gnu/bin/nm -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/nm
/usr/powerpc-unknown-linux-gnu/bin/objcopy -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/objcopy
/usr/powerpc-unknown-linux-gnu/bin/objdump -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/objdump
/usr/powerpc-unknown-linux-gnu/bin/ranlib -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/ranlib
/usr/powerpc-unknown-linux-gnu/bin/readelf -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/readelf
/usr/powerpc-unknown-linux-gnu/bin/size -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/size
/usr/powerpc-unknown-linux-gnu/bin/strings -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/strings
/usr/powerpc-unknown-linux-gnu/bin/strip -> /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18/strip
/usr/powerpc-unknown-linux-gnu/lib/libopcodes.a -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/libopcodes.a
/usr/powerpc-unknown-linux-gnu/lib/libopcodes.so -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/libopcodes.so
/usr/powerpc-unknown-linux-gnu/lib/libopcodes-2.18.so -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/libopcodes-2.18.so
/usr/powerpc-unknown-linux-gnu/lib/libopcodes.la -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/libopcodes.la
/usr/powerpc-unknown-linux-gnu/lib/libbfd.la -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/libbfd.la
/usr/powerpc-unknown-linux-gnu/lib/ldscripts -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/ldscripts
/usr/powerpc-unknown-linux-gnu/lib/libiberty.a -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/libiberty.a
/usr/powerpc-unknown-linux-gnu/lib/libbfd.a -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/libbfd.a
/usr/powerpc-unknown-linux-gnu/lib/libbfd.so -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/libbfd.so
/usr/powerpc-unknown-linux-gnu/lib/libbfd-2.18.so -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/libbfd-2.18.so
/usr/include/bfd.h -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/include/bfd.h
/usr/include/bfdlink.h -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/include/bfdlink.h
/usr/include/dis-asm.h -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/include/dis-asm.h
/usr/include/libiberty.h -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/include/libiberty.h
/usr/include/symcat.h -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/include/symcat.h
/usr/include/ansidecl.h -> /usr/lib/binutils/powerpc-unknown-linux-gnu/2.18/include/ansidecl.h

where (as you can see) pointing to /usr/powerpc-unknown-linux-gnu/binutils-bin/2.18 and i had to point them to /usr/powerpc-unknown-linux-gnu/binutils-bin/2.19.1

on another note, all of awk, gawk, nawk igawk and pgawk links was also pointing to the wrong version for me
and some other files got removed (/sbin/functions.sh amongst others)

and all problems happened DURING binutils emerge...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum