Skip to content

Commit 0a43258

Browse files
committed
Merge remote-tracking branch 'tstellar/release-binaries-cleanup' into release-windows
2 parents 2e20a55 + 7adc23f commit 0a43258

File tree

64 files changed

+4243
-3048
lines changed

Some content is hidden

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

64 files changed

+4243
-3048
lines changed

.github/workflows/release-binaries-save-stage/action.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/release-binaries-setup-stage/action.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/workflows/release-binaries.yml

Lines changed: 29 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -201,40 +201,39 @@ jobs:
201201
runs-on: ${{ needs.prepare.outputs.build-runs-on }}
202202
steps:
203203

204-
- name: Checkout Actions
205-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
206-
with:
207-
ref: ${{ (github.event_name == 'pull_request' && github.sha) || 'main' }}
208-
sparse-checkout: |
209-
.github/workflows/
210-
sparse-checkout-cone-mode: false
211-
# Check out outside of working directory so the source checkout doesn't
212-
# remove it.
213-
path: workflows
214-
215-
# actions/checkout does not support paths outside of the GITHUB_WORKSPACE.
216-
# Also, anything that we put inside of GITHUB_WORKSPACE will be overwritten
217-
# by future actions/checkout steps. Therefore, in order to checkout the
218-
# latest actions from main, we need to first checkout out the actions inside of
219-
# GITHUB_WORKSPACE (see previous step), then use actions/checkout to checkout
220-
# the code being built and the move the actions from main back into GITHUB_WORKSPACE,
221-
# becasue the uses on composite actions only reads workflows from inside GITHUB_WORKSPACE.
222-
- shell: bash
223-
run: mv workflows ../workflows-main
224-
225204
- name: Checkout LLVM
226205
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
227206
with:
228207
ref: ${{ needs.prepare.outputs.ref }}
229208

230-
- name: Copy main workflows
231-
shell: bash
209+
- name: Install Ninja
210+
uses: llvm/actions/install-ninja@a1ea791b03c8e61f53a0e66f2f73db283aa0f01e # main
211+
212+
- name: Setup Windows
213+
if: startsWith(runner.os, 'Windows')
214+
uses: llvm/actions/setup-windows@main
215+
with:
216+
arch: amd64
217+
218+
# In order to avoid some errors with long paths names, we need to shorten
219+
# the path names for the build.
220+
- name: Shorten paths on Windows
221+
if: startsWith(runner.os, 'Windows')
232222
run: |
233-
mv ../workflows-main .
223+
subst S: ${{ github.workspace }}
234224
235-
- name: Setup Stage
225+
- name: Set Build Prefix
236226
id: setup-stage
237-
uses: ./workflows-main/.github/workflows/release-binaries-setup-stage
227+
shell: bash
228+
run: |
229+
build_prefix=`pwd`
230+
if [ "${{ runner.os }}" = "Linux" ]; then
231+
sudo chown $USER:$USER /mnt/
232+
build_prefix=/mnt/
233+
elif [ "${{ runner.os }}" = "Windows" ]; then
234+
build_prefix=/s/
235+
fi
236+
echo "build-prefix=$build_prefix" >> $GITHUB_OUTPUT
238237
239238
# We will use Wix to generate the installer on Windows, because this supports
240239
# installers > 2GB.
@@ -271,17 +270,11 @@ jobs:
271270
path: |
272271
${{ needs.prepare.outputs.release-binary-filename }}
273272
274-
# Clean up some build files to reduce size of artifact.
275-
- name: Clean Up Build Directory
276-
shell: bash
273+
- name: Run Tests
274+
# These almost always fail so don't let them fail the build and prevent the uploads.
275+
continue-on-error: true
277276
run: |
278-
find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname ${{ needs.prepare.outputs.release-binary-filename }} -delete
279-
find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname _CPack_Packages -prune -exec rm -r {} +
280-
281-
- name: Save Stage
282-
uses: ./workflows-main/.github/workflows/release-binaries-save-stage
283-
with:
284-
build-prefix: ${{ steps.setup-stage.outputs.build-prefix }}
277+
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-check-all
285278
286279
upload-release-binaries:
287280
name: "Upload Release Binaries"
@@ -340,31 +333,3 @@ jobs:
340333
--release ${{ needs.prepare.outputs.release-version }} \
341334
upload \
342335
--files ${{ needs.prepare.outputs.release-binary-filename }}*
343-
344-
test-release:
345-
name: "Test Release"
346-
needs:
347-
- prepare
348-
- build-release-package
349-
if: >-
350-
github.repository_owner == 'llvm'
351-
runs-on: ${{ needs.prepare.outputs.test-runs-on }}
352-
steps:
353-
- name: Checkout Actions
354-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
355-
with:
356-
ref: ${{ (github.event_name == 'pull_request' && github.sha) || 'main' }}
357-
sparse-checkout: |
358-
.github/workflows/
359-
sparse-checkout-cone-mode: false
360-
path: workflows
361-
- name: Setup Stage
362-
id: setup-stage
363-
uses: ./workflows/.github/workflows/release-binaries-setup-stage
364-
with:
365-
previous-artifact: build-release-package
366-
367-
- name: Run Tests
368-
shell: bash
369-
run: |
370-
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-check-all

clang/include/clang/Basic/Sanitizers.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,6 @@ SANITIZER_GROUP("bounds", Bounds, ArrayBounds | LocalBounds)
195195
// Scudo hardened allocator
196196
SANITIZER("scudo", Scudo)
197197

198-
// AllocToken
199-
SANITIZER("alloc-token", AllocToken)
200-
201198
// Magic group, containing all sanitizers. For example, "-fno-sanitize=all"
202199
// can be used to disable all the sanitizers.
203200
SANITIZER_GROUP("all", All, ~SanitizerMask())

clang/lib/Basic/SanitizerSpecialCaseList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void SanitizerSpecialCaseList::createSanitizerSections() {
4242
SanitizerMask Mask;
4343

4444
#define SANITIZER(NAME, ID) \
45-
if (S.SectionMatcher.match(NAME)) \
45+
if (S.SectionMatcher.matchAny(NAME)) \
4646
Mask |= SanitizerKind::ID;
4747
#define SANITIZER_GROUP(NAME, ID, ALIAS) SANITIZER(NAME, ID)
4848

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,23 +1272,6 @@ void CodeGenFunction::EmitBoundsCheckImpl(const Expr *E, llvm::Value *Bound,
12721272
EmitCheck(std::make_pair(Check, CheckKind), CheckHandler, StaticData, Index);
12731273
}
12741274

1275-
void CodeGenFunction::EmitAllocToken(llvm::CallBase *CB, QualType AllocType) {
1276-
assert(SanOpts.has(SanitizerKind::AllocToken) &&
1277-
"Only needed with -fsanitize=alloc-token");
1278-
1279-
PrintingPolicy Policy(CGM.getContext().getLangOpts());
1280-
Policy.SuppressTagKeyword = true;
1281-
Policy.FullyQualifiedName = true;
1282-
SmallString<64> TypeName;
1283-
llvm::raw_svector_ostream TypeNameOS(TypeName);
1284-
AllocType.getCanonicalType().print(TypeNameOS, Policy);
1285-
auto *TypeMDS = llvm::MDString::get(CGM.getLLVMContext(), TypeNameOS.str());
1286-
1287-
// Format: !{<type-name>}
1288-
auto *MDN = llvm::MDNode::get(CGM.getLLVMContext(), {TypeMDS});
1289-
CB->setMetadata(llvm::LLVMContext::MD_alloc_token, MDN);
1290-
}
1291-
12921275
CodeGenFunction::ComplexPairTy CodeGenFunction::
12931276
EmitComplexPrePostIncDec(const UnaryOperator *E, LValue LV,
12941277
bool isInc, bool isPre) {

clang/lib/CodeGen/CGExprCXX.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,16 +1655,11 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
16551655
RValue RV =
16561656
EmitNewDeleteCall(*this, allocator, allocatorType, allocatorArgs);
16571657

1658-
if (auto *newCall = dyn_cast<llvm::CallBase>(RV.getScalarVal())) {
1659-
if (auto *CGDI = getDebugInfo()) {
1660-
// Set !heapallocsite metadata on the call to operator new.
1661-
CGDI->addHeapAllocSiteMetadata(newCall, allocType, E->getExprLoc());
1662-
}
1663-
if (SanOpts.has(SanitizerKind::AllocToken)) {
1664-
// Set !alloc_token metadata.
1665-
EmitAllocToken(newCall, allocType);
1666-
}
1667-
}
1658+
// Set !heapallocsite metadata on the call to operator new.
1659+
if (getDebugInfo())
1660+
if (auto *newCall = dyn_cast<llvm::CallBase>(RV.getScalarVal()))
1661+
getDebugInfo()->addHeapAllocSiteMetadata(newCall, allocType,
1662+
E->getExprLoc());
16681663

16691664
// If this was a call to a global replaceable allocation function that does
16701665
// not take an alignment argument, the allocator is known to produce

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,6 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
846846
Fn->addFnAttr(llvm::Attribute::SanitizeNumericalStability);
847847
if (SanOpts.hasOneOf(SanitizerKind::Memory | SanitizerKind::KernelMemory))
848848
Fn->addFnAttr(llvm::Attribute::SanitizeMemory);
849-
if (SanOpts.has(SanitizerKind::AllocToken))
850-
Fn->addFnAttr(llvm::Attribute::SanitizeAllocToken);
851849
}
852850
if (SanOpts.has(SanitizerKind::SafeStack))
853851
Fn->addFnAttr(llvm::Attribute::SafeStack);

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3348,9 +3348,6 @@ class CodeGenFunction : public CodeGenTypeCache {
33483348
SanitizerAnnotateDebugInfo(ArrayRef<SanitizerKind::SanitizerOrdinal> Ordinals,
33493349
SanitizerHandler Handler);
33503350

3351-
/// Emit additional metadata used by the AllocToken instrumentation.
3352-
void EmitAllocToken(llvm::CallBase *CB, QualType AllocType);
3353-
33543351
llvm::Value *GetCountedByFieldExprGEP(const Expr *Base, const FieldDecl *FD,
33553352
const FieldDecl *CountDecl);
33563353

compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ void InitializePlatform() {
415415
// is not compiled with -pie.
416416
#if !SANITIZER_GO
417417
{
418-
# if SANITIZER_LINUX && (defined(__aarch64__) || defined(__loongarch_lp64))
418+
# if INIT_LONGJMP_XOR_KEY
419419
// Initialize the xor key used in {sig}{set,long}jump.
420420
InitializeLongjmpXorKey();
421421
# endif
@@ -486,7 +486,7 @@ int ExtractRecvmsgFDs(void *msgp, int *fds, int nfd) {
486486

487487
// Reverse operation of libc stack pointer mangling
488488
static uptr UnmangleLongJmpSp(uptr mangled_sp) {
489-
# if SANITIZER_ANDROID
489+
# if SANITIZER_ANDROID && INIT_LONGJMP_XOR_KEY
490490
if (longjmp_xor_key == 0) {
491491
// bionic libc initialization process: __libc_init_globals ->
492492
// __libc_init_vdso (calls strcmp) -> __libc_init_setjmp_cookie. strcmp is

0 commit comments

Comments
 (0)