Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 418441 - sys-devel/clang / sys-devel/llvm: Allow selecting targets more precisely
Summary: sys-devel/clang / sys-devel/llvm: Allow selecting targets more precisely
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
: 523732 595036 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-31 20:46 UTC by Dennis Schridde
Modified: 2016-10-01 16:06 UTC (History)
3 users (show)

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


Attachments
llvm-2.9-r3 supporting USE=ctarget/cpptarget (llvm-2.9-r3.ebuild.patch,976 bytes, patch)
2012-05-31 20:48 UTC, Dennis Schridde
Details | Diff
clang-2.9-r2 supporting USE=ctarget/cpptarget (clang-2.9-r2.ebuild.patch,1.16 KB, patch)
2012-05-31 20:48 UTC, Dennis Schridde
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2012-05-31 20:46:00 UTC
Currently llvm and clang only allow to select all targets or the host target. There are other interesting targets, like cbe or cpp, which I would like to enable without also compiling in support for all other targets (I assume that would take even longer to build). Attached patch achieves this using 2 additional useflags: ctarget and cpptarget.

Reproducible: Always
Comment 1 Dennis Schridde 2012-05-31 20:48:26 UTC
Created attachment 313747 [details, diff]
llvm-2.9-r3 supporting USE=ctarget/cpptarget
Comment 2 Dennis Schridde 2012-05-31 20:48:48 UTC
Created attachment 313749 [details, diff]
clang-2.9-r2 supporting USE=ctarget/cpptarget
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-06-02 07:12:59 UTC
Two additional flags is a no-go. If we want the precise target selection, we'd probably create a new USE_EXPAND with all of them. But honestly, USE=multitarget is not bad. I'd say the whole time needed to compile llvm/clang is long enough so that benefit of USE=-multitarget is debatable.
Comment 4 Dennis Schridde 2012-06-02 10:48:41 UTC
(In reply to comment #3)
> I'd say the whole time needed to compile llvm/clang is long enough so that
> benefit of USE=-multitarget is debatable.
Do you have numbers - how long does USE=multitarget take compared to USE=-multitarget? Since it already takes so long I was afraid to try it myself.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-06-02 21:02:47 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > I'd say the whole time needed to compile llvm/clang is long enough so that
> > benefit of USE=-multitarget is debatable.
> Do you have numbers - how long does USE=multitarget take compared to
> USE=-multitarget? Since it already takes so long I was afraid to try it
> myself.

     Sun May 13 19:48:22 2012 >>> sys-devel/llvm-9999
       merge time: 17 minutes and 57 seconds.

     Sun May 20 11:03:25 2012 >>> sys-devel/llvm-9999
       merge time: 19 minutes and 36 seconds.

     Tue May 22 22:01:46 2012 >>> sys-devel/llvm-9999
       merge time: 21 minutes and 51 seconds.

     Thu May 24 17:44:59 2012 >>> sys-devel/llvm-9999
       merge time: 23 minutes and 16 seconds.

Not sure where the switch happened but as you can see, the time gets pretty random.

OTOH, if those are pretty useful targets, we probably could just enable them by default. Is there any nice listing of llvm targets with explanation somewhere?
Comment 6 Dennis Schridde 2012-06-03 00:09:32 UTC
(In reply to comment #5)
> Not sure where the switch happened but as you can see, the time gets pretty
> random.
In that case I would even vote for making multitarget the default...

> OTOH, if those are pretty useful targets, we probably could just enable them
> by default. Is there any nice listing of llvm targets with explanation
> somewhere?
There is a list of "traditional" targets [1], but I doubt you are interested in that. I drew my information (after reading the release notes and someone else's code which called clang -march=c) from the configure file...

[1] http://llvm.org/docs/GettingStarted.html#config
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-06-03 07:29:00 UTC
(In reply to comment #6)
> > OTOH, if those are pretty useful targets, we probably could just enable them
> > by default. Is there any nice listing of llvm targets with explanation
> > somewhere?
> There is a list of "traditional" targets [1], but I doubt you are interested
> in that. I drew my information (after reading the release notes and someone
> else's code which called clang -march=c) from the configure file...

Well, I was able to find 'cpp' description in the file and it is interesting and portable indeed. However, I don't see 'cbe' in LLVM...

Bernard, what do you think? Can I just enable 'cpp' along with host by default? It outputs C++ code which invokes LLVM.
Comment 8 Dennis Schridde 2012-06-03 09:10:48 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > > OTOH, if those are pretty useful targets, we probably could just enable them
> > > by default. Is there any nice listing of llvm targets with explanation
> > > somewhere?
> > There is a list of "traditional" targets [1], but I doubt you are interested
> > in that. I drew my information (after reading the release notes and someone
> > else's code which called clang -march=c) from the configure file...
> 
> Well, I was able to find 'cpp' description in the file and it is interesting
> and portable indeed. However, I don't see 'cbe' in LLVM...
The C backend was removed in 3.1 and broken in 3.0.

> Bernard, what do you think? Can I just enable 'cpp' along with host by
> default? It outputs C++ code which invokes LLVM.
Please note that configure will not recognize "host-only" if it is not the only parameter. It appears to be an alias for "host" and you have to use that instead.
Comment 9 Bernard Cafarelli gentoo-dev 2012-06-04 13:05:58 UTC
The cpp target definitely sounds interesting! The ptx one also sounds promising (emitting assembly code for nvidia GPUs), and does not really match a known CPU either.

I'm all for cpp with USE=-multitarget as a first step. If there are more non-cpu targets in the future, we can think about USE_EXPAND.
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-06-04 20:28:15 UTC
(In reply to comment #9)
> I'm all for cpp with USE=-multitarget as a first step. If there are more
> non-cpu targets in the future, we can think about USE_EXPAND.

I will do that in -r3 and it once we get all -r2 breakages fixed for it.
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-06-08 13:21:53 UTC
I've enabled cpp in -9999 ebuilds.

ryao, when you are going to revbump clang once again, please revbump llvm as well syncing the --enable-targets to -9999.
Comment 12 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-07-16 09:35:13 UTC
/var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.1-r2.ebuild,v  <--  llvm-3.1-r2.ebuild
initial revision: 1.1
/var/cvsroot/gentoo-x86/sys-devel/clang/clang-3.1-r5.ebuild,v  <--  clang-3.1-r5.ebuild
initial revision: 1.1

Those versions are guaranteed to have cpp always enabled.
Comment 13 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-10-01 16:05:40 UTC
This is now truly fixed in 3.9.0, with LLVM_TARGETS!
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-10-01 16:05:54 UTC
*** Bug 595036 has been marked as a duplicate of this bug. ***
Comment 15 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-10-01 16:06:54 UTC
*** Bug 523732 has been marked as a duplicate of this bug. ***