Commit graph

245 commits

Author SHA1 Message Date
Mike Hommey
917cd1f7f1 Bug 1882441 - Enable libxml2 support in windows clang. r=firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D202902
2024-02-29 22:53:01 +00:00
Mike Hommey
b2212b3106 Bug 1857400 - Use CMAKE_MSVC_RUNTIME_LIBRARY instead of LLVM_USE_CRT_RELEASE. r=firefox-build-system-reviewers,sergesanspaille
The latter was deprecated in
c6bd873403
and removed more recently in
618e5d2c2d

Fortunately, the former works with LLVM 17, so we don't need to
special case, we can use the same as for trunk.

Differential Revision: https://phabricator.services.mozilla.com/D190248
2023-10-07 07:15:29 +00:00
Mike Hommey
2a0bbfdf2f Bug 1856501 - Set CMAKE_*_FLAGS_INIT instead of CMAKE_*_FLAGS. r=firefox-build-system-reviewers,sergesanspaille
The latter may override important flags added my cmake itself or cmake
scripts. The former doesn't have this property.

Differential Revision: https://phabricator.services.mozilla.com/D190005
2023-10-05 08:45:30 +00:00
Mike Hommey
e0f91b4b0f Bug 1827587 - Adjust clang-tidy build script to handle new lib/clang/ versioning. r=firefox-build-system-reviewers,andi
Before clang 16, the version in lib/clang/ looked like x.y.z, but now
it's only x.

Differential Revision: https://phabricator.services.mozilla.com/D175441
2023-04-14 07:53:21 +00:00
Mike Hommey
fac2583920 Bug 1817894 - Force-disable terminfo in clang. r=firefox-build-system-reviewers,andi
Bug 1805664 had the side effect of installing terminfo libraries on the
toolchain docker image, which led to clang gaining a dependency on
libtinfo, leading to multiple failures, like PGO run jobs failing with
llvm-profdata failing to load the new dependency, or tsan tests failing
because llvm-symbolizer doesn't work because of the new dependency not
being fulfilled, which in turn breaks TSAN suppressions.

Differential Revision: https://phabricator.services.mozilla.com/D170417
2023-02-21 08:32:33 +00:00
Mike Hommey
3f793f3d90 Bug 1812974 - Remove cctools dependency for clang toolchains. r=firefox-build-system-reviewers,ahochheiden
The non-raw clang toolchains do still need cctools for lipo when
aggregating the compiler-rts.

Differential Revision: https://phabricator.services.mozilla.com/D168034
2023-02-01 15:09:39 +00:00
Mike Hommey
e24baca557 Bug 1812974 - Remove some unnecessary flags. r=firefox-build-system-reviewers,ahochheiden
These flags used to be necessary when we first were cross-compiling
clang, but more recent (although now old) changes have made them
actually unnecessary.

Differential Revision: https://phabricator.services.mozilla.com/D168033
2023-02-01 15:09:39 +00:00
Stanca Serban
4bb42b9d45 Backed out 7 changesets (bug 1812974) for clang bustages. CLOSED TREE
Backed out changeset 839cf7e96788 (bug 1812974)
Backed out changeset b65050508523 (bug 1812974)
Backed out changeset 10c5442e487c (bug 1812974)
Backed out changeset 2185787a02c0 (bug 1812974)
Backed out changeset 2191a1c60417 (bug 1812974)
Backed out changeset 4074d5e1544d (bug 1812974)
Backed out changeset 1c6b291568f1 (bug 1812974)
2023-02-01 14:08:25 +02:00
Mike Hommey
00373f5e4b Bug 1812974 - Remove some unnecessary flags. r=firefox-build-system-reviewers,ahochheiden
These flags used to be necessary when we first were cross-compiling
clang, but more recent (although now old) changes have made them
actually unnecessary.

Differential Revision: https://phabricator.services.mozilla.com/D168033
2023-02-01 10:59:35 +00:00
Mike Hommey
05d471ef16 Bug 1812214 - Cross compile the stage1 windows clang. r=firefox-build-system-reviewers,andi
as well as clang-tidy.

Differential Revision: https://phabricator.services.mozilla.com/D167757
2023-01-27 07:22:44 +00:00
Mike Hommey
4ad3f5cabc Bug 1812214 - Refactor build-clang.py to prepare for Windows cross-compilation. r=firefox-build-system-reviewers,andi
The "osx_cross_compile" + "OSX_ARCH" approach is not exactly nice to
generalize.

Differential Revision: https://phabricator.services.mozilla.com/D167756
2023-01-27 07:22:43 +00:00
Mike Hommey
b76230ed4d Bug 1812214 - Stop passing libtool to cmake when building clang. r=firefox-build-system-reviewers,sergesanspaille
It's not used anyway:
```
CMake Warning:
  Manually-specified variables were not used by the project:
    CMAKE_LIBTOOL
```

Differential Revision: https://phabricator.services.mozilla.com/D167753
2023-01-27 07:22:42 +00:00
serge-sans-paille
229778db45 Bug 1801268 - enable lto-built clang r=firefox-build-system-reviewers,glandium
Using ThinLTO because it's a good compromise between performance and
compilation speed.

Activating it for both profile generation and profile usage, doing it
only for profile usage leads to a lot of mismatch, aka

        function control flow change detected (hash mismatch)

which leads to profile information not beoing used.

This requires using the whole llvm toolchain (lld, llvm-ar, llvm-ranlib)
from the same revision.

This is disabled on Windows where it causes link error on the LLVM
Plugin system.

Differential Revision: https://phabricator.services.mozilla.com/D162371
2023-01-25 09:46:40 +00:00
Marco Castelluccio
f69e697461 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
c04dd9a256 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
08f7e9ef03 Backed out changeset 79025940a6a6 (bug 1799423) for causing Bug 1804813 a=backout 2022-12-09 06:48:09 +02:00
serge-sans-paille
e8902c687b 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
9894c19165 Backed out changeset c353f81b2823 (bug 1799423) for causing build OSX bustages. CLOSED TREE 2022-12-01 15:42:11 +02:00
serge-sans-paille
aae108f1a3 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
ecb54845b0 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
0a4632e16b Backed out changeset e9bd011dbf75 (bug 1799423) for causing toolchains failures. CLOSED TREE 2022-11-22 14:22:00 +02:00
serge-sans-paille
936dd7061f 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
69b86f1ded Backed out changeset 440b5894d289 (bug 1799423) as per request. CLOSED TREE 2022-11-22 08:24:23 +02:00
serge-sans-paille
f8aeb3cbd7 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
636aef20cd 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
f7e039970b 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
4caac3ac74 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
887e185c4a 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
6b10bc399b 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
9bd4f1813b 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
f407aee2df 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
6f6aa13882 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
c10d0fa5e2 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
6ae8fef73d 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
dc5a07f0b1 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
cd4ff2c4e5 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
6366f29369 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
22040e3128 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
832f677438 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
3789acd7bb 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
8a445063c5 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
083c25c7bf 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
c0ade9e73b 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
f214b100b4 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
49dc85a2b5 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
a92ea8069d 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
53e4530689 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
d099cbd384 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
a3fcd56183 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
d9792211f1 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