Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 331227 - sys-devel/gcc-config: support changing target of cc, cpp, & c++
Summary: sys-devel/gcc-config: support changing target of cc, cpp, & c++
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 26757
  Show dependency tree
 
Reported: 2010-08-04 17:15 UTC by Dmitri Seletski
Modified: 2017-10-02 20:33 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitri Seletski 2010-08-04 17:15:25 UTC
In portage there is a file responsible for USE flags for certain packages.
Since LLVM is getting popular, wouldn't it make sense to create something similar to previously mentioned file, but which instead of different compile options will actually compile with different compiler?
I have seen performance boost of LLVM for Apache, on Phoronix, so, why not take advantage of this boost?(i am lame, I assume libs compiled with GCC will still work with LLVM)

Reproducible: Always

Steps to Reproduce:
not a bug


Expected Results:  
Certain packages may seriously benefit by means of speed from different compilers!
Comment 1 SpanKY gentoo-dev 2010-08-04 20:04:31 UTC
USE flags are not for controlling compilers

if you want to use LLVM, then simply export the CC env var and friends to the compiler you want
Comment 2 Dmitri Seletski 2010-08-04 22:24:09 UTC
But this is my point, there should be a separate file, lets call it, /etc/portage/package.cop(cop, for COmPiler). When ebuild is processed by portage just before compilation takes place it changes "CC", "CXX", "CPP" variables.

Example: LLVM is known to produce superior binaries for Apache(I don't claim it, Phoronix benchmark, off their site does). Now, I change C/C++ compiler over variable, "happilly ever after"? I don't think so. Next time I do update for "world" and there is new version of Apache available - it uses GCC. Benefit boost gone...

My point is, there should be a config file in portage system, which, let's say. for LLVM ebuilds, or even some other compiler. I put Apache into that file, and next time when I update "world" - Apache is compiled with LLVM, or whatever other compiler i may use. Shouldn't be very difficult, should it?
Comment 3 SpanKY gentoo-dev 2010-08-04 22:34:25 UTC
portage already supports per-package env settings in /etc/portage/
Comment 4 Dmitri Seletski 2016-02-17 23:11:36 UTC
So I take it those variables allow for 'emerge -u world' with various compilers?
If yes, I suppose this pretty much dead bug/improvement suggestion can be closed.
Comment 5 SpanKY gentoo-dev 2016-02-18 06:05:52 UTC
yes, per-package env settings are respected at all times.  overriding `gcc` to actually run something else (like clang) is a bad idea.

you could make an argument that perhaps cc, cpp, and c++ could be anything and so the user should be able to change them to gcc or clang.  this wouldn't impact any packages (since those never use cc, cpp, or c++), just code you download/build.

we can define a new config format that gcc-config will pick up.  perhaps:
  /etc/env.d/gcc/alt/clang
which will be a simple file like:
  CC=clang
  CXX=clang++
  CPP=clang

then gcc-config will have a parallel selection set so you can do:
  gcc-config --alt clang
and then it'll symlink cc to clang, c++ to clang++, and cpp to clang.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-02-18 07:36:51 UTC
I don't really think we need gcc-config to do anything here. We enforce CC and friends in ebuilds anyway, and for custom compiles you can specify the compiler yourself. Especially that autoconf will always pick gcc up anyway.

As a side note: please do not abuse env.d. We're trying to get rid of directories that aren't used by env-update there.
Comment 7 Andreas K. Hüttel archtester gentoo-dev 2017-10-02 20:33:56 UTC
Looks like the consensus here is that this should be achievable with package.env.