[llvm-branch-commits] [compiler-rt] ab1a05d - Revert "[sanitizer-common] Pickup llvm-symbolizer from $OUT/bin IFF exists."
Author: Mitch Phillips Date: 2020-12-17T16:17:56-08:00 New Revision: ab1a05d57f6f10ed36372ae47dad828c5202d07a URL: https://github.com/llvm/llvm-project/commit/ab1a05d57f6f10ed36372ae47dad828c5202d07a DIFF: https://github.com/llvm/llvm-project/commit/ab1a05d57f6f10ed36372ae47dad828c5202d07a.diff LOG: Revert "[sanitizer-common] Pickup llvm-symbolizer from $OUT/bin IFF exists." This reverts commit 30d292ddbb7ec84b422738cf52ee0cf49b0369f3. Broke the bots, reverting for full fix. Added: Modified: compiler-rt/test/sanitizer_common/lit.common.cfg.py compiler-rt/test/sanitizer_common/lit.site.cfg.py.in Removed: diff --git a/compiler-rt/test/sanitizer_common/lit.common.cfg.py b/compiler-rt/test/sanitizer_common/lit.common.cfg.py index 1f037c00eb15..f7c526b6b37b 100644 --- a/compiler-rt/test/sanitizer_common/lit.common.cfg.py +++ b/compiler-rt/test/sanitizer_common/lit.common.cfg.py @@ -46,9 +46,10 @@ # If the user has a poisoned *SAN_SYMBOLIZER_PATH (like what's setup by # build/envsetup.sh on Android), then they can end up with an out-of-date # symbolizer for the tests. Ensure they get the one from the recent build tree. -symbolizer_path = os.path.join(config.binary_path, "bin", "llvm-symbolizer") -if os.path.exists(symbolizer_path): - default_tool_options += ['external_symbolizer_path=' + symbolizer_path] +symbolizer_path="''" +if len(config.binary_path): + symbolizer_path = os.path.join(config.binary_path, "llvm-symbolizer") +default_tool_options += ['external_symbolizer_path=' + symbolizer_path] default_tool_options_str = ':'.join(default_tool_options) if default_tool_options_str: diff --git a/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in b/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in index fa7e54e51e27..3ff7c44aeab4 100644 --- a/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in +++ b/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in @@ -5,7 +5,7 @@ config.name_suffix = "@CONFIG_NAME@" config.tool_name = "@SANITIZER_COMMON_LIT_TEST_MODE@" config.target_cflags = "@SANITIZER_COMMON_TEST_TARGET_CFLAGS@" config.target_arch = "@SANITIZER_COMMON_TEST_TARGET_ARCH@" -config.binary_path = "@LLVM_BINARY_DIR@" +config.binary_path = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] 13261f4 - Revert "[sanitizer-common] Force pickup of llvm-symbolizer from new binaries."
Author: Mitch Phillips Date: 2020-12-17T16:17:56-08:00 New Revision: 13261f4c03492542f756f5ec986510a89f4a1f4b URL: https://github.com/llvm/llvm-project/commit/13261f4c03492542f756f5ec986510a89f4a1f4b DIFF: https://github.com/llvm/llvm-project/commit/13261f4c03492542f756f5ec986510a89f4a1f4b.diff LOG: Revert "[sanitizer-common] Force pickup of llvm-symbolizer from new binaries." This reverts commit 66ee0d3d84a6ea04e895249aef2ea8a812664728. Broke the bots, reverting for full fix. Added: Modified: compiler-rt/test/sanitizer_common/lit.common.cfg.py compiler-rt/test/sanitizer_common/lit.site.cfg.py.in Removed: diff --git a/compiler-rt/test/sanitizer_common/lit.common.cfg.py b/compiler-rt/test/sanitizer_common/lit.common.cfg.py index f7c526b6b37b..b4f0670f9959 100644 --- a/compiler-rt/test/sanitizer_common/lit.common.cfg.py +++ b/compiler-rt/test/sanitizer_common/lit.common.cfg.py @@ -43,14 +43,6 @@ # which does not work for abort()-terminated programs. default_tool_options += ['abort_on_error=0'] -# If the user has a poisoned *SAN_SYMBOLIZER_PATH (like what's setup by -# build/envsetup.sh on Android), then they can end up with an out-of-date -# symbolizer for the tests. Ensure they get the one from the recent build tree. -symbolizer_path="''" -if len(config.binary_path): - symbolizer_path = os.path.join(config.binary_path, "llvm-symbolizer") -default_tool_options += ['external_symbolizer_path=' + symbolizer_path] - default_tool_options_str = ':'.join(default_tool_options) if default_tool_options_str: config.environment[tool_options] = default_tool_options_str diff --git a/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in b/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in index 3ff7c44aeab4..38f5ca158463 100644 --- a/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in +++ b/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in @@ -5,7 +5,6 @@ config.name_suffix = "@CONFIG_NAME@" config.tool_name = "@SANITIZER_COMMON_LIT_TEST_MODE@" config.target_cflags = "@SANITIZER_COMMON_TEST_TARGET_CFLAGS@" config.target_arch = "@SANITIZER_COMMON_TEST_TARGET_ARCH@" -config.binary_path = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] 5b7aef6 - Revert "[PDB] Defer relocating .debug$S until commit time and parallelize it"
Author: Mitch Phillips Date: 2021-01-19T11:45:48-08:00 New Revision: 5b7aef6eb4b2930971029b984cb2360f7682e5a5 URL: https://github.com/llvm/llvm-project/commit/5b7aef6eb4b2930971029b984cb2360f7682e5a5 DIFF: https://github.com/llvm/llvm-project/commit/5b7aef6eb4b2930971029b984cb2360f7682e5a5.diff LOG: Revert "[PDB] Defer relocating .debug$S until commit time and parallelize it" This reverts commit 6529d7c5a45b1b9588e512013b02f891d71bc134. Reason: Broke the ASan buildbots. http://lab.llvm.org:8011/#/builders/99/builds/1567 Added: Modified: lld/COFF/Chunks.cpp lld/COFF/Chunks.h lld/COFF/PDB.cpp llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h llvm/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp Removed: diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp index f2cdc24b7bf1..e04ceed505c2 100644 --- a/lld/COFF/Chunks.cpp +++ b/lld/COFF/Chunks.cpp @@ -369,88 +369,47 @@ void SectionChunk::writeTo(uint8_t *buf) const { continue; } -applyRelocation(buf + rel.VirtualAddress, rel); - } -} +uint8_t *off = buf + rel.VirtualAddress; -void SectionChunk::applyRelocation(uint8_t *off, - const coff_relocation &rel) const { - auto *sym = dyn_cast_or_null(file->getSymbol(rel.SymbolTableIndex)); - - // Get the output section of the symbol for this relocation. The output - // section is needed to compute SECREL and SECTION relocations used in debug - // info. - Chunk *c = sym ? sym->getChunk() : nullptr; - OutputSection *os = c ? c->getOutputSection() : nullptr; +auto *sym = +dyn_cast_or_null(file->getSymbol(rel.SymbolTableIndex)); - // Skip the relocation if it refers to a discarded section, and diagnose it - // as an error if appropriate. If a symbol was discarded early, it may be - // null. If it was discarded late, the output section will be null, unless - // it was an absolute or synthetic symbol. - if (!sym || - (!os && !isa(sym) && !isa(sym))) { -maybeReportRelocationToDiscarded(this, sym, rel); -return; - } +// Get the output section of the symbol for this relocation. The output +// section is needed to compute SECREL and SECTION relocations used in debug +// info. +Chunk *c = sym ? sym->getChunk() : nullptr; +OutputSection *os = c ? c->getOutputSection() : nullptr; + +// Skip the relocation if it refers to a discarded section, and diagnose it +// as an error if appropriate. If a symbol was discarded early, it may be +// null. If it was discarded late, the output section will be null, unless +// it was an absolute or synthetic symbol. +if (!sym || +(!os && !isa(sym) && !isa(sym))) { + maybeReportRelocationToDiscarded(this, sym, rel); + continue; +} - uint64_t s = sym->getRVA(); +uint64_t s = sym->getRVA(); - // Compute the RVA of the relocation for relative relocations. - uint64_t p = rva + rel.VirtualAddress; - switch (config->machine) { - case AMD64: -applyRelX64(off, rel.Type, os, s, p); -break; - case I386: -applyRelX86(off, rel.Type, os, s, p); -break; - case ARMNT: -applyRelARM(off, rel.Type, os, s, p); -break; - case ARM64: -applyRelARM64(off, rel.Type, os, s, p); -break; - default: -llvm_unreachable("unknown machine type"); - } -} - -// Defend against unsorted relocations. This may be overly conservative. -void SectionChunk::sortRelocations() { - auto cmpByVa = [](const coff_relocation &l, const coff_relocation &r) { -return l.VirtualAddress < r.VirtualAddress; - }; - if (llvm::is_sorted(getRelocs(), cmpByVa)) -return; - warn("some relocations in " + file->getName() + " are not sorted"); - MutableArrayRef newRelocs( - bAlloc.Allocate(relocsSize), relocsSize); - memcpy(newRelocs.data(), relocsData, relocsSize * sizeof(coff_relocation)); - llvm::sort(newRelocs, cmpByVa); - setRelocs(newRelocs); -} - -// Similar to writeTo, but suitable for relocating a subsection of the overall -// section. -void SectionChunk::writeAndRelocateSubsection(ArrayRef sec, - ArrayRef subsec, - uint32_t &nextRelocIndex, - uint8_t *buf) const { - assert(!subsec.empty() && !sec.empty()); - assert(sec.begin() <= subsec.begin() && subsec.end() <= sec.end() && - "subsection is not part of this section"); - size_t vaBegin = std::distance(sec.begin(), subsec.begin()); - size_t vaEnd = std::distance(sec.begin(), subsec.end()); - memcpy(buf, subsec.data(), subsec.size()); - for (; nextRelocIndex < relocsSize; ++nextRelocIndex) { -const coff_relocation &rel = relocsData[nextRelocIndex]; -// Skip relocations applied before this subsection. -if (rel.
[llvm-branch-commits] [llvm] 554b321 - Revert "[GlobalISel] LegalizerHelper - Extract widenScalarAddoSubo method"
Author: Mitch Phillips Date: 2021-01-22T14:32:11-08:00 New Revision: 554b3211fefd09b56b64357b9edd66c78ae200b5 URL: https://github.com/llvm/llvm-project/commit/554b3211fefd09b56b64357b9edd66c78ae200b5 DIFF: https://github.com/llvm/llvm-project/commit/554b3211fefd09b56b64357b9edd66c78ae200b5.diff LOG: Revert "[GlobalISel] LegalizerHelper - Extract widenScalarAddoSubo method" This reverts commit 2bb92bf451d7eb2c817f3e5403353e7c0c14d350. Dependent patch broke UBSan on Android: 3dedad475da45c05bc4f66cd14e9f44581edf0bc Added: Modified: llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir llvm/test/CodeGen/AArch64/GlobalISel/legalize-sub.mir llvm/test/CodeGen/AArch64/legalize-uaddo.mir llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-uaddo.mir llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-usubo.mir llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp Removed: diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h index c3b494e94ff1..2e9c7d8250ba 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h @@ -170,10 +170,8 @@ class LegalizerHelper { widenScalarExtract(MachineInstr &MI, unsigned TypeIdx, LLT WideTy); LegalizeResult widenScalarInsert(MachineInstr &MI, unsigned TypeIdx, LLT WideTy); - LegalizeResult widenScalarAddoSubo(MachineInstr &MI, unsigned TypeIdx, - LLT WideTy); - LegalizeResult widenScalarAddSubShlSat(MachineInstr &MI, unsigned TypeIdx, - LLT WideTy); + LegalizeResult + widenScalarAddSubShlSat(MachineInstr &MI, unsigned TypeIdx, LLT WideTy); /// Helper function to split a wide generic register into bitwise blocks with /// the given Type (which implies the number of blocks needed). The generic diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index e7f40523efaf..aef9e6f70c65 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -1757,34 +1757,6 @@ LegalizerHelper::widenScalarInsert(MachineInstr &MI, unsigned TypeIdx, return Legalized; } -LegalizerHelper::LegalizeResult -LegalizerHelper::widenScalarAddoSubo(MachineInstr &MI, unsigned TypeIdx, - LLT WideTy) { - if (TypeIdx == 1) -return UnableToLegalize; // TODO - unsigned Op = MI.getOpcode(); - unsigned Opcode = Op == TargetOpcode::G_UADDO || Op == TargetOpcode::G_SADDO -? TargetOpcode::G_ADD -: TargetOpcode::G_SUB; - unsigned ExtOpcode = - Op == TargetOpcode::G_UADDO || Op == TargetOpcode::G_USUBO - ? TargetOpcode::G_ZEXT - : TargetOpcode::G_SEXT; - auto LHSExt = MIRBuilder.buildInstr(ExtOpcode, {WideTy}, {MI.getOperand(2)}); - auto RHSExt = MIRBuilder.buildInstr(ExtOpcode, {WideTy}, {MI.getOperand(3)}); - // Do the arithmetic in the larger type. - auto NewOp = MIRBuilder.buildInstr(Opcode, {WideTy}, {LHSExt, RHSExt}); - LLT OrigTy = MRI.getType(MI.getOperand(0).getReg()); - auto TruncOp = MIRBuilder.buildTrunc(OrigTy, NewOp); - auto ExtOp = MIRBuilder.buildInstr(ExtOpcode, {WideTy}, {TruncOp}); - // There is no overflow if the ExtOp is the same as NewOp. - MIRBuilder.buildICmp(CmpInst::ICMP_NE, MI.getOperand(1), NewOp, ExtOp); - // Now trunc the NewOp to the original result. - MIRBuilder.buildTrunc(MI.getOperand(0), NewOp); - MI.eraseFromParent(); - return Legalized; -} - LegalizerHelper::LegalizeResult LegalizerHelper::widenScalarAddSubShlSat(MachineInstr &MI, unsigned TypeIdx, LLT WideTy) { @@ -1843,10 +1815,48 @@ LegalizerHelper::widenScalar(MachineInstr &MI, unsigned TypeIdx, LLT WideTy) { case TargetOpcode::G_UNMERGE_VALUES: return widenScalarUnmergeValues(MI, TypeIdx, WideTy); case TargetOpcode::G_SADDO: - case TargetOpcode::G_SSUBO: + case TargetOpcode::G_SSUBO: { +if (TypeIdx == 1) + return UnableToLegalize; // TODO +auto LHSExt = MIRBuilder.buildSExt(WideTy, MI.getOperand(2)); +auto RHSExt = MIRBuilder.buildSExt(WideTy, MI.getOperand(3)); +unsigned Opcode = MI.getOpcode() == TargetOpcode::G_SADDO + ? TargetOpcode::G_ADD + : TargetOpcode::G_SUB; +auto NewOp = MIRBuilder.buildInstr(Opcode, {WideTy}, {LHSExt, RHSExt}); +LLT OrigTy = MRI.getType(MI.getOperand(0).getReg()); +auto TruncOp = MIRBuilder.buildTrunc(OrigTy, NewOp); +auto ExtOp = MIRBuilder.buildSExt(WideTy, TruncOp); +// There is no overflow if the re-extended result is the same as NewOp. +MIRBuild
[llvm-branch-commits] [llvm] e3a7532 - Revert "[AArch64][GlobalISel] Implement widenScalar for signed overflow"
Author: Mitch Phillips Date: 2021-01-22T14:32:11-08:00 New Revision: e3a7532cc95ea0b7f748793db44caa95a92ad6d8 URL: https://github.com/llvm/llvm-project/commit/e3a7532cc95ea0b7f748793db44caa95a92ad6d8 DIFF: https://github.com/llvm/llvm-project/commit/e3a7532cc95ea0b7f748793db44caa95a92ad6d8.diff LOG: Revert "[AArch64][GlobalISel] Implement widenScalar for signed overflow" This reverts commit 541d98efa222b00e16c67348810898c2fa11f398. Reason: Dependent patch 3dedad475da45c05bc4f66cd14e9f44581edf0bc broke UBSan on Android: http://lab.llvm.org:8011/#/builders/77/builds/3082 Added: Modified: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir llvm/test/CodeGen/AArch64/GlobalISel/legalize-sub.mir Removed: diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index aef9e6f70c65..b9e32257d2c8 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -1814,26 +1814,6 @@ LegalizerHelper::widenScalar(MachineInstr &MI, unsigned TypeIdx, LLT WideTy) { return widenScalarMergeValues(MI, TypeIdx, WideTy); case TargetOpcode::G_UNMERGE_VALUES: return widenScalarUnmergeValues(MI, TypeIdx, WideTy); - case TargetOpcode::G_SADDO: - case TargetOpcode::G_SSUBO: { -if (TypeIdx == 1) - return UnableToLegalize; // TODO -auto LHSExt = MIRBuilder.buildSExt(WideTy, MI.getOperand(2)); -auto RHSExt = MIRBuilder.buildSExt(WideTy, MI.getOperand(3)); -unsigned Opcode = MI.getOpcode() == TargetOpcode::G_SADDO - ? TargetOpcode::G_ADD - : TargetOpcode::G_SUB; -auto NewOp = MIRBuilder.buildInstr(Opcode, {WideTy}, {LHSExt, RHSExt}); -LLT OrigTy = MRI.getType(MI.getOperand(0).getReg()); -auto TruncOp = MIRBuilder.buildTrunc(OrigTy, NewOp); -auto ExtOp = MIRBuilder.buildSExt(WideTy, TruncOp); -// There is no overflow if the re-extended result is the same as NewOp. -MIRBuilder.buildICmp(CmpInst::ICMP_NE, MI.getOperand(1), NewOp, ExtOp); -// Now trunc the NewOp to the original result. -MIRBuilder.buildTrunc(MI.getOperand(0), NewOp); -MI.eraseFromParent(); -return Legalized; - } case TargetOpcode::G_UADDO: case TargetOpcode::G_USUBO: { if (TypeIdx == 1) diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir index f3564a950310..4f97d153d28b 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir +++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir @@ -73,66 +73,6 @@ body: | %5:_(s64) = G_ANYEXT %4(s8) $x0 = COPY %5(s64) -... -name:test_scalar_uaddo_small -body: | - bb.0.entry: -; CHECK-LABEL: name: test_scalar_uaddo_small -; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 -; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 -; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 -; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) -; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]] -; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64) -; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]] -; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]] -; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]] -; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[AND2]] -; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ADD]](s32) -; CHECK: [[ANYEXT1:%[0-9]+]]:_(s64) = G_ANYEXT [[ICMP]](s32) -; CHECK: $x0 = COPY [[ANYEXT]](s64) -; CHECK: $x1 = COPY [[ANYEXT1]](s64) -%0:_(s64) = COPY $x0 -%1:_(s64) = COPY $x1 -%2:_(s8) = G_TRUNC %0(s64) -%3:_(s8) = G_TRUNC %1(s64) -%4:_(s8), %5:_(s1) = G_UADDO %2, %3 -%6:_(s64) = G_ANYEXT %4(s8) -%7:_(s64) = G_ANYEXT %5(s1) -$x0 = COPY %6(s64) -$x1 = COPY %7(s64) - -... -name:test_scalar_saddo_small -body: | - bb.0.entry: -; CHECK-LABEL: name: test_scalar_saddo_small -; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 -; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 -; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) -; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC]], 8 -; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64) -; CHECK: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC1]], 8 -; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[SEXT_INREG]], [[SEXT_INREG1]] -; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ADD]](s32) -; CHECK: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 8 -; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[SEXT_INREG2]] -; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ADD]](s32) -; CHECK: [[ANYEXT1:%[0-9
[llvm-branch-commits] [llvm] 19ec559 - Revert "[AArch64][GlobalISel] Make G_USUBO legal and select it."
Author: Mitch Phillips Date: 2021-01-22T14:32:12-08:00 New Revision: 19ec559c665e6490480cfdff9982b2c32a432b78 URL: https://github.com/llvm/llvm-project/commit/19ec559c665e6490480cfdff9982b2c32a432b78 DIFF: https://github.com/llvm/llvm-project/commit/19ec559c665e6490480cfdff9982b2c32a432b78.diff LOG: Revert "[AArch64][GlobalISel] Make G_USUBO legal and select it." This reverts commit 3dedad475da45c05bc4f66cd14e9f44581edf0bc. Broke UBSan on Android: http://lab.llvm.org:8011/#/builders/77/builds/3082 More details at: https://reviews.llvm.org/D95032 Added: Modified: llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir llvm/test/CodeGen/AArch64/GlobalISel/legalize-sub.mir llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir Removed: llvm/test/CodeGen/AArch64/GlobalISel/select-saddo.mir llvm/test/CodeGen/AArch64/GlobalISel/select-ssubo.mir llvm/test/CodeGen/AArch64/GlobalISel/select-usubo.mir diff --git a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp index 43ad18101069..9619bb43ae9c 100644 --- a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp @@ -2745,8 +2745,7 @@ bool AArch64InstructionSelector::select(MachineInstr &I) { } case TargetOpcode::G_SADDO: case TargetOpcode::G_UADDO: - case TargetOpcode::G_SSUBO: - case TargetOpcode::G_USUBO: { + case TargetOpcode::G_SSUBO: { // Emit the operation and get the correct condition code. MachineIRBuilder MIRBuilder(I); auto OpAndCC = emitOverflowOp(Opcode, I.getOperand(0).getReg(), @@ -4377,8 +4376,6 @@ AArch64InstructionSelector::emitOverflowOp(unsigned Opcode, Register Dst, return std::make_pair(emitADDS(Dst, LHS, RHS, MIRBuilder), AArch64CC::HS); case TargetOpcode::G_SSUBO: return std::make_pair(emitSUBS(Dst, LHS, RHS, MIRBuilder), AArch64CC::VS); - case TargetOpcode::G_USUBO: -return std::make_pair(emitSUBS(Dst, LHS, RHS, MIRBuilder), AArch64CC::HS); } } diff --git a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp index 5a6c904e3f5d..cc7aada211bb 100644 --- a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp @@ -165,8 +165,7 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST) getActionDefinitionsBuilder({G_SMULH, G_UMULH}).legalFor({s32, s64}); - getActionDefinitionsBuilder( - {G_UADDE, G_USUBE, G_SADDO, G_SSUBO, G_UADDO, G_USUBO}) + getActionDefinitionsBuilder({G_UADDE, G_USUBE, G_SADDO, G_SSUBO, G_UADDO}) .legalFor({{s32, s1}, {s64, s1}}) .minScalar(0, s32); diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir index 4f97d153d28b..ab8510bf9d92 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir +++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir @@ -73,44 +73,6 @@ body: | %5:_(s64) = G_ANYEXT %4(s8) $x0 = COPY %5(s64) -... -name:test_scalar_uaddo_32 -body: | - bb.0.entry: -; CHECK-LABEL: name: test_scalar_uaddo_32 -; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 -; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1 -; CHECK: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[COPY]], [[COPY1]] -; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[UADDO1]](s1) -; CHECK: $w0 = COPY [[UADDO]](s32) -; CHECK: $w1 = COPY [[ANYEXT]](s32) -%0:_(s32) = COPY $w0 -%1:_(s32) = COPY $w1 -%2:_(s32), %3:_(s1) = G_UADDO %0, %1 -%4:_(s32) = G_ANYEXT %3 -$w0 = COPY %2(s32) -$w1 = COPY %4(s32) - -... -name:test_scalar_saddo_32 -body: | - bb.0.entry: -; CHECK-LABEL: name: test_scalar_saddo_32 -; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 -; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1 -; CHECK: [[SADDO:%[0-9]+]]:_(s32), [[SADDO1:%[0-9]+]]:_(s1) = G_SADDO [[COPY]], [[COPY1]] -; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[SADDO1]](s1) -; CHECK: $w0 = COPY [[SADDO]](s32) -; CHECK: $w1 = COPY [[ANYEXT]](s32) -%0:_(s32) = COPY $w0 -%1:_(s32) = COPY $w1 -%2:_(s32), %3:_(s1) = G_SADDO %0, %1 -%4:_(s32) = G_ANYEXT %3 -$w0 = COPY %2(s32) -$w1 = COPY %4(s32) - ... --- name:test_vector_add diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-sub.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-sub.mir index b372a32eb7fc..32796e0948cc 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-sub.mir +++ b/llvm/test/CodeGen/AArch64/GlobalISel/legal
[llvm-branch-commits] [compiler-rt] 1f8031c - [android] Fix some tests for AOSP-master devices.
Author: Mitch Phillips Date: 2021-01-05T12:54:09-08:00 New Revision: 1f8031cd74887025a5de1e7129718186369db769 URL: https://github.com/llvm/llvm-project/commit/1f8031cd74887025a5de1e7129718186369db769 DIFF: https://github.com/llvm/llvm-project/commit/1f8031cd74887025a5de1e7129718186369db769.diff LOG: [android] Fix some tests for AOSP-master devices. Some tests are broken at API level 30 on AOSP-master devices. When we change the buildbuit to API level 30, the following tests get enabled. They're currently broken due to various issues, and so fix up those issues. Reviewed By: oontvoo, eugenis Differential Revision: https://reviews.llvm.org/D94100 Added: Modified: compiler-rt/test/cfi/cross-dso/target_out_of_bounds.cpp compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp Removed: diff --git a/compiler-rt/test/cfi/cross-dso/target_out_of_bounds.cpp b/compiler-rt/test/cfi/cross-dso/target_out_of_bounds.cpp index 6353f030a6ac..80b736e2c91c 100644 --- a/compiler-rt/test/cfi/cross-dso/target_out_of_bounds.cpp +++ b/compiler-rt/test/cfi/cross-dso/target_out_of_bounds.cpp @@ -10,6 +10,12 @@ // REQUIRES: cxxabi +// These checks are unsupported on newer versions of Android due to the +// following patch that makes it harder to defeat ASLR by not mapping unused +// shadow regions: +// https://android-review.googlesource.com/c/platform/bionic/+/1333960 +// UNSUPPORTED: android + #include #include #include diff --git a/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp b/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp index be1cdc943c6a..63a7c87f66da 100644 --- a/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp +++ b/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp @@ -23,6 +23,11 @@ int main(int argc, char *argv[]) { std::string path = std::string(argv[0]) + "-so.so"; + // Clear any previous errors. On Android, the dynamic loader can have some + // left over dlerror() messages due to a missing symbol resolution for a + // deprecated malloc function. + dlerror(); + void *handle = dlopen(path.c_str(), RTLD_LAZY); assert(handle != 0); typedef void **(* store_t)(void *p); @@ -31,10 +36,10 @@ int main(int argc, char *argv[]) { // Sometimes dlerror() occurs when we broke the interceptors. // Add the message here to make the error more obvious. const char *dlerror_msg = dlerror(); - assert(dlerror_msg == nullptr); if (dlerror_msg != nullptr) { fprintf(stderr, "DLERROR: %s\n", dlerror_msg); fflush(stderr); +abort(); } void *p = malloc(1337); // If we don't know about dynamic TLS, we will return a false leak above. diff --git a/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp b/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp index 72aee5f56fd9..fa644c6cb451 100644 --- a/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp +++ b/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp @@ -1,6 +1,15 @@ // Test that out-of-scope local variables are ignored by LSan. // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=1" -// RUN: %clangxx_lsan %s -o %t + +// LSan-in-ASan fails at -O0 on aarch64, because the stack use-after-return +// instrumentation stashes the argument to `PutPointerOnStaleStack` on the stack +// in order to conditionally call __asan_stack_malloc. This subverts our +// expectations for this test, where we assume the pointer is never stashed +// except at the bottom of the dead frame. Building at -O1 or greater solves +// this problem, because the compiler is smart enough to stash the argument in a +// callee-saved register for rematerialization instead. +// RUN: %clangxx_lsan -O1 %s -o %t + // RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck %s // RUN: %env_lsan_opts=$LSAN_BASE":exitcode=0" %run %t 2>&1 | FileCheck --check-prefix=CHECK-sanity %s // ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] a8520f6 - [GWP-ASan] Minor refactor of optional components.
Author: Mitch Phillips Date: 2021-01-14T11:14:11-08:00 New Revision: a8520f6970fd4d44ceae1ec5969563a0dbe30f54 URL: https://github.com/llvm/llvm-project/commit/a8520f6970fd4d44ceae1ec5969563a0dbe30f54 DIFF: https://github.com/llvm/llvm-project/commit/a8520f6970fd4d44ceae1ec5969563a0dbe30f54.diff LOG: [GWP-ASan] Minor refactor of optional components. In preparation for the inbuilt options parser, this is a minor refactor of optional components including: - Putting certain optional elements in the right header files, according to their function and their dependencies. - Cleaning up some old and mostly-dead code. - Moving some functions into anonymous namespaces to prevent symbol export. Reviewed By: cryptoad, eugenis Differential Revision: https://reviews.llvm.org/D94117 Added: compiler-rt/lib/gwp_asan/optional/printf.h compiler-rt/lib/gwp_asan/tests/platform_specific/printf_sanitizer_common.cpp Modified: compiler-rt/lib/gwp_asan/optional/backtrace.h compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cpp compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp compiler-rt/lib/gwp_asan/optional/backtrace_sanitizer_common.cpp compiler-rt/lib/gwp_asan/optional/segv_handler.h compiler-rt/lib/gwp_asan/optional/segv_handler_fuchsia.cpp compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp compiler-rt/lib/gwp_asan/tests/CMakeLists.txt compiler-rt/lib/gwp_asan/tests/harness.h compiler-rt/lib/scudo/scudo_allocator.cpp compiler-rt/lib/scudo/standalone/combined.h Removed: compiler-rt/lib/gwp_asan/tests/optional/printf_sanitizer_common.cpp diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace.h b/compiler-rt/lib/gwp_asan/optional/backtrace.h index 3a72eb3d08e8..9bb12af206a5 100644 --- a/compiler-rt/lib/gwp_asan/optional/backtrace.h +++ b/compiler-rt/lib/gwp_asan/optional/backtrace.h @@ -9,21 +9,45 @@ #ifndef GWP_ASAN_OPTIONAL_BACKTRACE_H_ #define GWP_ASAN_OPTIONAL_BACKTRACE_H_ -#include "gwp_asan/optional/segv_handler.h" +#include "gwp_asan/optional/printf.h" #include "gwp_asan/options.h" namespace gwp_asan { -namespace options { -// Functions to get the platform-specific and implementation-specific backtrace -// and backtrace printing functions when RTGwpAsanBacktraceLibc or -// RTGwpAsanBacktraceSanitizerCommon are linked. Use these functions to get the -// backtrace function for populating the Options::Backtrace and -// Options::PrintBacktrace when initialising the GuardedPoolAllocator. Please -// note any thread-safety descriptions for the implementation of these functions -// that you use. -Backtrace_t getBacktraceFunction(); -crash_handler::PrintBacktrace_t getPrintBacktraceFunction(); -} // namespace options +namespace backtrace { +// Description +// This function shall take the backtrace provided in `TraceBuffer`, and print +// it in a human-readable format using `Print`. Generally, this function shall +// resolve raw pointers to section offsets and print them with the following +// sanitizer-common format: +// " #{frame_number} {pointer} in {function name} ({binary name}+{offset}" +// e.g. " #5 0x420459 in _start (/tmp/uaf+0x420459)" +// This format allows the backtrace to be symbolized offline successfully using +// llvm-symbolizer. +// === Notes === +// This function may directly or indirectly call malloc(), as the +// GuardedPoolAllocator contains a reentrancy barrier to prevent infinite +// recursion. Any allocation made inside this function will be served by the +// supporting allocator, and will not have GWP-ASan protections. +typedef void (*PrintBacktrace_t)(uintptr_t *TraceBuffer, size_t TraceLength, + Printf_t Print); + +// Returns a function pointer to a backtrace function that's suitable for +// unwinding through a signal handler. This is important primarily for frame- +// pointer based unwinders, DWARF or other unwinders can simply provide the +// normal backtrace function as the implementation here. On POSIX, SignalContext +// should be the `ucontext_t` from the signal handler. +typedef size_t (*SegvBacktrace_t)(uintptr_t *TraceBuffer, size_t Size, + void *SignalContext); + +// Returns platform-specific provided implementations of Backtrace_t for use +// inside the GWP-ASan core allocator. +options::Backtrace_t getBacktraceFunction(); + +// Returns platform-specific provided implementations of PrintBacktrace_t and +// SegvBacktrace_t for use in the optional SEGV handler. +PrintBacktrace_t getPrintBacktraceFunction(); +SegvBacktrace_t getSegvBacktraceFunction(); +} // namespace backtrace } // namespace gwp_asan #endif // GWP_ASAN_OPTIONAL_BACKTRACE_H_ diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace_fuchsia.cp
[llvm-branch-commits] [compiler-rt] 6a42cbf - [GWP-ASan] Add inbuilt options parser.
Author: Mitch Phillips Date: 2021-01-15T12:57:05-08:00 New Revision: 6a42cbf6d2116b52cb59aa3e23bef93a30cf2dc8 URL: https://github.com/llvm/llvm-project/commit/6a42cbf6d2116b52cb59aa3e23bef93a30cf2dc8 DIFF: https://github.com/llvm/llvm-project/commit/6a42cbf6d2116b52cb59aa3e23bef93a30cf2dc8.diff LOG: [GWP-ASan] Add inbuilt options parser. Adds a modified options parser (shamefully pulled from Scudo, which shamefully pulled it from sanitizer-common) to GWP-ASan. This allows customers (Android) to parse options strings in a common way. Depends on D94117. AOSP side of these patches is staged at: - sepolicy (sysprops should only be settable by the shell, in both root and unrooted conditions): https://android-review.googlesource.com/c/platform/system/sepolicy/+/1517238 - zygote updates: https://android-review.googlesource.com/c/platform/frameworks/base/+/1515009 - bionic changes to add `gwp_asan.` system property, and GWP_ASAN_OPTIONS environment variable: https://android-review.googlesource.com/c/platform/bionic/+/1514989 Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D92696 Added: compiler-rt/lib/gwp_asan/tests/options.cpp compiler-rt/tools/gwp_asan/options_parser_fuzzer.cpp Modified: compiler-rt/lib/gwp_asan/CMakeLists.txt compiler-rt/lib/gwp_asan/optional/options_parser.cpp compiler-rt/lib/gwp_asan/optional/options_parser.h compiler-rt/lib/gwp_asan/options.inc compiler-rt/lib/gwp_asan/tests/CMakeLists.txt compiler-rt/lib/scudo/scudo_allocator.cpp compiler-rt/lib/scudo/standalone/CMakeLists.txt compiler-rt/lib/scudo/standalone/combined.h compiler-rt/lib/scudo/standalone/flags.cpp compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt compiler-rt/lib/scudo/standalone/tests/flags_test.cpp compiler-rt/test/scudo/standalone/unit/lit.site.cfg.py.in compiler-rt/tools/gwp_asan/CMakeLists.txt Removed: diff --git a/compiler-rt/lib/gwp_asan/CMakeLists.txt b/compiler-rt/lib/gwp_asan/CMakeLists.txt index 92f578585b54..599fa9904e47 100644 --- a/compiler-rt/lib/gwp_asan/CMakeLists.txt +++ b/compiler-rt/lib/gwp_asan/CMakeLists.txt @@ -41,11 +41,10 @@ append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC GWP_ASAN_CFLAGS) # Remove -stdlib= which is unused when passing -nostdinc++. string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) -# Options parsing support is optional. GwpAsan is totally independent of -# sanitizer_common, the options parser is not. This is an optional library -# that can be used by an allocator to automatically parse GwpAsan options from -# the environment variable GWP_ASAN_FLAGS, but the allocator can choose to -# implement its own options parsing and populate the Options struct itself. +# Options parsing support is optional. This is an optional library that can be +# used by an allocator to automatically parse GwpAsan options from the +# environment variable GWP_ASAN_FLAGS, but the allocator can choose to implement +# its own options parsing and populate the Options struct itself. set(GWP_ASAN_OPTIONS_PARSER_SOURCES optional/options_parser.cpp ) @@ -64,11 +63,7 @@ set(GWP_ASAN_SEGV_HANDLER_HEADERS options.h) set(GWP_ASAN_OPTIONS_PARSER_CFLAGS -${GWP_ASAN_CFLAGS} -${SANITIZER_COMMON_CFLAGS}) -set(GWP_ASAN_OPTIONS_PARSER_OBJECT_LIBS -RTSanitizerCommon -RTSanitizerCommonNoLibc) +${GWP_ASAN_CFLAGS}) if (COMPILER_RT_HAS_GWP_ASAN) foreach(arch ${GWP_ASAN_SUPPORTED_ARCH}) @@ -89,11 +84,6 @@ if (COMPILER_RT_HAS_GWP_ASAN) ADDITIONAL_HEADERS ${GWP_ASAN_HEADERS} CFLAGS ${GWP_ASAN_CFLAGS}) - # Note: If you choose to add this as an object library, ensure you also - # include the sanitizer_common flag parsing object lib (generally - # 'RTSanitizerCommonNoTermination'). Also, you'll need to either implement - # your own backtrace support (see optional/backtrace.h), or choose between one - # of the pre-implemented backtrace support options (see below). add_compiler_rt_object_libraries(RTGwpAsanOptionsParser ARCHS ${GWP_ASAN_SUPPORTED_ARCH} SOURCES ${GWP_ASAN_OPTIONS_PARSER_SOURCES} diff --git a/compiler-rt/lib/gwp_asan/optional/options_parser.cpp b/compiler-rt/lib/gwp_asan/optional/options_parser.cpp index 2e6386286745..60234124e8ed 100644 --- a/compiler-rt/lib/gwp_asan/optional/options_parser.cpp +++ b/compiler-rt/lib/gwp_asan/optional/options_parser.cpp @@ -7,84 +7,251 @@ //===--===// #include "gwp_asan/optional/options_parser.h" +#include "gwp_asan/optional/printf.h" +#include "gwp_asan/utilities.h" +#include #include #include #include #include -#include "gwp_asan/options.h" -#include "sanitizer_common/sanitizer_common.h" -#include "sanitizer_common/sanitizer_flag_parser.h" -#include "sanitizer_common/sanitizer_flags.h" - -namespace
[llvm-branch-commits] [compiler-rt] 1d03a54 - Revert "[test] Fix asan/TestCases/Linux/globals-gc-sections-lld.cpp with -fsanitize-address-globals-dead-stripping"
Author: Mitch Phillips Date: 2020-12-07T14:30:53-08:00 New Revision: 1d03a54d9460fa122f0be9bf9018b9a4358745a9 URL: https://github.com/llvm/llvm-project/commit/1d03a54d9460fa122f0be9bf9018b9a4358745a9 DIFF: https://github.com/llvm/llvm-project/commit/1d03a54d9460fa122f0be9bf9018b9a4358745a9.diff LOG: Revert "[test] Fix asan/TestCases/Linux/globals-gc-sections-lld.cpp with -fsanitize-address-globals-dead-stripping" This reverts commit 140808768d3e5c0f4e52dd42094650f5d282e34a. Reason: Broke the upstream bots - discussed offline. Added: Modified: compiler-rt/test/asan/TestCases/Linux/globals-gc-sections-lld.cpp Removed: diff --git a/compiler-rt/test/asan/TestCases/Linux/globals-gc-sections-lld.cpp b/compiler-rt/test/asan/TestCases/Linux/globals-gc-sections-lld.cpp index 24dd1ae5b208..f6edc7032018 100644 --- a/compiler-rt/test/asan/TestCases/Linux/globals-gc-sections-lld.cpp +++ b/compiler-rt/test/asan/TestCases/Linux/globals-gc-sections-lld.cpp @@ -1,11 +1,10 @@ -/// Without instrumenting globals, --gc-sections drops the undefined symbol. -// RUN: %clangxx_asan %s -o /dev/null -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -mllvm -asan-globals=0 -/// With -fsanitize-address-globals-dead-stripping and -fdata-sections, a garbage -/// collectable custom metadata section is used for instrumented globals. -// RUN: %clangxx_asan %s -o /dev/null -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -fsanitize-address-globals-dead-stripping +// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -mllvm -asan-globals=0 +// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -mllvm -asan-globals=1 -// https://github.com/google/sanitizers/issues/260 -// REQUIRES: lld-available +// https://code.google.com/p/address-sanitizer/issues/detail?id=260 +// REQUIRES: lld +// FIXME: This may pass on Android, with non-emulated-tls. +// XFAIL: android int undefined(); // On i386 clang adds --export-dynamic when linking with ASan, which adds all ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] ebff66b - [scudo] [standalone] [NFC] clang-format code.
Author: Mitch Phillips Date: 2020-12-10T12:25:42-08:00 New Revision: ebff66be655acccd2bed3798c2b6879d18c509e1 URL: https://github.com/llvm/llvm-project/commit/ebff66be655acccd2bed3798c2b6879d18c509e1 DIFF: https://github.com/llvm/llvm-project/commit/ebff66be655acccd2bed3798c2b6879d18c509e1.diff LOG: [scudo] [standalone] [NFC] clang-format code. clang-format the scudo standalone codebase. Reviewed By: cryptoad Differential Revision: https://reviews.llvm.org/D93056 Added: Modified: compiler-rt/lib/scudo/standalone/fuzz/get_error_info_fuzzer.cpp compiler-rt/lib/scudo/standalone/tools/compute_size_class_config.cpp Removed: diff --git a/compiler-rt/lib/scudo/standalone/fuzz/get_error_info_fuzzer.cpp b/compiler-rt/lib/scudo/standalone/fuzz/get_error_info_fuzzer.cpp index d29f515215e6..f20a8a84a010 100644 --- a/compiler-rt/lib/scudo/standalone/fuzz/get_error_info_fuzzer.cpp +++ b/compiler-rt/lib/scudo/standalone/fuzz/get_error_info_fuzzer.cpp @@ -22,21 +22,25 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t *Data, size_t Size) { uintptr_t FaultAddr = FDP.ConsumeIntegral(); uintptr_t MemoryAddr = FDP.ConsumeIntegral(); - std::string MemoryAndTags = FDP.ConsumeRandomLengthString(FDP.remaining_bytes()); + std::string MemoryAndTags = + FDP.ConsumeRandomLengthString(FDP.remaining_bytes()); const char *Memory = MemoryAndTags.c_str(); // Assume 16-byte alignment. size_t MemorySize = (MemoryAndTags.length() / 17) * 16; const char *MemoryTags = Memory + MemorySize; - std::string StackDepotBytes = FDP.ConsumeRandomLengthString(FDP.remaining_bytes()); + std::string StackDepotBytes = + FDP.ConsumeRandomLengthString(FDP.remaining_bytes()); std::vector StackDepot(sizeof(scudo::StackDepot), 0); - for (size_t i = 0; i < StackDepotBytes.length() && i < StackDepot.size(); ++i) { + for (size_t i = 0; i < StackDepotBytes.length() && i < StackDepot.size(); + ++i) { StackDepot[i] = StackDepotBytes[i]; } std::string RegionInfoBytes = FDP.ConsumeRemainingBytesAsString(); std::vector RegionInfo(AllocatorT::getRegionInfoArraySize(), 0); - for (size_t i = 0; i < RegionInfoBytes.length() && i < RegionInfo.size(); ++i) { + for (size_t i = 0; i < RegionInfoBytes.length() && i < RegionInfo.size(); + ++i) { RegionInfo[i] = RegionInfoBytes[i]; } diff --git a/compiler-rt/lib/scudo/standalone/tools/compute_size_class_config.cpp b/compiler-rt/lib/scudo/standalone/tools/compute_size_class_config.cpp index 82f37b6647ef..8b17be0e965b 100644 --- a/compiler-rt/lib/scudo/standalone/tools/compute_size_class_config.cpp +++ b/compiler-rt/lib/scudo/standalone/tools/compute_size_class_config.cpp @@ -19,9 +19,8 @@ struct Alloc { }; size_t measureWastage(const std::vector &allocs, - const std::vector &classes, - size_t pageSize, - size_t headerSize) { + const std::vector &classes, size_t pageSize, + size_t headerSize) { size_t totalWastage = 0; for (auto &a : allocs) { size_t sizePlusHeader = a.size + headerSize; @@ -55,7 +54,8 @@ void readAllocs(std::vector &allocs, const char *path) { } Alloc a; - while (fscanf(f, "\n", &a.size, &a.count) == 2) + while (fscanf(f, "\n", &a.size, +&a.count) == 2) allocs.push_back(a); fclose(f); } @@ -157,5 +157,6 @@ struct MySizeClassConfig { }; static const uptr SizeDelta = %zu; }; -)", headerSize); +)", + headerSize); } ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] 61a038f - [GWP-ASan] IWYU & clang-format
Author: Mitch Phillips Date: 2020-12-10T12:42:01-08:00 New Revision: 61a038f8528f12c0c2ee5a9794c257fdae626d29 URL: https://github.com/llvm/llvm-project/commit/61a038f8528f12c0c2ee5a9794c257fdae626d29 DIFF: https://github.com/llvm/llvm-project/commit/61a038f8528f12c0c2ee5a9794c257fdae626d29.diff LOG: [GWP-ASan] IWYU & clang-format Run an IWYU pass and clang-format GWP-ASan code. Reviewed By: eugenis, mcgrathr Differential Revision: https://reviews.llvm.org/D92688 Added: Modified: compiler-rt/lib/gwp_asan/crash_handler.cpp compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp compiler-rt/lib/gwp_asan/guarded_pool_allocator.h compiler-rt/lib/gwp_asan/mutex.h compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_posix.cpp compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp Removed: diff --git a/compiler-rt/lib/gwp_asan/crash_handler.cpp b/compiler-rt/lib/gwp_asan/crash_handler.cpp index b9baacecfecb..bd7ca5abbb6b 100644 --- a/compiler-rt/lib/gwp_asan/crash_handler.cpp +++ b/compiler-rt/lib/gwp_asan/crash_handler.cpp @@ -10,6 +10,7 @@ #include "gwp_asan/stack_trace_compressor.h" #include +#include #include using AllocationMetadata = gwp_asan::AllocationMetadata; diff --git a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp index 13888cbbe3c3..a1dbbe4f25e9 100644 --- a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp +++ b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp @@ -8,23 +8,10 @@ #include "gwp_asan/guarded_pool_allocator.h" -#include "gwp_asan/optional/segv_handler.h" #include "gwp_asan/options.h" #include "gwp_asan/utilities.h" -// RHEL creates the PRIu64 format macro (for printing uint64_t's) only when this -// macro is defined before including . -#ifndef __STDC_FORMAT_MACROS -#define __STDC_FORMAT_MACROS 1 -#endif - #include -#include -#include -#include -#include -#include -#include using AllocationMetadata = gwp_asan::AllocationMetadata; using Error = gwp_asan::Error; diff --git a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h index 84ebda13955f..b9972ffd98f7 100644 --- a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h +++ b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h @@ -13,10 +13,9 @@ #include "gwp_asan/definitions.h" #include "gwp_asan/mutex.h" #include "gwp_asan/options.h" -#include "gwp_asan/platform_specific/guarded_pool_allocator_fuchsia.h" -#include "gwp_asan/platform_specific/guarded_pool_allocator_posix.h" +#include "gwp_asan/platform_specific/guarded_pool_allocator_fuchsia.h" // IWYU pragma: keep +#include "gwp_asan/platform_specific/guarded_pool_allocator_posix.h" // IWYU pragma: keep #include "gwp_asan/platform_specific/guarded_pool_allocator_tls.h" -#include "gwp_asan/stack_trace_compressor.h" #include #include diff --git a/compiler-rt/lib/gwp_asan/mutex.h b/compiler-rt/lib/gwp_asan/mutex.h index a7214f527b29..34b91a2880dd 100644 --- a/compiler-rt/lib/gwp_asan/mutex.h +++ b/compiler-rt/lib/gwp_asan/mutex.h @@ -9,8 +9,8 @@ #ifndef GWP_ASAN_MUTEX_H_ #define GWP_ASAN_MUTEX_H_ -#include "gwp_asan/platform_specific/mutex_fuchsia.h" -#include "gwp_asan/platform_specific/mutex_posix.h" +#include "gwp_asan/platform_specific/mutex_fuchsia.h" // IWYU pragma: keep +#include "gwp_asan/platform_specific/mutex_posix.h" // IWYU pragma: keep namespace gwp_asan { class Mutex final : PlatformMutex { diff --git a/compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp b/compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp index 813882ad915a..0637fc2a4245 100644 --- a/compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp +++ b/compiler-rt/lib/gwp_asan/platform_specific/common_posix.cpp @@ -8,7 +8,9 @@ #include "gwp_asan/common.h" -#include +#include +#include // IWYU pragma: keep +// IWYU pragma: no_include #include namespace gwp_asan { diff --git a/compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_posix.cpp b/compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_posix.cpp index dad749bde8be..adb7330a431e 100644 --- a/compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_posix.cpp +++ b/compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_posix.cpp @@ -6,16 +6,16 @@ // //===--===// +#include "gwp_asan/common.h" #include "gwp_asan/guarded_pool_allocator.h" +#include "gwp_asan/platform_specific/guarded_pool_allocator_tls.h" #include "gwp_asan/utilities.h" #include -#include -#include +#include +#include #include -#include #include -#include #include #include diff --git a/compiler-rt/lib/gwp_asan/platform_specific/utilit
[llvm-branch-commits] [llvm] 9aafa9f - Revert "[NFC] Fix a gcc build break by not using an initializer."
Author: Mitch Phillips Date: 2020-12-10T15:53:38-08:00 New Revision: 9aafa9fc15228e69393782026930fbe2ab403dac URL: https://github.com/llvm/llvm-project/commit/9aafa9fc15228e69393782026930fbe2ab403dac DIFF: https://github.com/llvm/llvm-project/commit/9aafa9fc15228e69393782026930fbe2ab403dac.diff LOG: Revert "[NFC] Fix a gcc build break by not using an initializer." This reverts commit 1dc0a8521f616af5897327e4c03098f9312e9c59. Reason: Dependency of patch that broke the ASan buildbots: http://lab.llvm.org:8011/#/builders/5/builds/2269 Added: Modified: llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp Removed: diff --git a/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp index 5c3952b12e07..69adc77730d1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp @@ -62,7 +62,7 @@ void PseudoProbeHandler::emitPseudoProbe(uint64_t Guid, uint64_t Index, uint64_t CallerGuid = Names[Name]; uint64_t CallerProbeId = PseudoProbeDwarfDiscriminator::extractProbeIndex( InlinedAt->getDiscriminator()); -ReversedInlineStack.emplace_back(CallerGuid, CallerProbeId); +ReversedInlineStack.push_back({CallerGuid, CallerProbeId}); InlinedAt = InlinedAt->getInlinedAt(); } ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] b955eb6 - Revert "[NFC] Fix a gcc build break by using an explict constructor."
Author: Mitch Phillips Date: 2020-12-10T15:53:38-08:00 New Revision: b955eb688da31e85780bae8fc424bb344ef5daee URL: https://github.com/llvm/llvm-project/commit/b955eb688da31e85780bae8fc424bb344ef5daee DIFF: https://github.com/llvm/llvm-project/commit/b955eb688da31e85780bae8fc424bb344ef5daee.diff LOG: Revert "[NFC] Fix a gcc build break by using an explict constructor." This reverts commit 248b279cf04d9e439a1e426ffd24f2dfa93d02f8. Reason: Dependency of patch that broke the ASan buildbots: http://lab.llvm.org:8011/#/builders/5/builds/2269 Added: Modified: llvm/lib/MC/MCParser/AsmParser.cpp Removed: diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index bf50a95bc70c..bf2e5d8b41d4 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -5833,7 +5833,7 @@ bool AsmParser::parseDirectivePseudoProbe() { return true; } -InlineSite Site(CallerGuid, CallerProbeId); +InlineSite Site = {CallerGuid, CallerProbeId}; InlineStack.push_back(Site); } ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] 7ead5f5 - Revert "[CSSPGO] Pseudo probe encoding and emission."
Author: Mitch Phillips Date: 2020-12-10T15:53:39-08:00 New Revision: 7ead5f5aa3803864015c110ccfc7766948b210e3 URL: https://github.com/llvm/llvm-project/commit/7ead5f5aa3803864015c110ccfc7766948b210e3 DIFF: https://github.com/llvm/llvm-project/commit/7ead5f5aa3803864015c110ccfc7766948b210e3.diff LOG: Revert "[CSSPGO] Pseudo probe encoding and emission." This reverts commit b035513c06d1cba2bae8f3e88798334e877523e1. Reason: Broke the ASan buildbots: http://lab.llvm.org:8011/#/builders/5/builds/2269 Added: Modified: llvm/include/llvm/CodeGen/AsmPrinter.h llvm/include/llvm/IR/MDBuilder.h llvm/include/llvm/IR/PseudoProbe.h llvm/include/llvm/MC/MCAssembler.h llvm/include/llvm/MC/MCContext.h llvm/include/llvm/MC/MCFragment.h llvm/include/llvm/MC/MCObjectFileInfo.h llvm/include/llvm/MC/MCStreamer.h llvm/include/llvm/Passes/PassBuilder.h llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp llvm/lib/IR/MDBuilder.cpp llvm/lib/MC/CMakeLists.txt llvm/lib/MC/MCAsmStreamer.cpp llvm/lib/MC/MCAssembler.cpp llvm/lib/MC/MCFragment.cpp llvm/lib/MC/MCObjectFileInfo.cpp llvm/lib/MC/MCObjectStreamer.cpp llvm/lib/MC/MCParser/AsmParser.cpp llvm/lib/MC/MCStreamer.cpp llvm/lib/Transforms/IPO/SampleProfileProbe.cpp llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll Removed: llvm/include/llvm/MC/MCPseudoProbe.h llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.h llvm/lib/MC/MCPseudoProbe.cpp llvm/test/Transforms/SampleProfile/pseudo-probe-emit-inline.ll diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h index 76486b0b48ce..7fac3613251b 100644 --- a/llvm/include/llvm/CodeGen/AsmPrinter.h +++ b/llvm/include/llvm/CodeGen/AsmPrinter.h @@ -66,7 +66,6 @@ class MCSymbol; class MCTargetOptions; class MDNode; class Module; -class PseudoProbeHandler; class raw_ostream; class StackMaps; class StringRef; @@ -207,10 +206,6 @@ class AsmPrinter : public MachineFunctionPass { /// If the target supports dwarf debug info, this pointer is non-null. DwarfDebug *DD = nullptr; - /// A handler that supports pseudo probe emission with embedded inline - /// context. - PseudoProbeHandler *PP = nullptr; - /// If the current module uses dwarf CFI annotations strictly for debugging. bool isCFIMoveForDebugging = false; @@ -365,8 +360,6 @@ class AsmPrinter : public MachineFunctionPass { void emitBBAddrMapSection(const MachineFunction &MF); - void emitPseudoProbe(const MachineInstr &MI); - void emitRemarksSection(remarks::RemarkStreamer &RS); enum CFIMoveType { CFI_M_None, CFI_M_EH, CFI_M_Debug }; diff --git a/llvm/include/llvm/IR/MDBuilder.h b/llvm/include/llvm/IR/MDBuilder.h index 51be8667f1c1..08cd60c30e6a 100644 --- a/llvm/include/llvm/IR/MDBuilder.h +++ b/llvm/include/llvm/IR/MDBuilder.h @@ -76,9 +76,6 @@ class MDBuilder { /// Return metadata containing the section prefix for a function. MDNode *createFunctionSectionPrefix(StringRef Prefix); - /// Return metadata containing the pseudo probe descriptor for a function. - MDNode *createPseudoProbeDesc(uint64_t GUID, uint64_t Hash, Function *F); - //===--===// // Range metadata. //===--===// diff --git a/llvm/include/llvm/IR/PseudoProbe.h b/llvm/include/llvm/IR/PseudoProbe.h index 9b4645aed6e9..fd3a0075efbe 100644 --- a/llvm/include/llvm/IR/PseudoProbe.h +++ b/llvm/include/llvm/IR/PseudoProbe.h @@ -18,8 +18,6 @@ namespace llvm { -constexpr const char *PseudoProbeDescMetadataName = "llvm.pseudo_probe_desc"; - enum class PseudoProbeType { Block = 0, IndirectCall, DirectCall }; struct PseudoProbeDwarfDiscriminator { diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h index 15c0be436fd8..b57439f02ca5 100644 --- a/llvm/include/llvm/MC/MCAssembler.h +++ b/llvm/include/llvm/MC/MCAssembler.h @@ -202,7 +202,6 @@ class MCAssembler { bool relaxCVInlineLineTable(MCAsmLayout &Layout, MCCVInlineLineTableFragment &DF); bool relaxCVDefRange(MCAsmLayout &Layout, MCCVDefRangeFragment &DF); - bool relaxPseudoProbeAddr(MCAsmLayout &Layout, MCPseudoProbeAddrFragment &DF); /// finishLayout - Finalize a layout, including fragment lowering. void finishLayout(MCAsmLayout &Layout); diff --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h index 75e6dbe069e2..242b5da6bd1a 100644 --- a/llvm/include/llvm/MC/MCContext.h +++ b/llvm/include/llvm/MC/MCContext.h @@ -22,7 +22,6 @@ #include "llvm/Bin
[llvm-branch-commits] [compiler-rt] 66ee0d3 - [sanitizer-common] Force pickup of llvm-symbolizer from new binaries.
Author: Mitch Phillips Date: 2020-12-16T06:36:26-08:00 New Revision: 66ee0d3d84a6ea04e895249aef2ea8a812664728 URL: https://github.com/llvm/llvm-project/commit/66ee0d3d84a6ea04e895249aef2ea8a812664728 DIFF: https://github.com/llvm/llvm-project/commit/66ee0d3d84a6ea04e895249aef2ea8a812664728.diff LOG: [sanitizer-common] Force pickup of llvm-symbolizer from new binaries. It's possible currently that the sanitizer runtimes when testing grab the path to the symbolizer through *SAN_SYMBOLIZER_PATH=... This can be polluted by things like Android's setup script. This patch forces external_symbolizer_path=$new_build_out_dir/llvm-symbolizer when %env_tool_options is used. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D93352 Added: Modified: compiler-rt/test/sanitizer_common/lit.common.cfg.py compiler-rt/test/sanitizer_common/lit.site.cfg.py.in Removed: diff --git a/compiler-rt/test/sanitizer_common/lit.common.cfg.py b/compiler-rt/test/sanitizer_common/lit.common.cfg.py index b4f0670f9959..f7c526b6b37b 100644 --- a/compiler-rt/test/sanitizer_common/lit.common.cfg.py +++ b/compiler-rt/test/sanitizer_common/lit.common.cfg.py @@ -43,6 +43,14 @@ # which does not work for abort()-terminated programs. default_tool_options += ['abort_on_error=0'] +# If the user has a poisoned *SAN_SYMBOLIZER_PATH (like what's setup by +# build/envsetup.sh on Android), then they can end up with an out-of-date +# symbolizer for the tests. Ensure they get the one from the recent build tree. +symbolizer_path="''" +if len(config.binary_path): + symbolizer_path = os.path.join(config.binary_path, "llvm-symbolizer") +default_tool_options += ['external_symbolizer_path=' + symbolizer_path] + default_tool_options_str = ':'.join(default_tool_options) if default_tool_options_str: config.environment[tool_options] = default_tool_options_str diff --git a/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in b/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in index 38f5ca158463..3ff7c44aeab4 100644 --- a/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in +++ b/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in @@ -5,6 +5,7 @@ config.name_suffix = "@CONFIG_NAME@" config.tool_name = "@SANITIZER_COMMON_LIT_TEST_MODE@" config.target_cflags = "@SANITIZER_COMMON_TEST_TARGET_CFLAGS@" config.target_arch = "@SANITIZER_COMMON_TEST_TARGET_ARCH@" +config.binary_path = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] 30d292d - [sanitizer-common] Pickup llvm-symbolizer from $OUT/bin IFF exists.
Author: Mitch Phillips Date: 2020-12-16T11:59:10-08:00 New Revision: 30d292ddbb7ec84b422738cf52ee0cf49b0369f3 URL: https://github.com/llvm/llvm-project/commit/30d292ddbb7ec84b422738cf52ee0cf49b0369f3 DIFF: https://github.com/llvm/llvm-project/commit/30d292ddbb7ec84b422738cf52ee0cf49b0369f3.diff LOG: [sanitizer-common] Pickup llvm-symbolizer from $OUT/bin IFF exists. Fix-forward for D93352. Slight rework of the same idea, pickup the external symbolizer from the binary directory iff it exists. Added: Modified: compiler-rt/test/sanitizer_common/lit.common.cfg.py compiler-rt/test/sanitizer_common/lit.site.cfg.py.in Removed: diff --git a/compiler-rt/test/sanitizer_common/lit.common.cfg.py b/compiler-rt/test/sanitizer_common/lit.common.cfg.py index f7c526b6b37b..1f037c00eb15 100644 --- a/compiler-rt/test/sanitizer_common/lit.common.cfg.py +++ b/compiler-rt/test/sanitizer_common/lit.common.cfg.py @@ -46,10 +46,9 @@ # If the user has a poisoned *SAN_SYMBOLIZER_PATH (like what's setup by # build/envsetup.sh on Android), then they can end up with an out-of-date # symbolizer for the tests. Ensure they get the one from the recent build tree. -symbolizer_path="''" -if len(config.binary_path): - symbolizer_path = os.path.join(config.binary_path, "llvm-symbolizer") -default_tool_options += ['external_symbolizer_path=' + symbolizer_path] +symbolizer_path = os.path.join(config.binary_path, "bin", "llvm-symbolizer") +if os.path.exists(symbolizer_path): + default_tool_options += ['external_symbolizer_path=' + symbolizer_path] default_tool_options_str = ':'.join(default_tool_options) if default_tool_options_str: diff --git a/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in b/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in index 3ff7c44aeab4..fa7e54e51e27 100644 --- a/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in +++ b/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in @@ -5,7 +5,7 @@ config.name_suffix = "@CONFIG_NAME@" config.tool_name = "@SANITIZER_COMMON_LIT_TEST_MODE@" config.target_cflags = "@SANITIZER_COMMON_TEST_TARGET_CFLAGS@" config.target_arch = "@SANITIZER_COMMON_TEST_TARGET_ARCH@" -config.binary_path = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" +config.binary_path = "@LLVM_BINARY_DIR@" # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits