Skip to content

Commit f1e8406

Browse files
committed
Merge remote-tracking branch 'parent/main' into wasmlibunwindfix
2 parents 5e5bbf8 + d4bed61 commit f1e8406

File tree

4,009 files changed

+234878
-163674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,009 files changed

+234878
-163674
lines changed

.ci/generate_test_report.py

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,8 @@ def test_report_size_limit(self):
309309
# If include failures is False, total number of test will be reported but their names
310310
# and output will not be.
311311
def _generate_report(title, junit_objects, size_limit=1024 * 1024, list_failures=True):
312-
style = None
313-
314312
if not junit_objects:
315-
return ("", style)
313+
return ("", "success")
316314

317315
failures = {}
318316
tests_run = 0
@@ -403,22 +401,23 @@ def generate_report(title, junit_files):
403401

404402
report, style = generate_report(args.title, args.junit_files)
405403

406-
p = subprocess.Popen(
407-
[
408-
"buildkite-agent",
409-
"annotate",
410-
"--context",
411-
args.context,
412-
"--style",
413-
style,
414-
],
415-
stdin=subprocess.PIPE,
416-
stderr=subprocess.PIPE,
417-
universal_newlines=True,
418-
)
404+
if report:
405+
p = subprocess.Popen(
406+
[
407+
"buildkite-agent",
408+
"annotate",
409+
"--context",
410+
args.context,
411+
"--style",
412+
style,
413+
],
414+
stdin=subprocess.PIPE,
415+
stderr=subprocess.PIPE,
416+
universal_newlines=True,
417+
)
419418

420-
# The report can be larger than the buffer for command arguments so we send
421-
# it over stdin instead.
422-
_, err = p.communicate(input=report)
423-
if p.returncode:
424-
raise RuntimeError(f"Failed to send report to buildkite-agent:\n{err}")
419+
# The report can be larger than the buffer for command arguments so we send
420+
# it over stdin instead.
421+
_, err = p.communicate(input=report)
422+
if p.returncode:
423+
raise RuntimeError(f"Failed to send report to buildkite-agent:\n{err}")

.github/new-issues-labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@
2727

2828
'bolt':
2929
- '/\bbolt(?!\-)\b/i'
30+
31+
'infra:commit-access-request':
32+
- '/Request Commit Access/'

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,11 @@ concurrency:
3333
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
3434
cancel-in-progress: true
3535

36-
37-
env:
38-
# LLVM POST-BRANCH bump version
39-
# LLVM POST-BRANCH add compiler test for ToT - 1, e.g. "Clang 17"
40-
# LLVM RELEASE bump remove compiler ToT - 3, e.g. "Clang 15"
41-
LLVM_HEAD_VERSION: "19" # Used compiler, update POST-BRANCH.
42-
LLVM_PREVIOUS_VERSION: "18"
43-
LLVM_OLDEST_VERSION: "17"
44-
GCC_STABLE_VERSION: "13"
45-
LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-19"
46-
CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics"
47-
48-
4936
jobs:
5037
stage1:
5138
if: github.repository_owner == 'llvm'
52-
runs-on: libcxx-runners-set
53-
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
39+
runs-on: libcxx-self-hosted-linux
40+
container: ghcr.io/llvm/libcxx-linux-builder:0fd6f684b9c84c32d6cbfd9742402e788b2879f1
5441
continue-on-error: false
5542
strategy:
5643
fail-fast: false
@@ -86,8 +73,8 @@ jobs:
8673
**/crash_diagnostics/*
8774
stage2:
8875
if: github.repository_owner == 'llvm'
89-
runs-on: libcxx-runners-set
90-
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
76+
runs-on: libcxx-self-hosted-linux
77+
container: ghcr.io/llvm/libcxx-linux-builder:0fd6f684b9c84c32d6cbfd9742402e788b2879f1
9178
needs: [ stage1 ]
9279
continue-on-error: false
9380
strategy:
@@ -161,21 +148,21 @@ jobs:
161148
'generic-static',
162149
'bootstrapping-build'
163150
]
164-
machine: [ 'libcxx-runners-set' ]
151+
machine: [ 'libcxx-self-hosted-linux' ]
165152
include:
166153
- config: 'generic-cxx26'
167-
machine: libcxx-runners-set
154+
machine: libcxx-self-hosted-linux
168155
- config: 'generic-asan'
169-
machine: libcxx-runners-set
156+
machine: libcxx-self-hosted-linux
170157
- config: 'generic-tsan'
171-
machine: libcxx-runners-set
158+
machine: libcxx-self-hosted-linux
172159
- config: 'generic-ubsan'
173-
machine: libcxx-runners-set
160+
machine: libcxx-self-hosted-linux
174161
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
175162
- config: 'generic-msan'
176-
machine: libcxx-runners-set
163+
machine: libcxx-self-hosted-linux
177164
runs-on: ${{ matrix.machine }}
178-
container: ghcr.io/libcxx/actions-builder:testing-2024-09-21
165+
container: ghcr.io/llvm/libcxx-linux-builder:0fd6f684b9c84c32d6cbfd9742402e788b2879f1
179166
steps:
180167
- uses: actions/checkout@v4
181168
- name: ${{ matrix.config }}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This file defines an action that builds the various Docker images used to run
2+
# libc++ CI whenever modifications to those Docker files are pushed to `main`.
3+
#
4+
# The images are pushed to the LLVM package registry at https://github.com/orgs/llvm/packages
5+
# and tagged appropriately. The selection of which Docker image version is used by the libc++
6+
# CI nodes at any given point is controlled from the workflow files themselves.
7+
8+
name: Build Docker images for libc++ CI
9+
10+
permissions:
11+
contents: read
12+
packages: write
13+
14+
on:
15+
push:
16+
branches:
17+
- main
18+
paths:
19+
- 'libcxx/utils/ci/**'
20+
- '.github/workflows/libcxx-build-containers.yml'
21+
pull_request:
22+
branches:
23+
- main
24+
paths:
25+
- 'libcxx/utils/ci/**'
26+
- '.github/workflows/libcxx-build-containers.yml'
27+
28+
jobs:
29+
build-and-push:
30+
runs-on: ubuntu-latest
31+
if: github.repository_owner == 'llvm'
32+
permissions:
33+
packages: write
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Build the Linux builder image
39+
working-directory: libcxx/utils/ci
40+
run: docker compose build actions-builder
41+
env:
42+
TAG: ${{ github.sha }}
43+
44+
# - name: Build the Android builder image
45+
# working-directory: libcxx/utils/ci
46+
# run: docker compose build android-buildkite-builder
47+
# env:
48+
# TAG: ${{ github.sha }}
49+
50+
- name: Log in to GitHub Container Registry
51+
uses: docker/login-action@v3
52+
with:
53+
registry: ghcr.io
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Push the Linux builder image
58+
if: github.event_name == 'push'
59+
working-directory: libcxx/utils/ci
60+
run: |
61+
docker compose push actions-builder
62+
env:
63+
TAG: ${{ github.sha }}
64+
65+
# - name: Push the Android builder image
66+
# if: github.event_name == 'push'
67+
# working-directory: libcxx/utils/ci
68+
# run: |
69+
# docker compose push android-buildkite-builder
70+
# env:
71+
# TAG: ${{ github.sha }}

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,11 @@ class BinaryFunction {
527527
/// fragment of the function.
528528
SmallVector<MCSymbol *, 0> LSDASymbols;
529529

530+
/// Each function fragment may have another fragment containing all landing
531+
/// pads for it. If that's the case, the LP fragment will be stored in the
532+
/// vector below with indexing starting with the main fragment.
533+
SmallVector<std::optional<FragmentNum>, 0> LPFragments;
534+
530535
/// Map to discover which CFIs are attached to a given instruction offset.
531536
/// Maps an instruction offset into a FrameInstructions offset.
532537
/// This is only relevant to the buildCFG phase and is discarded afterwards.
@@ -1885,6 +1890,42 @@ class BinaryFunction {
18851890
return LSDASymbols[F.get()];
18861891
}
18871892

1893+
/// If all landing pads for the function fragment \p F are located in fragment
1894+
/// \p LPF, designate \p LPF as a landing-pad fragment for \p F. Passing
1895+
/// std::nullopt in LPF, means that landing pads for \p F are located in more
1896+
/// than one fragment.
1897+
void setLPFragment(const FragmentNum F, std::optional<FragmentNum> LPF) {
1898+
if (F.get() >= LPFragments.size())
1899+
LPFragments.resize(F.get() + 1);
1900+
1901+
LPFragments[F.get()] = LPF;
1902+
}
1903+
1904+
/// If function fragment \p F has a designated landing pad fragment, i.e. a
1905+
/// fragment that contains all landing pads for throwers in \p F, then return
1906+
/// that landing pad fragment number. If \p F does not need landing pads,
1907+
/// return \p F. Return nullptr if landing pads for \p F are scattered among
1908+
/// several function fragments.
1909+
std::optional<FragmentNum> getLPFragment(const FragmentNum F) {
1910+
if (!isSplit()) {
1911+
assert(F == FragmentNum::main() && "Invalid fragment number");
1912+
return FragmentNum::main();
1913+
}
1914+
1915+
if (F.get() >= LPFragments.size())
1916+
return std::nullopt;
1917+
1918+
return LPFragments[F.get()];
1919+
}
1920+
1921+
/// Return a symbol corresponding to a landing pad fragment for fragment \p F.
1922+
/// See getLPFragment().
1923+
MCSymbol *getLPStartSymbol(const FragmentNum F) {
1924+
if (std::optional<FragmentNum> LPFragment = getLPFragment(F))
1925+
return getSymbol(*LPFragment);
1926+
return nullptr;
1927+
}
1928+
18881929
void setOutputDataAddress(uint64_t Address) { OutputDataOffset = Address; }
18891930

18901931
uint64_t getOutputDataAddress() const { return OutputDataOffset; }

bolt/include/bolt/Core/BinarySection.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class BinarySection {
8787
// been renamed)
8888
uint64_t OutputAddress{0}; // Section address for the rewritten binary.
8989
uint64_t OutputSize{0}; // Section size in the rewritten binary.
90+
// Can exceed OutputContents with padding.
9091
uint64_t OutputFileOffset{0}; // File offset in the rewritten binary file.
9192
StringRef OutputContents; // Rewritten section contents.
9293
const uint64_t SectionNumber; // Order in which the section was created.
@@ -474,6 +475,11 @@ class BinarySection {
474475
/// Use name \p SectionName for the section during the emission.
475476
void emitAsData(MCStreamer &Streamer, const Twine &SectionName) const;
476477

478+
/// Write finalized contents of the section. If OutputSize exceeds the size of
479+
/// the OutputContents, append zero padding to the stream and return the
480+
/// number of byte written which should match the OutputSize.
481+
uint64_t write(raw_ostream &OS) const;
482+
477483
using SymbolResolverFuncTy = llvm::function_ref<uint64_t(const MCSymbol *)>;
478484

479485
/// Flush all pending relocations to patch original contents of sections
@@ -497,6 +503,9 @@ class BinarySection {
497503
IsFinalized = true;
498504
}
499505

506+
/// When writing section contents, add \p PaddingSize zero bytes at the end.
507+
void addPadding(uint64_t PaddingSize) { OutputSize += PaddingSize; }
508+
500509
/// Reorder the contents of this section according to /p Order. If
501510
/// /p Inplace is true, the entire contents of the section is reordered,
502511
/// otherwise the new contents contain only the reordered data.

0 commit comments

Comments
 (0)