Commit Graph

265 Commits

Author SHA1 Message Date
Alex Hochheiden
9e91a1f021 Bug 1715287 - [lint] Enable remaining pyupgrade rules and lint tree r=linter-reviewers,webdriver-reviewers,translations-reviewers,whimboo,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D245320
2025-04-13 17:48:23 +00:00
Mike Hommey
c35e7c0a30 Bug 1938023 - Be more consistent when cross compiling clang. r=firefox-build-system-reviewers,sergesanspaille
There are some cmake flags we currently only set for mac cross compiles,
but would be just as good to always set and/or for all cross compiles.

The former is the case for CMAKE_*_COMPILER_TARGET.
The latter it the case for CMAKE_SYSTEM_NAME, which implies
CMAKE_CROSSCOMPILING.
LLVM_DEFAULT_TARGET_TRIPLE is implied by LLVM_HOST_TRIPLE, which is
also more important to set, so we set that one instead.

While touching build-clang.py, we also add aarch64-unknown-linux-gnu
as a supported cross-compilation target without adding the corresponding
toolchain. This will avoid rebuilding all the compilers when just adding
new configs for arm64 linux clang toolchains.

Differential Revision: https://phabricator.services.mozilla.com/D232441
2024-12-19 03:46:01 +00:00
Sylvestre Ledru
3e67863e2a Bug 1918098 - ruff: fix the errors identified by 0.6.4 r=linter-reviewers,taskgraph-reviewers,releng-reviewers,webdriver-reviewers,perftest-reviewers,migration-reviewers,jmaher,whimboo,sparky,xpcom-reviewers,beth,ahal,mconley
Differential Revision: https://phabricator.services.mozilla.com/D221874
2024-11-06 12:51:32 +00:00
Mike Hommey
ac439e0399 Bug 1915571 - Move mac and windows clang stage 2 build to cross-compiles. r=firefox-build-system-reviewers,sergesanspaille
By doing so, we don't really need a stage 1 clang for mac and windows
(with the downside that the final PGOed clang becomes the
clang-toolchain artifact on those platforms), and cross-compiling stage
2 is much faster as a cross-compile, leaving only stage 3 to be native.

While here, for the one build type that still does stage 2 and 3 in one
task, we actually prefer taking the llvm-profdata from stage 1, as it
doesn't contain profile instrumentation (it should actually have been
this way since the beginning).

Differential Revision: https://phabricator.services.mozilla.com/D220654
2024-10-04 20:26:33 +00:00
Mike Hommey
a7fe8cd3ce Bug 1915571 - Disable name compression on cross-compiled profile-gen builds. r=firefox-build-system-reviewers,sergesanspaille
We do this as of bug 1620166 for Firefox, and we need something similar
when building clang, for the same reason.

Differential Revision: https://phabricator.services.mozilla.com/D224405
2024-10-04 20:26:33 +00:00
Noemi Erli
60052470de Backed out changeset eaddabaa522f (bug 1915571) for causing toolchains bustage CLOSED TREE 2024-09-04 10:19:27 +03:00
Mike Hommey
0cd4ab1dcb Bug 1915571 - Move mac and windows clang stage 2 build to cross-compiles. r=firefox-build-system-reviewers,sergesanspaille
By doing so, we don't really need a stage 1 clang for mac and windows
(with the downside that the final PGOed clang becomes the
clang-toolchain artifact on those platforms), and cross-compiling stage
2 is much faster as a cross-compile, leaving only stage 3 to be native.

While here, for the one build type that still does stage 2 and 3 in one
task, we actually prefer taking the llvm-profdata from stage 1, as it
doesn't contain profile instrumentation (it should actually have been
this way since the beginning).

Differential Revision: https://phabricator.services.mozilla.com/D220654
2024-09-04 05:43:03 +00:00
Mike Hommey
b48661cf79 Bug 1915778 - Allow paths without .exe on Windows. r=firefox-build-system-reviewers,sergesanspaille
This will be more convenient for the cleanup to come.

Differential Revision: https://phabricator.services.mozilla.com/D220651
2024-09-04 05:43:02 +00:00
Mike Hommey
bfbd8668f3 Bug 1914947 - Build Intel mac clang on arm64 workers. r=firefox-build-system-reviewers,sergesanspaille
That's actually much faster.

Differential Revision: https://phabricator.services.mozilla.com/D220531
2024-09-04 05:29:59 +00:00
Mike Hommey
b9d6d77edd Bug 1914947 - Add stage1 and profile tasks for macosx64 and macosx64-aarch64. r=firefox-build-system-reviewers,sergesanspaille
This splits the clang build in the necessary steps to get native
profiles for Intel and Arm64 mac, similarly to Linux.

Stage 1s are cross-compiled, and the profile step runs natively.

Differential Revision: https://phabricator.services.mozilla.com/D220530
2024-09-04 05:29:59 +00:00
Kagami Sascha Rosylight
36a863a8a7 Bug 1913646 - Add win64-aarch64-clang-18 task r=firefox-build-system-reviewers,sergesanspaille
For now this uses Linux x64 profile for PGO as the macosx64-aarch64 task does, because we don't have aarch64 Windows worker now.

Differential Revision: https://phabricator.services.mozilla.com/D219012
2024-08-26 09:56:11 +00:00
Mike Hommey
50131a06a9 Bug 1849075 - Update builders to clang 18. r=firefox-build-system-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D208955
2024-05-23 04:28:37 +00:00
Cristina Horotan
4156aa0bfb Backed out 2 changesets (bug 1849075, bug 1878764) for causing remote failures at remote/shared/messagehandler/test/browser/*
Backed out changeset 0dbba1a7b5ab (bug 1878764)
Backed out changeset 86555ffb064f (bug 1849075)
2024-05-22 03:34:48 +03:00
Mike Hommey
21d14b1306 Bug 1849075 - Update builders to clang 18. r=firefox-build-system-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D208955
2024-05-21 07:24:02 +00:00
Ryan VanderMeulen
d76a83d0bf Backed out 3 changesets (bug 1849075, bug 1897015, bug 1878764) for causing Android arm32 startup crashes (bug 1897635).
Backed out changeset 916680b7cdce (bug 1897015)
Backed out changeset c6dd0210975b (bug 1878764)
Backed out changeset c9e28db916e5 (bug 1849075)
2024-05-20 12:54:45 -04:00
Mike Hommey
9a7cf9e436 Bug 1849075 - Update builders to clang 18. r=firefox-build-system-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D208955
2024-05-15 19:38:32 +00:00
acseh
23c464a0e2 Backed out 2 changesets (bug 1878764, bug 1849075) for causing build bustages and xpcshell failures on /test_content_annotation.js
Backed out changeset 8dc928e0dd33 (bug 1878764)
Backed out changeset 605e19d02f88 (bug 1849075)
2024-05-14 12:48:46 +03:00
Mike Hommey
2a34eeeb8e Bug 1849075 - Update builders to clang 18. r=firefox-build-system-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D208955
2024-05-14 07:10:43 +00:00
Cristian Tuns
90e24fdcd4 Backed out 4 changesets (bug 1878764, bug 1894860, bug 1849075) for causing multiple Gtest failures. CLOSED TREE
Backed out changeset 1b6f68a55002 (bug 1878764)
Backed out changeset dbcef036309d (bug 1894860)
Backed out changeset 440056d02985 (bug 1878764)
Backed out changeset df59a0aca986 (bug 1849075)
2024-05-04 18:03:30 -04:00
Cristian Tuns
f1b98639a2 Bug 1878764 - Fix clang-format linting failures r=fix CLOSED TREE 2024-05-04 16:50:24 -04:00
Mike Hommey
e04ecb53da 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
e7dfef952a 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
71ef2ef145 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
a0250964cb 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
aa63ce8d89 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
6fa9186950 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
246363b9d5 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
b5e8a05cc7 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
0cf48c3100 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
64ccacb4a7 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
a7eddf8e4c 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
789cc6bf88 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
f3a263c5a4 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
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