Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 608248 - app-emulation/vice-2.4.31 fails to build with sys-devel/clang installed - configure: error: C++ compiler cannot create executables
Summary: app-emulation/vice-2.4.31 fails to build with sys-devel/clang installed - con...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2017-02-04 19:43 UTC by Kai Krakow
Modified: 2018-06-27 14:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info.txt,11.96 KB, text/plain)
2017-02-19 22:23 UTC, Kai Krakow
Details
app-emulation/vice-2.4.31 build.log (build.log,32.54 KB, text/x-log)
2017-02-19 22:24 UTC, Kai Krakow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Krakow 2017-02-04 19:43:59 UTC
When installing vice it fails, when I happen to have clang installed also. This is because the configure phase automatically detects clang as the compiler and then bails out because it cannot create executables.

Forcing CC and CXX in make.conf to the GNU compiler (gcc and g++) make the ebuild work again.
Comment 1 Michael Palimaka (kensington) gentoo-dev 2017-02-17 11:50:39 UTC
Please add emerge --info and the failing build log.
Comment 2 Kai Krakow 2017-02-19 22:23:51 UTC
Created attachment 464374 [details]
emerge --info
Comment 3 Kai Krakow 2017-02-19 22:24:50 UTC
Created attachment 464376 [details]
app-emulation/vice-2.4.31 build.log

build.log and emerge --info attached.
Comment 4 Sven Müller 2017-03-02 17:11:55 UTC
Same here. 

I guess, it's the same problem, described here:
https://bugs.gentoo.org/show_bug.cgi?id=610098

The solution of the other bug works here too: 
Just rename /usr/bin/x86_64-pc-gnu-clang++ to something else to force the usage of gcc over clang.
Comment 5 Kai Krakow 2017-03-03 05:06:32 UTC
Just a note to Michael Palimaka because he linked the blocker bug:

What I want to achieve is compiling the system with GCC even when clang is installed (it's a dependency of some packages). I didn't intend to use clang as a system compiler.

The bug is not that vice maybe cannot be correctly built by clang but that clang is implicitly preferred over gcc automatically. I think that's a bug in the build system of vice which should be fixed.
Comment 6 Kai Krakow 2017-03-03 05:20:48 UTC
(In reply to Sven Müller from comment #4)
> Same here. 
> 
> I guess, it's the same problem, described here:
> https://bugs.gentoo.org/show_bug.cgi?id=610098

Yes because the bug is not about the package not compiling with clang, but about the build system undeterministicly preferring clang over gcc. Ebuilds should not work that way.

> The solution of the other bug works here too: 
> Just rename /usr/bin/x86_64-pc-gnu-clang++ to something else to force the
> usage of gcc over clang.

Most easy fix is probably just putting "CC=gcc CXX=g++" in front of the emerge call:

# CC=gcc CXX=g++ emerge -1a vice

and it will work. A more permanent fix for me was using package.env:

# cat /etc/portage/env/force-gcc
CC="x86_64-pc-linux-gnu-gcc"
CXX="x86_64-pc-linux-gnu-g++"

# cat /etc/portage/package.env
app-emulation/vice force-gcc

I'm already using "force-gcc" for other packages whose built system arbitrarily switches to clang, too, just because it is installed. However, ebuilds should really not work that way. An ebuild has to work deterministic. But I think this is a huge pita with autoconf anyway.

My default cc is GNU:

# LANG=C cc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.4/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.4/lto-wrapper
Target: x86_64-pc-linux-gnu
[...]

So if I don't explicitly point CC to something else, I expect ebuilds to use this default.
Comment 7 Pacho Ramos gentoo-dev 2018-02-26 16:39:04 UTC
can you retry with 3.1 version?