Commit Graph

232 Commits

Author SHA1 Message Date
Marco Castelluccio
ba39d286d5 Bug 1801836 - Remove no longer necessary 'from __future__' imports. r=linter-reviewers,glandium,webdriver-reviewers,perftest-reviewers,geckoview-reviewers,jld,ahal,owlish,afinder DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D165395
2022-12-23 22:45:46 +00:00
serge-sans-paille
afa44c968e Bug 1799423 - link clang with lld r=firefox-build-system-reviewers,glandium
As a side effect, this obsoletes the "link" config as clang always uses
the lld linker alongside its own install.

Differential Revision: https://phabricator.services.mozilla.com/D161436
2022-12-14 07:56:22 +00:00
Norisz Fay
1d4fb158a3 Backed out changeset 79025940a6a6 (bug 1799423) for causing Bug 1804813 a=backout 2022-12-09 06:48:09 +02:00
serge-sans-paille
bdf7b33d7f Bug 1799423 - link clang with lld r=firefox-build-system-reviewers,glandium
As a side effect, this obsoletes the "link" config as clang always uses
the lld linker alongside its own install.

Differential Revision: https://phabricator.services.mozilla.com/D161436
2022-12-08 05:09:48 +00:00
Butkovits Atila
da8d75fa8c Backed out changeset c353f81b2823 (bug 1799423) for causing build OSX bustages. CLOSED TREE 2022-12-01 15:42:11 +02:00
serge-sans-paille
8ac7ced8b0 Bug 1799423 - link clang with lld r=firefox-build-system-reviewers,glandium
As a side effect, this obsoletes the "link" config as clang always uses
the lld linker alongside its own install.

Differential Revision: https://phabricator.services.mozilla.com/D161436
2022-12-01 08:51:47 +00:00
Marco Castelluccio
c71d4c70bc Bug 1790816 - Reformat build/ with isort. r=linter-reviewers,ahal DONTBUILD
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162668
2022-11-24 17:23:47 +00:00
Csoregi Natalia
00809da382 Backed out changeset e9bd011dbf75 (bug 1799423) for causing toolchains failures. CLOSED TREE 2022-11-22 14:22:00 +02:00
serge-sans-paille
0859d1ee8a Bug 1799423 - link clang with lld r=firefox-build-system-reviewers,glandium
As a side effect, this obsoletes the "link" config as clang always uses
the lld linker alongside its own install.

Differential Revision: https://phabricator.services.mozilla.com/D161436
2022-11-22 09:23:51 +00:00
Csoregi Natalia
62f8989119 Backed out changeset 440b5894d289 (bug 1799423) as per request. CLOSED TREE 2022-11-22 08:24:23 +02:00
serge-sans-paille
0447177fe6 Bug 1799423 - link clang with lld r=firefox-build-system-reviewers,glandium
As a side effect, this obsoletes the "link" config as clang always uses
the lld linker alongside its own install.

Differential Revision: https://phabricator.services.mozilla.com/D161436
2022-11-22 05:54:51 +00:00
Mike Hommey
38e62113d2 Bug 1788870 - Stop shipping libc++ along clang. r=firefox-build-system-reviewers,andi
There are some ABI issues with libc++ headers in clang 15. The main
reason we are shipping libc++ with our clang is that the macos SDK,
up to and including 11.1, only contained the libc++ libraries, but
not the headers. The first SDK that contains the headers is 11.3
(there is no 11.2, at least publicly available), and we're now using
it.

Another problem with libc++ is that the way we currently build it is
deprecated and is going to yields hard errors soon enough on clang
trunk.

The simplest thing to do right now is to just stop shipping libc++.

Eventually, we may want to ship it correctly in a different way, for
all platforms, which was not happening anyways.

Differential Revision: https://phabricator.services.mozilla.com/D156283
2022-09-05 21:37:07 +00:00
Mike Hommey
a77db9ce0f Bug 1784202 - Properly set target flags for clang mac builds. r=firefox-build-system-reviewers,andi
Currently, when building clang for mac, which we cross-compile, we're
always passing a x86-64 target, even on arm64. This cancels out with the
LLVM build system adding `-arch arm64`, so it worked fine... until clang
15, where some things end up being built without `-arch arm64` and
things end up broken.

Differential Revision: https://phabricator.services.mozilla.com/D156258
2022-09-04 21:01:53 +00:00
Mike Hommey
25e5e12e76 Bug 1774554 - Stop relying on symbolic links to enable things to build in clang. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D149504
2022-06-17 01:41:10 +00:00
Mike Hommey
8acbc80cbe Bug 1773224 - Disable per-target runtime directory. r=firefox-build-system-reviewers,andi
There are a set of problems that arise from that setup that need to be
addressed before this can be enabled, but upstream is toying with it,
and it's better to have a setup that is stable rather than a setup that
can break when upstream changes something (which happened again earlier
today).

Differential Revision: https://phabricator.services.mozilla.com/D148625
2022-06-08 08:46:00 +00:00
Mike Hommey
45567c8ce2 Bug 1770302 - Consolidate how the clang targets are configured. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D146874
2022-05-20 08:33:15 +00:00
Mike Hommey
99e47edfeb Bug 1770302 - Remove build_libcxx. r=firefox-build-system-reviewers,andi
Bug 1744890 moved build_libcxx out of the individual json configs, and
bug 1748056 made it always True. We can now remove it.

Differential Revision: https://phabricator.services.mozilla.com/D146873
2022-05-20 08:33:15 +00:00
Mike Hommey
d0f000be92 Bug 1758780 - Take the ms-compat version used to build clang from a LLVM cmake file. r=firefox-build-system-reviewers,mhentges
While the llvm/cmake/platforms/WinMsvc.cmake file only supports
cross-compiles, it contains the right -fms-compatibility-version
to use to build clang/llvm (modulo when upstream forgets to update it).

It's better to rely on that, than to keep a version in build-clang.py
that would possibly need to cover multiple versions of clang.

Differential Revision: https://phabricator.services.mozilla.com/D143133
2022-04-12 01:30:54 +00:00
Mike Hommey
841a3cb7f0 Bug 1758780 - Don't build tests when building clang. r=firefox-build-system-reviewers,mhentges
We never run them, so there's no point building them.

Differential Revision: https://phabricator.services.mozilla.com/D143131
2022-04-12 01:30:54 +00:00
Mike Hommey
c85129ccc5 Bug 1755415 - Ship most compiler-rts alongside clang toolchains on all platforms. r=firefox-build-system-reviewers,mhentges
This improves out-of-the-box support for cross-compiles on tier-1 build
platforms, including for asan. This also reduces the number of different
*-cross toolchains we need for CI builds.

The linux clang is now also a repack, like the others, and the insertion
of the wasm compiler-rt is moved to the repack, which also allows to
remove that part of the build-clang.py script.

Differential Revision: https://phabricator.services.mozilla.com/D138749
2022-02-17 03:44:39 +00:00
Mike Hommey
60e8cd322b Bug 1755415 - Use compiler-rt artifacts for clang PGO. r=firefox-build-system-reviewers,mhentges
Instead of building compiler-rt alongside clang, we reuse the clang
repack logic to put compiler-rts in place when building clang stage2
(which requires the profiling runtime).

The repack logic is unified to handle all platforms as well, and now
that compiler-rt is not built in clang, we also need to copy everything
that is not lib/* from the compiler-rt artifacts, so we now also ensure
that they're not diverging between those compiler-rt artifacts (except
for darwin libs, which need to be unified into universal libraries).

And as a bonus, we can also cross-build the mac clang toolchains with
the stage1 clang and the clang runtime for the target platform.

Differential Revision: https://phabricator.services.mozilla.com/D138748
2022-02-17 03:44:38 +00:00
Marian-Vasile Laza
fa431ac37b Backed out 5 changesets (bug 1755415) for causing build bustages. CLOSED TREE
Backed out changeset e836c26855d4 (bug 1755415)
Backed out changeset 69d9d8005a83 (bug 1755415)
Backed out changeset a84913234c63 (bug 1755415)
Backed out changeset 709af6e17057 (bug 1755415)
Backed out changeset 0a5c1fe00f26 (bug 1755415)
2022-02-16 13:31:05 +02:00
Mike Hommey
dd7b04aa59 Bug 1755415 - Ship most compiler-rts alongside clang toolchains on all platforms. r=firefox-build-system-reviewers,mhentges
This improves out-of-the-box support for cross-compiles on tier-1 build
platforms, including for asan. This also reduces the number of different
*-cross toolchains we need for CI builds.

The linux clang is now also a repack, like the others, and the insertion
of the wasm compiler-rt is moved to the repack, which also allows to
remove that part of the build-clang.py script.

Differential Revision: https://phabricator.services.mozilla.com/D138749
2022-02-16 08:24:40 +00:00
Mike Hommey
83b844ed6f Bug 1755415 - Use compiler-rt artifacts for clang PGO. r=firefox-build-system-reviewers,mhentges
Instead of building compiler-rt alongside clang, we reuse the clang
repack logic to put compiler-rts in place when building clang stage2
(which requires the profiling runtime).

The repack logic is unified to handle all platforms as well, and now
that compiler-rt is not built in clang, we also need to copy everything
that is not lib/* from the compiler-rt artifacts, so we now also ensure
that they're not diverging between those compiler-rt artifacts (except
for darwin libs, which need to be unified into universal libraries).

And as a bonus, we can also cross-build the mac clang toolchains with
the stage1 clang and the clang runtime for the target platform.

Differential Revision: https://phabricator.services.mozilla.com/D138748
2022-02-16 08:24:40 +00:00
Mike Hommey
c1e3417764 Bug 1726782 - Create a new task generating a clang profile for PGO. r=firefox-build-system-reviewers,mhentges
The new task builds a stage 2 compiler and uses it to generate the
profile as stage 3, and the profile is used to feed the now separate
stage 4 clang build. This will allow us to use this same profile to
build mac clangs with PGO.

Differential Revision: https://phabricator.services.mozilla.com/D138511
2022-02-14 21:10:00 +00:00
smolnar
2737891044 Backed out 3 changesets (bug 1726782) for causing clang-format failures. CLOSED TREE
Backed out changeset 17bfaad3db80 (bug 1726782)
Backed out changeset f58fe19ec977 (bug 1726782)
Backed out changeset 2fc65de433eb (bug 1726782)
2022-02-13 11:27:16 +02:00
Mike Hommey
a980d7084b Bug 1726782 - Create a new task generating a clang profile for PGO. r=firefox-build-system-reviewers,mhentges
The new task builds a stage 2 compiler and uses it to generate the
profile as stage 3, and the profile is used to feed the now separate
stage 4 clang build. This will allow us to use this same profile to
build mac clangs with PGO.

Differential Revision: https://phabricator.services.mozilla.com/D138511
2022-02-12 21:07:59 +00:00
Mike Hommey
04d433665c Bug 1752490 - Build the Windows clang toolchain as a repack or clang + compiler-rt. r=firefox-build-system-reviewers,andi
This means we can now skip building a 32-bit compiler-rt when building
clang itself, as well as the asan pdb files, which will be taken from
the compiler-rt artifact.

Differential Revision: https://phabricator.services.mozilla.com/D137259
2022-02-03 07:51:38 +00:00
Mike Hommey
9e2f6db29a Bug 1752490 - Remove leftovers from bug 1751812. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D137258
2022-02-03 07:51:37 +00:00
Mike Hommey
e02dbc2fc8 Bug 1748056 - Build libc++ in Windows clang for real. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D137256
2022-02-01 00:51:57 +00:00
Mike Hommey
964c4b3d6a Bug 1748056 - Stop forcing c++14 mode when building clang on Windows. r=firefox-build-system-reviewers,andi
Back when this was added, clang's default mode might have been c++11,
but it's not c++17, and we're effectively downgrading it (which
incidentally causes problems to build libc++).

Differential Revision: https://phabricator.services.mozilla.com/D137255
2022-02-01 00:51:57 +00:00
Mike Hommey
886d3ffe8f Bug 1751839 - Add options to skip clang build stages. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D136843
2022-01-25 21:51:16 +00:00
Mike Hommey
76ebb62b53 Bug 1751839 - Don't build the gold linker plugin when not using a sysroot. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D136842
2022-01-25 21:51:16 +00:00
Mike Hommey
9da259f352 Bug 1751837 - Explicitly enable libxml2 support in macos clang. r=firefox-build-system-reviewers,andi
It is currently enabled automatically because libxml2 is detected, but
we want to be sure it's not accidentally disabled.

Differential Revision: https://phabricator.services.mozilla.com/D136840
2022-01-25 21:51:15 +00:00
Mike Hommey
50e412871d Bug 1751812 - Remove options to build compiler runtimes at the same time as clang. r=firefox-build-system-reviewers,andi
`extra_targets` was used for the aarch64-linux compiler runtime, which
moved to a separate task in bug 1690757, and `android_targets` was used
for android compiler runtimes, which moved to separate tasks in
bug 1690973.

Using separate tasks is now the prefered way to build compiler runtimes,
os we won't need these options.

Differential Revision: https://phabricator.services.mozilla.com/D136822
2022-01-25 21:51:15 +00:00
Mike Hommey
5995e853ab Bug 1748373 - Don't print out the contents of CMake{Output,Error}.log. r=firefox-build-system-reviewers,mhentges
When cmake fails during the clang build, we currently print out the
contents of CMakeOutput.log and CMakeError.log because they may contain
something useful to debug what happened. Unfortunately, because the
treeherder log parser doesn't see the actual error, it reports the
normal error that are part of the logs as being the errors causing the
failure, the first one of which is a check whether malloc/malloc.h is a
thing, which it is not, and that's normal.

So instead of printing them out, we provide the files as artifacts.

Differential Revision: https://phabricator.services.mozilla.com/D134999
2022-01-04 22:15:16 +00:00
Mike Hommey
65fd541d6a Bug 1748056 - Build libc++ in clang for Windows. r=firefox-build-system-reviewers,andi
This brings parity with other platforms.

Differential Revision: https://phabricator.services.mozilla.com/D134911
2021-12-31 08:00:01 +00:00
Sylvestre Ledru
c98b01901b Bug 1747032 - Remove -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly and add it as target r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D134380
2021-12-22 06:39:00 +00:00
Mike Hommey
19efa34a94 Bug 1745115 - Allow to give multiple configs to build-clang.py. r=firefox-build-system-reviewers,andi
And merge them. This will allow to deduplicate and uniformize them.

Differential Revision: https://phabricator.services.mozilla.com/D133316
2021-12-10 00:29:58 +00:00
Mike Hommey
6fda315741 Bug 1745115 - Adjust patches paths earlier. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D133315
2021-12-10 00:29:57 +00:00
Mike Hommey
069f601300 Bug 1745115 - Default number of stages to build clang to 2. r=firefox-build-system-reviewers,andi
- stage 1 is building clang with whatever compiler is available
- stage 2 is building clang with the clang built during stage 1
- stage 3 is building clang with the clang built during stage 2. It's
only useful when it's actively compared against stage 2, or when
there's a stage 4.
- stage 4 is building clang with the clang built during stage 3, with the
profile generated during stage 3, when stage 2 produced a clang with
instrumentation enabled.

We're not actively comparing the output of stage 2 and 3 when not doing
PGO, so it's not useful to do 3-stage builds.

Differential Revision: https://phabricator.services.mozilla.com/D133314
2021-12-10 00:29:57 +00:00
Mike Hommey
9a17df5335 Bug 1744890 - Remove build_libcxx from individual configs. r=firefox-build-system-reviewers,andi
And make build-clang use a sensible default corresponding to what
the configs were doing.

Differential Revision: https://phabricator.services.mozilla.com/D133175
2021-12-08 06:29:14 +00:00
Mike Hommey
548aa9d677 Bug 1744182 - Disable clang support for curl. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D133011
2021-12-08 06:29:12 +00:00
Mike Hommey
8c298c086f Bug 1736502 - Work around clang trunk changes that break our clang-trunk build. r=andi
Short of solving this by fully embracing the monorepo build and removing
the projects/ workarounds (which will also require a compat more with
older clang versions we still build with the same script), we can solve
the bustage with a small hack.

Differential Revision: https://phabricator.services.mozilla.com/D131458
2021-11-18 06:43:03 +00:00
Andi-Bogdan Postelnicu
e3951683f2 Bug 1731582 - Move to clang-13 r=firefox-build-system-reviewers,mhentges,decoder
Join work with glandium.

Differential Revision: https://phabricator.services.mozilla.com/D126208
2021-10-20 12:03:20 +00:00
Mike Hommey
060f092d99 Bug 1730078 - Only use the sysroot for the final stage of the clang compilation. r=firefox-build-system-reviewers,andi
Using the sysroot with GCC requires some unnecessary complication, and
we don't really care if the first stages are not using the sysroot.

Differential Revision: https://phabricator.services.mozilla.com/D125161
2021-09-15 02:39:53 +00:00
Mike Hommey
639cb95294 Bug 1730078 - Don't build some things during early stages of the clang compilation. r=firefox-build-system-reviewers,andi,mhentges
Building sanitizers in older versions of clang emit errors when built with
newer GCC because of some narrowing conversions. We only really need the
sanitizers in the final stage anyways, so we force-disable them (and
everything else that might enable "sanitizer-common") in early stages.

Building the lli tool (also used in tests) fails as well, and we don't
need it until the final stage (where we need it to ship it).

Differential Revision: https://phabricator.services.mozilla.com/D125159
2021-09-15 02:39:52 +00:00
Mike Hommey
999e1095e7 Bug 1726453 - Don't set LLVM_LIBDIR_SUFFIX=64 when building android-cross clang. r=firefox-build-system-reviewers,mhentges
It's an unnecessary difference with our other clang builds. It looks
like it was cargo-culted from some external script. It makes the
android-cross clang different in the way it finds e.g. compiler
runtimes, some of which are in lib/, and others in lib64/, and only the
latter are actually found.

Differential Revision: https://phabricator.services.mozilla.com/D123017
2021-08-20 03:56:12 +00:00
Mike Hommey
859a6854ae Bug 1724522 - Split wasi-sysroot in two separate toolchains. r=firefox-build-system-reviewers,mhentges
The wasi-sysroot toolchain contains both a sysroot for wasi and a
compiler-rt for clang. That makes it impractical to use as a
bootstrapped sysroot for wasm32-wasi builds of Spidermonkey.

We thus split the toolchain in two, one for the compiler-rt and one
for the sysroot. Ideally, the compiler-rt one would avoid building
clang/llvm the same way the sysroot one does, but that leads to
a case of chicken-and-egg, because the compiler-rt is needed to build
the clang toolchain. Eventually, the clang build would be split from
the addition of the compiler-rt, but we're not there yet.

Differential Revision: https://phabricator.services.mozilla.com/D122402
2021-08-13 07:07:45 +00:00
Mike Hommey
2d5106dc7e Bug 1720820 - Remove python executable configuration from clang build script. r=firefox-build-system-reviewers,andi
Clang >= 11 ignores PYTHON_EXECUTABLE entirely (and uses python3, which
is not even what we pass, but that's actually fine), and all the build
tasks we have on older versions find the python executable they need on
their own.

Differential Revision: https://phabricator.services.mozilla.com/D120049
2021-07-17 04:29:10 +00:00