New issue
Advanced search Search tips
Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 25
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment
link

Issue 919267: Stop building all the LLVM targets into our clang package

Reported by p...@chromium.org, Jan 5 Project Member

Issue description

We don't need most of the targets that we build into our clang package, so we should stop building them. As far as I know we only need X86, ARM, AArch64 and possibly Mips and PowerPC.
 

Comment 1 by thakis@chromium.org, Jan 5

Also want to keep wasm, probably.

And maybe the arduino thingy (AVR I think?) if anyone wants to play with that. And maybe riscv, for similar reasons.

I thought about this every now and then, but it kind of felt nice to have everything available, if people want to tinker using our compiler. Looking though the target list, AMDGPU and NVPTX also look vaguely interesting. Most of the targets are a lot smaller (in the "less code" sense) than X86/AArch64/ARM, so I'm not sure how much of a win it is.

If it makes the build faster, we can definitely do this at least on tot; and maybe the "provide fun for tinkerers" argument isn't very good and we should cut most of them from the real package too.

Comment 2 by thakis@chromium.org, Jan 5

(Mostly unrelated, but for tot build speed we could also set a bunch of LLVM_TOOL_foo_BUILD to not compile everything in llvm/tools, but again the most expensive part of the build is probably what we do need. I'm starting to feel that we should probably disable the static analyzer though, since that's like > 10% of clang's build time.)

Comment 3 by p...@chromium.org, Jan 5

I'm inclined to say that if you want to tinker you should build your own package -- if you're porting parts of Chromium to some new target, rebuilding the compiler is probably the easiest step.

I thought about wasm but I couldn't see any uses in the tree. We could certainly add it back if we grow a use, though.

Comment 4 by thakis@chromium.org, Jan 5

There are ongoing discussions about wasm; I have half a protottype at https://chromium-review.googlesource.com/c/chromium/src/+/1282394

Comment 5 by p...@chromium.org, Jan 5

Here's what the package sizes look like with this. 350349-1 is with all targets, 350349-2 is with '-DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64;Mips;PowerPC'. I wouldn't expect things to look much different if we include wasm as well.

-rw-r--r-- 1 pcc primarygroup 76490058 Jan  4 19:04 clang-350349-1.tgz
-rw-r--r-- 1 pcc primarygroup 66105467 Jan  4 19:39 clang-350349-2.tgz

Comment 6 by thakis@chromium.org, Jan 5

Ok, we should do this :-)

Not sure we need PowerPC…oh, looks like we might need it: https://cs.chromium.org/chromium/src/v8/src/log.cc?type=cs&q=v8_target_arch_&sq=package:chromium&g=0&l=559 Not sure what s390 is.

We do want wasm.

Comment 7 by p...@chromium.org, Jan 5

I think s390 is SystemZ.
http://llvm-cs.pcc.me.uk/lib/Support/Triple.cpp#417

I'll try building another package with SystemZ and WebAssembly.

Comment 8 by p...@chromium.org, Jan 5

Owner: p...@chromium.org
Status: Assigned (was: Untriaged)
With '-DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64;Mips;PowerPC;SystemZ;WebAssembly':

-rw-r--r-- 1 pcc primarygroup 67830676 Jan  4 20:18 clang-350349-3.tgz

Still looking pretty good. I'll probably give this a go once we have the roll out of the way.

Comment 10 by bugdroid1@chromium.org, Jan 12

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f44b38f45c66ab9ea219434c9273b6dc078ff939

commit f44b38f45c66ab9ea219434c9273b6dc078ff939
Author: Peter Collingbourne <pcc@chromium.org>
Date: Sat Jan 12 05:46:05 2019

clang/update.py: Build only the targets that we need.

See bug for details.

Bug:  919267 
Change-Id: Ied50d4cea6d2302ab6e738c8ed50ba96f6d0d482
Reviewed-on: https://chromium-review.googlesource.com/c/1407652
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622294}
[modify] https://crrev.com/f44b38f45c66ab9ea219434c9273b6dc078ff939/tools/clang/scripts/update.py

Comment 11 by thakis@chromium.org, Jan 25

Status: Fixed (was: Started)

Sign in to add a comment