Skip to content

Commit a656219

Browse files
rebase
Created using spr 1.3.7
2 parents 60f5eec + 508bb16 commit a656219

File tree

1,035 files changed

+39521
-13316
lines changed

Some content is hidden

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

1,035 files changed

+39521
-13316
lines changed

.ci/generate_test_report_lib.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ def generate_report(
184184
if return_code == 0:
185185
report.extend(
186186
[
187-
"The build succeeded and no tests ran. This is expected in some "
188-
"build configurations."
187+
":white_check_mark: The build succeeded and no tests ran. "
188+
"This is expected in some build configurations."
189189
]
190190
)
191191
else:
@@ -272,6 +272,10 @@ def plural(num_tests):
272272
]
273273
)
274274
report.extend(_format_failures(ninja_failures, failure_explanations))
275+
else:
276+
report.extend(
277+
["", ":white_check_mark: The build succeeded and all tests passed."]
278+
)
275279

276280
if failures or return_code != 0:
277281
report.extend(["", UNRELATED_FAILURES_STR])

.ci/generate_test_report_lib_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def test_title_only(self):
194194
"""\
195195
# Foo
196196
197-
The build succeeded and no tests ran. This is expected in some build configurations."""
197+
:white_check_mark: The build succeeded and no tests ran. This is expected in some build configurations."""
198198
),
199199
)
200200

@@ -308,7 +308,9 @@ def test_no_failures(self):
308308
"""\
309309
# Foo
310310
311-
* 1 test passed"""
311+
* 1 test passed
312+
313+
:white_check_mark: The build succeeded and all tests passed."""
312314
)
313315
),
314316
)

.github/workflows/issue-write-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Issue Write Workflow
1+
name: Test Issue Write
22

33
permissions:
44
contents: read

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ jobs:
223223
source .venv/bin/activate
224224
python -m pip install psutil
225225
xcrun bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
226+
env:
227+
CC: clang
228+
CXX: clang++
226229
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
227230
if: always() # Upload artifacts even if the build or test suite fails
228231
with:
@@ -241,16 +244,16 @@ jobs:
241244
fail-fast: false
242245
matrix:
243246
include:
244-
- { config: clang-cl-dll, mingw: false }
245-
- { config: clang-cl-static, mingw: false }
246-
- { config: clang-cl-no-vcruntime, mingw: false }
247-
- { config: clang-cl-debug, mingw: false }
248-
- { config: clang-cl-static-crt, mingw: false }
249-
- { config: mingw-dll, mingw: true }
250-
- { config: mingw-static, mingw: true }
251-
- { config: mingw-dll-i686, mingw: true }
252-
- { config: mingw-incomplete-sysroot, mingw: true }
253-
- { config: mingw-static, mingw: true, runner: windows-11-arm }
247+
- { config: clang-cl-dll, mingw: false, cc: clang-cl, cxx: clang-cl }
248+
- { config: clang-cl-static, mingw: false, cc: clang-cl, cxx: clang-cl }
249+
- { config: clang-cl-no-vcruntime, mingw: false, cc: clang-cl, cxx: clang-cl }
250+
- { config: clang-cl-debug, mingw: false, cc: clang-cl, cxx: clang-cl }
251+
- { config: clang-cl-static-crt, mingw: false, cc: clang-cl, cxx: clang-cl }
252+
- { config: mingw-dll, mingw: true, cc: cc, cxx: c++ }
253+
- { config: mingw-dll, mingw: true, cc: i686-w64-mingw32-clang, cxx: i686-w64-mingw32-clang++ }
254+
- { config: mingw-static, mingw: true, cc: cc, cxx: c++ }
255+
- { config: mingw-incomplete-sysroot, mingw: true, cc: cc, cxx: c++ }
256+
- { config: mingw-static, mingw: true, cc: cc, cxx: c++, runner: windows-11-arm }
254257
runs-on: ${{ matrix.runner != '' && matrix.runner || 'windows-2022' }}
255258
steps:
256259
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
@@ -286,5 +289,7 @@ jobs:
286289
run: |
287290
echo "c:\Program Files\LLVM\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
288291
- name: Build and test
289-
run: |
290-
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
292+
run: bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
293+
env:
294+
CC: ${{ matrix.cc }}
295+
CXX: ${{ matrix.cxx }}

.github/workflows/libcxx-check-generated-files.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ jobs:
2222

2323
- name: Check generated files
2424
run: libcxx/utils/ci/run-buildbot check-generated-output
25+
env:
26+
CC: cc
27+
CXX: c++

.github/workflows/release-sources.yml

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ jobs:
6464
name: Package Release Sources
6565
if: github.repository_owner == 'llvm'
6666
runs-on: ubuntu-24.04
67+
outputs:
68+
digest: ${{ steps.digest.outputs.digest }}
69+
artifact-id: ${{ steps.artifact-upload.outputs.artifact-id }}
6770
needs:
6871
- inputs
69-
permissions:
70-
id-token: write
71-
attestations: write
7272
steps:
7373
- name: Checkout LLVM
7474
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
@@ -79,30 +79,47 @@ jobs:
7979
run: |
8080
pip install --require-hashes -r ./llvm/utils/git/requirements.txt
8181
82-
- name: Check Permissions
83-
if: github.event_name != 'pull_request'
84-
env:
85-
GITHUB_TOKEN: ${{ github.token }}
86-
USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
87-
run: |
88-
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user ${{ github.actor }} --user-token "$USER_TOKEN" check-permissions
8982
- name: Create Tarballs
9083
run: |
9184
./llvm/utils/release/export.sh ${{ needs.inputs.outputs.export-args }}
92-
- name: Attest Build Provenance
93-
if: github.event_name != 'pull_request'
94-
id: provenance
95-
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
96-
with:
97-
subject-path: "*.xz"
98-
- if: github.event_name != 'pull_request'
85+
86+
- name: Generate sha256 digest for sources
87+
id: digest
9988
run: |
100-
mv ${{ steps.provenance.outputs.bundle-path }} .
101-
- name: Create Tarball Artifacts
89+
echo "digest=$(cat *.xz | sha256sum | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
90+
91+
- name: Release Sources Artifact
92+
id: artifact-upload
10293
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
10394
with:
95+
name: ${{ needs.inputs.outputs.ref }}-sources
10496
path: |
10597
*.xz
106-
attestation.jsonl
10798
99+
attest-release-sources:
100+
name: Attest Release Sources
101+
runs-on: ubuntu-24.04
102+
if: github.event_name != 'pull_request'
103+
needs:
104+
- inputs
105+
- release-sources
106+
permissions:
107+
id-token: write
108+
attestations: write
109+
steps:
110+
- name: Checkout Release Scripts
111+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
112+
with:
113+
sparse-checkout: |
114+
.github/workflows/upload-release-artifact
115+
llvm/utils/release/github-upload-release.py
116+
llvm/utils/git/requirements.txt
117+
sparse-checkout-cone-mode: false
108118

119+
- name: Upload Artifacts
120+
uses: ./.github/workflows/upload-release-artifact
121+
with:
122+
artifact-id: ${{ needs.release-sources.outputs.artifact-id }}
123+
attestation-name: ${{ needs.inputs.outputs.ref }}-sources-attestation
124+
digest: ${{ needs.release-sources.outputs.digest }}
125+
upload: false

.github/workflows/test-unprivileged-download-artifact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
runs-on: ubuntu-24.04
4646
needs: [ upload-test-artifact ]
4747
steps:
48-
- name: Chekcout LLVM
48+
- name: Checkout LLVM
4949
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5050
with:
5151
sparse-checkout: |
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Upload Release Artifact
2+
description: >-
3+
Upload release artifact along with an attestation. The action assumes that
4+
the llvm-project repository has already been checked out.
5+
inputs:
6+
release-version:
7+
description: >-
8+
The release where the artifact will be attached.
9+
required: true
10+
upload:
11+
description: >-
12+
Whether or not to upload the file and attestation to the release. If this
13+
is set to false, then the file will be uploaded to the job as an artifact,
14+
but no atteastion will be generated and the artifact won't be uploaded
15+
to the release.
16+
default: true
17+
user-token:
18+
description: >-
19+
Token with premissions to read llvm teams that is used to ensure that
20+
the person who triggred the action has permission to upload artifacts.
21+
This is required if upload is true.
22+
requred: false
23+
attestation-name:
24+
description: >-
25+
This will be used for the artifact name that is attached to the workflow and
26+
will be used as the basename for the attestation file which will be called
27+
$attestation-name.jsonl. If this is not set, it will default
28+
to the falue of `files`.
29+
required: false
30+
artifact-id:
31+
description: >-
32+
Artifact id of the artifact with the files to upload.
33+
required: true
34+
digest:
35+
description: >-
36+
sha256 digest to verify the authenticity of the files being uploaded.
37+
required: true
38+
39+
runs:
40+
using: "composite"
41+
steps:
42+
- name: Download Artifact
43+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
44+
id: download-artifact
45+
with:
46+
artifact-ids: ${{ inputs.artifact-id }}
47+
path: downloads
48+
49+
# In theory github artifacts are immutable so we could just rely on using
50+
# the artifact-id to download it, but just to be extra safe we want to
51+
# generated a digest for the files we are uploading so we can verify it
52+
# when downloading.
53+
# See also: https://irsl.medium.com/github-artifact-immutability-is-a-lie-9b6244095694
54+
- name: Verify Files
55+
shell: bash
56+
env:
57+
INPUTS_DIGEST: ${{ inputs.digest }}
58+
run: |
59+
digest_file="sha256"
60+
echo "$INPUTS_DIGEST -" > $digest_file
61+
cat ${{ steps.download-artifact.outputs.download-path }}/* | sha256sum -c $digest_file
62+
63+
- name: Attest Build Provenance
64+
id: provenance
65+
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
66+
with:
67+
subject-path: ${{ steps.download-artifact.outputs.download-path }}/*
68+
69+
- name: Rename attestation file
70+
shell: bash
71+
env:
72+
INPUTS_ATTESTATION_NAME: ${{ inputs.attestation-name }}
73+
run: |
74+
mv ${{ steps.provenance.outputs.bundle-path }} "$INPUTS_ATTESTATION_NAME".jsonl
75+
76+
- name: Upload Build Provenance
77+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
78+
with:
79+
name: ${{ inputs.attestation-name }}
80+
path: |
81+
${{ inputs.attestation-name }}.jsonl
82+
83+
- name: Install Python Requirements
84+
if: inputs.upload == 'true'
85+
shell: bash
86+
run: |
87+
pip install --require-hashes -r ./llvm/utils/git/requirements.txt
88+
89+
- name: Check Permissions
90+
if: inputs.upload == 'true'
91+
env:
92+
GITHUB_TOKEN: ${{ github.token }}
93+
USER_TOKEN: ${{ inputs.user-token }}
94+
shell: bash
95+
run: |
96+
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --user "$GITHUB_ACTOR" --user-token "$USER_TOKEN" check-permissions
97+
- name: Upload Release
98+
shell: bash
99+
if: inputs.upload == 'true'
100+
run: |
101+
./llvm/utils/release/github-upload-release.py \
102+
--token ${{ github.token }} \
103+
--release ${{ inputs.release-version }} \
104+
upload \
105+
--files ${{ steps.download-artifact.outputs.download-path }}/* ${{ steps.vars.outputs.attestation-name}}.jsonl

bolt/docs/BAT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Functions table:
6161

6262
### Functions table
6363
Hot and cold functions tables share the encoding except differences marked below.
64+
6465
Header:
6566
| Entry | Encoding | Description |
6667
| ------ | ----- | ----------- |

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ namespace opts {
8080
extern cl::list<std::string> HotTextMoveSections;
8181
extern cl::opt<bool> Hugify;
8282
extern cl::opt<bool> Instrument;
83+
extern cl::opt<uint32_t> InstrumentationSleepTime;
8384
extern cl::opt<bool> KeepNops;
8485
extern cl::opt<bool> Lite;
8586
extern cl::list<std::string> PrintOnly;
@@ -1507,6 +1508,9 @@ Error RewriteInstance::discoverRtFiniAddress() {
15071508
}
15081509

15091510
if (!BC->FiniArrayAddress || !BC->FiniArraySize) {
1511+
// Missing fini hooks are allowed when instrumentation-sleep-time is in use.
1512+
if (opts::InstrumentationSleepTime > 0)
1513+
return Error::success();
15101514
return createStringError(
15111515
std::errc::not_supported,
15121516
"Instrumentation needs either DT_FINI or DT_FINI_ARRAY");
@@ -1616,9 +1620,13 @@ Error RewriteInstance::updateRtFiniReloc() {
16161620
if (!RT || !RT->getRuntimeFiniAddress())
16171621
return Error::success();
16181622

1619-
if (!BC->FiniArrayAddress || !BC->FiniArraySize)
1623+
if (!BC->FiniArrayAddress || !BC->FiniArraySize) {
1624+
// Missing fini hooks are allowed when instrumentation-sleep-time is in use.
1625+
if (opts::InstrumentationSleepTime > 0)
1626+
return Error::success();
16201627
return createStringError(std::errc::not_supported,
16211628
"inconsistent .fini_array state");
1629+
}
16221630

16231631
ErrorOr<BinarySection &> FiniArraySection =
16241632
BC->getSectionForAddress(*BC->FiniArrayAddress);

0 commit comments

Comments
 (0)