configure: error: C compiler cannot create executables

Anything that pertains to Portage

Moderator: Moderators

Post Reply
Freier Radikaler
Simple Hen
Posts: 44
Joined: Tue Dec 03, 2013 16:12

configure: error: C compiler cannot create executables

Post by Freier Radikaler » Tue Oct 09, 2018 14:41

Hi,

I'm experiencing some problems with ./configure:
It always complains about "configure: error: C compiler cannot create executables"

I set the gcc version using eselect and gcc-config -f <version> && source /etc/profile

Code: Select all

[email protected] ~ $gcc-config -l
 [1] x86_64-pc-linux-gnu-4.7.3
 [2] x86_64-pc-linux-gnu-4.7.3-hardenednopie
 [3] x86_64-pc-linux-gnu-4.7.3-hardenednopiessp
 [4] x86_64-pc-linux-gnu-4.7.3-hardenednossp
 [5] x86_64-pc-linux-gnu-4.7.3-vanilla
 [6] x86_64-pc-linux-gnu-4.9.3
 [7] x86_64-pc-linux-gnu-4.9.3-hardenednopie
 [8] x86_64-pc-linux-gnu-4.9.3-hardenednopiessp
 [9] x86_64-pc-linux-gnu-4.9.3-hardenednossp
 [10] x86_64-pc-linux-gnu-4.9.3-vanilla
 [11] x86_64-pc-linux-gnu-5.4.0
 [12] x86_64-pc-linux-gnu-5.4.0-hardenednopie
 [13] x86_64-pc-linux-gnu-5.4.0-hardenednopiessp
 [14] x86_64-pc-linux-gnu-5.4.0-hardenednossp
 [15] x86_64-pc-linux-gnu-5.4.0-vanilla
 [16] x86_64-pc-linux-gnu-6.4.0 *
But it still doesn't work. This renders emerge pretty useless.
I need to compile own c/c++-software that isn't part of equo...

User avatar
sabayonino
Sagely Hen
Posts: 3290
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: configure: error: C compiler cannot create executables

Post by sabayonino » Tue Oct 09, 2018 18:26

Code: Select all

# equo i sys-devel/gcc
[Che Cos'è Il Calcolo Distribuito (BOINC)

BOINC ready ! Sabayon+BOINC = BILD ,my Sabayon spin :cyclops: - Ready to crunch for the Science everywhere :)

joost
Sagely Hen
Posts: 2717
Joined: Fri Nov 17, 2006 12:11
Location: The Netherlands
Contact:

Re: configure: error: C compiler cannot create executables

Post by joost » Tue Oct 09, 2018 18:50

...and install latest binutils from Entropy and remove all the old C++ v11 incompatible compilers. (all versions lower then 6)
Image
My blog | Twitter | Please support Sabayon: Image

Freier Radikaler
Simple Hen
Posts: 44
Joined: Tue Dec 03, 2013 16:12

Re: configure: error: C compiler cannot create executables

Post by Freier Radikaler » Wed Oct 10, 2018 14:06

I uninstalled all gcc versions except 6.4.0:

Code: Select all

eix -e gcc
[U] sys-devel/gcc
     Verfügbare Versionen:   
     (3.3.6) [M](~)3.3.6-r1^s [M](~)3.3.6-r2^s
     (3.4.6) [M]3.4.6-r2^s
     (4.0.4) [M]**4.0.4^s [M]**4.0.4-r1^s
     (4.1.2) [M]4.1.2^s [M](~)4.1.2-r1^s
     (4.2.4) [M](~)4.2.4-r1^s [M](~)4.2.4-r2^s
     (4.3.6) [M]4.3.6-r1^s [M](~)4.3.6-r2^s
     (4.4.7) [M]4.4.7^s [M](~)4.4.7-r1^s
     (4.5.4) [M]4.5.4^s [M](~)4.5.4-r1^s
     (4.6.4) [M]4.6.4^s [M](~)4.6.4-r1^s
     (4.7.4) [M]4.7.4-r1^s [M](~)4.7.4-r2^s
     (4.8.5) [M]4.8.5-r1^s [M](~)4.8.5-r2^s
     (4.9.4) [M]4.9.4^s
     (5.4.0) [M]5.4.0-r4^s [M](~)5.4.0-r5^s
     (6.4.0) 6.4.0-r1^s (~)6.4.0-r3^s (~)6.4.0-r4^s
     (7.3.0) 7.3.0-r3^s (~)7.3.0-r4^s (~)7.3.0-r5^s
     (8.2.0) (~)8.2.0-r2^s (~)8.2.0-r3^s
       {altivec awt boundschecking cilk +cxx d debug doc fixed-point +fortran gcj go graphite hardened jit libssp mpx mudflap multilib +nls nopie nossp +nptl objc objc++ objc-gc +openmp +pch pgo +pie regression-test +sanitize +ssp systemtap vanilla +vtv}
     Installierte Versionen: 6.4.0-r1(6.4.0)^s[?](23:52:32 27.03.2018)(cxx fortran go graphite hardened multilib nls nptl objc objc++ objc-gc openmp pch pie sanitize ssp vtv -altivec -awt -cilk -debug -doc -fixed-point -gcj -jit -libssp -mpx -pgo -regression-test -vanilla)
     Startseite:             https://gcc.gnu.org/
     Beschreibung:           The GNU Compiler Collection
However it looks like eselect still knows the old versions:

Code: Select all

eselect gcc list
 [1] x86_64-pc-linux-gnu-4.7.3
 [2] x86_64-pc-linux-gnu-4.7.3-hardenednopie
 [3] x86_64-pc-linux-gnu-4.7.3-hardenednopiessp
 [4] x86_64-pc-linux-gnu-4.7.3-hardenednossp
 [5] x86_64-pc-linux-gnu-4.7.3-vanilla
 [6] x86_64-pc-linux-gnu-4.9.3
 [7] x86_64-pc-linux-gnu-4.9.3-hardenednopie
 [8] x86_64-pc-linux-gnu-4.9.3-hardenednopiessp
 [9] x86_64-pc-linux-gnu-4.9.3-hardenednossp
 [10] x86_64-pc-linux-gnu-4.9.3-vanilla
 [11] x86_64-pc-linux-gnu-5.4.0
 [12] x86_64-pc-linux-gnu-5.4.0-hardenednopie
 [13] x86_64-pc-linux-gnu-5.4.0-hardenednopiessp
 [14] x86_64-pc-linux-gnu-5.4.0-hardenednossp
 [15] x86_64-pc-linux-gnu-5.4.0-vanilla
 [16] x86_64-pc-linux-gnu-6.4.0 *
 
But 6.4.0 is definately selected. However my problem still remains the same :-(.
Might it be that 6.4.0 is broken? It doesn't matter whether is use emerge that will invoke gcc at some point or I use the configure script of an tar-ball. Make always thinks that the gcc compiler isn't working :-(:

Code: Select all

checking for C compiler default output file name... 
configure: error: in `/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/build':
configure: error: C compiler cannot create executables
See `config.log' for more details.
 * ERROR: sys-devel/gcc-7.3.0-r3::gentoo failed (configure phase):
 *   failed to run configure
 * 
 * Call stack:
 *     ebuild.sh, line  124:  Called src_configure
 *   environment, line 3434:  Called toolchain_src_configure
 *   environment, line 4698:  Called die
 * The specific snippet of code:
 *       CONFIG_SHELL="${EPREFIX}/bin/bash" bash "${S}"/configure "${confgcc[@]}" || die "failed to run configure";
 * 
 * If you need support, post the output of `emerge --info '=sys-devel/gcc-7.3.0-r3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-7.3.0-r3::gentoo'`.
 * 
 * Please include /var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-build-logs.tar.bz2 in your bug report.
 * 
 * The complete build log is located at '/var/tmp/portage/sys-devel/gcc-7.3.0-r3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-7.3.0-r3/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/build'
 * S: '/var/tmp/portage/sys-devel/gcc-7.3.0-r3/work/gcc-7.3.0'
 

Freier Radikaler
Simple Hen
Posts: 44
Joined: Tue Dec 03, 2013 16:12

Re: configure: error: C compiler cannot create executables

Post by Freier Radikaler » Wed Oct 10, 2018 14:09

Just found the problem. An old binutils version (2.25) was still in use even though a never version (2.30) was already installed.
An "eselct binutils set x86_64-pc-linux-gnu-2.30" did the trick...

Post Reply