[PATCH] D85649: [AArch64] PAC/BTI code generation for LLVM generated functions

2022-03-15 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Herald added a project: All. In D85649#2281439 , @chill wrote: > It looks like the only value that makes sense is `Error` - any other policy > (existing or not) would potentially lead to meaningfully different code > generated with o

[PATCH] D119296: KCFI sanitizer

2022-04-07 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. > Note that if additional data has been injected between the KCFI > type identifier and the start of the function, e.g. by using > -fpatchable-function-entry, the offset in bytes must be specified > using -fsanitize-kcfi-offset= to avoid errors. The offset > must be the same f

[PATCH] D118171: [HWASan] Add __hwasan_init to .preinit_array.

2022-02-02 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:842 + if (!Args.hasArg(options::OPT_shared)) +SharedRuntimes.push_back("hwasan-preinit"); } morehouse wrote: > eugenis wrote: > > pcc wrote: > > > Shouldn't it be

[PATCH] D118171: [HWASan] Add __hwasan_init to .preinit_array.

2022-02-03 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118171/new/ https://reviews.llvm.org/D118171 ___ cfe-c

[PATCH] D119296: KCFI sanitizer

2022-02-08 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:3168 + -1); + llvm::Value *Test = Builder.CreateICmpEQ(Builder.CreateLoad(HashPtr), Hash); + llvm::BasicBlock *ContBB = createBasicBlock("kcfi.cont"); We considered a scheme like this befo

[PATCH] D116774: AST: Move __va_list tag back to std conditionally on AArch64.

2022-02-09 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc updated this revision to Diff 407227. pcc retitled this revision from "AST: Move __va_list tag to the top level on ARM architectures." to "AST: Move __va_list tag back to std conditionally on AArch64.". pcc edited the summary of this revision. pcc added a comment. Make it conditional Repos

[PATCH] D119296: KCFI sanitizer

2022-02-09 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:3168 + -1); + llvm::Value *Test = Builder.CreateICmpEQ(Builder.CreateLoad(HashPtr), Hash); + llvm::BasicBlock *ContBB = createBasicBlock("kcfi.cont"); samitolvanen wrote: > pcc wrote: > >

[PATCH] D119296: KCFI sanitizer

2022-02-09 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:3168 + -1); + llvm::Value *Test = Builder.CreateICmpEQ(Builder.CreateLoad(HashPtr), Hash); + llvm::BasicBlock *ContBB = createBasicBlock("kcfi.cont"); pcc wrote: > samitolvanen wrote: > >

[PATCH] D119367: [HWASan] Allow no_sanitize(..) and change metadata passing.

2022-02-11 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. In addition to the .bc support we will also need support for reading/writing .ll files. Comment at: llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp:1721 -static DenseSet getExcludedGlobals(Module &M) { - NamedMDNode *Globals = M.getNamedMetadat

[PATCH] D115844: [ubsan] Using metadata instead of prologue data for function sanitizer

2022-02-14 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. On the bug you have: define internal fastcc void @​_Z4callIiE4taskv.resume(%_Z4callIiE4taskv.Frame* noalias nonnull align 8 dereferenceable(24 ) %FramePtr) #​1 prologue <{ i32, i32 }> <{ i32 846595819, i32 trunc (i64 sub (i64 ptrtoint (i8** @​1 to i64), i64 ptrtoin

[PATCH] D115844: [ubsan] Using metadata instead of prologue data for function sanitizer

2022-02-14 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. In D115844#3321235 , @ychen wrote: > In D115844#3321190 , @pcc wrote: > >> On the bug you have: >> >> define internal fastcc void >> @​_Z4callIiE4taskv.resume(%_Z4callIiE4taskv.Frame* noali

[PATCH] D116774: AST: Move __va_list tag back to std conditionally on AArch64.

2022-02-17 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc updated this revision to Diff 409716. pcc added a comment. Use isARM() etc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116774/new/ https://reviews.llvm.org/D116774 Files: clang/lib/AST/ASTContext.cpp clang/lib/AST/ItaniumMangle.cpp cla

[PATCH] D116774: AST: Move __va_list tag back to std conditionally on AArch64.

2022-02-17 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc marked 2 inline comments as done. pcc added a comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116774/new/ https://reviews.llvm.org/D116774 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D116773: AST: Make getEffectiveDeclContext() a member function of ItaniumMangleContextImpl. NFCI.

2022-02-17 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG18ead23385a4: AST: Make getEffectiveDeclContext() a member function of… (authored by pcc). Changed prior to commit: https://reviews.llvm.org/D116773?vs=398007&id=409733#toc Repository: rG LLVM Github

[PATCH] D116774: AST: Move __va_list tag back to std conditionally on AArch64.

2022-02-17 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG82e5f951fd6e: AST: Move __va_list tag back to std conditionally on AArch64. (authored by pcc). Changed prior to commit: https://reviews.llvm.org/D

[PATCH] D116774: AST: Move __va_list tag back to std conditionally on AArch64.

2022-02-17 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116774/new/ https://reviews.llvm.org/D116774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[PATCH] D119296: KCFI sanitizer

2022-04-28 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. In D119296#3467905 , @samitolvanen wrote: > In D119296#3466027 , @joaomoreira > wrote: > >> I played a little bit with kcfi and here are some thoughts: >> >> - under -Os I saw functions bein

[PATCH] D120862: Sema: Allow scoped enums as source type for integral conversion.

2022-05-02 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120862/new/ https://reviews.llvm.org/D120862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[PATCH] D115844: [ubsan] Using metadata instead of prologue data for function sanitizer

2022-05-12 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1843 + + auto *FTRTTIProxy = new llvm::GlobalVariable( + TheModule, Addr->getType(), Are these proxy variables necessary? I think that now that we have custom code generation for th

[PATCH] D115844: [ubsan] Using metadata instead of prologue data for function sanitizer

2022-05-12 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1843 + + auto *FTRTTIProxy = new llvm::GlobalVariable( + TheModule, Addr->getType(), ychen wrote: > pcc wrote: > > Are these proxy variables necessary? I think that now that we have

[PATCH] D120727: [libc++] Overhaul how we select the ABI library

2022-05-13 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. In D120727#3512177 , @paulkirth wrote: > Hi, we're seeing some failures in Fuchsia's Clang CI. Our runtimes build > seems to be unable to find `cxxabi.h`. > > The failing bot can be found here: > https://luci-milo.appspot.com/ui/p/f

[PATCH] D125624: [gold] Remove an external dependency to GNU binutils' header file

2022-05-16 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: llvm/tools/gold/gold-plugin.cpp:44-52 // FIXME: remove this declaration when we stop maintaining Ubuntu Quantal and // Precise and Debian Wheezy (binutils 2.23 is required) #define LDPO_PIE 3 #define LDPT_GET_SYMBOLS_V3 28 // FIXME:

[PATCH] D66437: Sema: Create a no-op implicit cast for lvalue function conversions.

2019-08-22 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66437/new/ https://reviews.llvm.org/D66437 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[PATCH] D66606: IR. Change strip* family of functions to not look through aliases.

2019-08-22 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added a reviewer: rnk. Herald added subscribers: cfe-commits, aheejin, hiraditya, jgravelle-google, sbc100, dschuff, srhines. Herald added projects: clang, LLVM. I noticed another instance of the issue where references to aliases were being replaced with aliasees, t

[PATCH] D66606: IR. Change strip* family of functions to not look through aliases.

2019-08-22 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL369697: IR. Change strip* family of functions to not look through aliases. (authored by pcc, committed by ). Changed prior to commit: https://reviews.llvm.org/D66606?vs=216671&id=216694#toc Repository:

[PATCH] D36013: Fix logic for generating llvm.type.test()s

2017-07-28 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM Comment at: test/CodeGenCXX/cfi-vcall-no-trap.cpp:2 +// Only output llvm.assume(llvm.type.test()) if cfi-vcall is disabled and whole-program-vtables is enabled +// RUN: %clan

[PATCH] D36013: Fix logic for generating llvm.type.test()s

2017-07-31 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309622: Fix logic for generating llvm.type.test()s (authored by pcc). Changed prior to commit: https://reviews.llvm.org/D36013?vs=108702&id=108994#toc Repository: rL LLVM https://reviews.llvm.org/D3

[PATCH] D36294: CFI: blacklist STL allocate() from unrelated-casts

2017-08-03 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a subscriber: cfe-commits. pcc added inline comments. Comment at: lib/CodeGen/CodeGenFunction.cpp:785 + // Ignore unrelated casts from C++ calls to allocate(). Don't match on the + // namespace because not all allocators are in std:: The comment sho

[PATCH] D36294: CFI: blacklist STL allocate() from unrelated-casts

2017-08-03 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D36294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D87717: [docs] Update ControlFlowIntegrity.rst.

2020-09-25 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87717/new/ https://reviews.llvm.org/D87717 ___ cfe-com

[PATCH] D84414: [RISCV] Support Shadow Call Stack

2020-08-24 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. FWIW, on aarch64 we decided to make `-fsanitize=shadow-call-stack` require the x18 reservation (instead of implying it) to try to avoid ABI mismatch problems. That is, it should be safe to mix and match code compiled with and without `-fsanitize=shadow-call-stack`. If we ma

[PATCH] D75655: [Docs] Document -lto-whole-program-visibility

2020-08-25 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. I think that the part of the description beginning "This can be used when..." is somewhat misleading since you could pretty much say the same thing about specifying `-fvisibility=hidden -fwhole-program-vtables` at compile time. I think it would be better to focus on the spe

[PATCH] D75655: [Docs] Document -lto-whole-program-visibility

2020-08-25 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM Thanks and sorry for the delay. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75655/new/ https://reviews.llvm.org/D75655 __

[PATCH] D87095: [Triple][MachO] Define "arm64e", an AArch64 subarch for Pointer Auth.

2020-09-03 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Hi, thanks for getting started on upstreaming this! But I was wondering: shouldn't this be the *last* patch? I was imagining that you would first upstream support for the `-fptrauth-*` flags, and then at the end you would add an `arm64e` subarch that turns them on by defaul

[PATCH] D63908: hwasan: Improve precision of checks using short granule tags.

2020-12-21 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: compiler-rt/trunk/lib/hwasan/hwasan_checks.h:76 +#endif + return *(u8 *)(ptr | (kShadowAlignment - 1)) == ptr_tag; +} xiangzhangllvm wrote: > Hello @pcc I think here seems some problem, the ptr is user passing point, > *(pt

[PATCH] D85474: Add -fbinutils-version= to gate ELF features on the specified binutils version

2020-11-03 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. I agree with @MaskRay that this should be a binutils-specific option. The flag `-mlinker-version` seems to have been designed around macOS-specific assumptions i.e. there is a single linker (ld64) and that the linker and assembler are not version coupled. Having this option

[PATCH] D91466: [WIP][clang][Fuchsia] Support HWASan for Fuchsia

2020-11-13 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. How does Zircon handle tagged addresses in syscalls? Are they handled equivalently to Linux's tagged address ABI? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91466/new/ https://reviews.llvm.org/D91466 __

[PATCH] D89766: Driver: Add integer sanitizers to trapping group automatically.

2020-10-19 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added reviewers: jfb, eugenis. Herald added a project: clang. pcc requested review of this revision. In D86000 we added a new sanitizer to the integer group without adding it to the trapping group. This broke usage of -fsanitize=int

[PATCH] D89766: Driver: Add integer sanitizers to trapping group automatically.

2020-10-20 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc5acd3490b79: Driver: Add integer sanitizers to trapping group automatically. (authored by pcc). Repository: rG LLVM Github Monorepo CHANGES SINC

[PATCH] D90422: AArch64: Switch to x20 as the shadow base register for outlined HWASan checks.

2020-10-29 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added reviewers: eugenis, hctim. Herald added subscribers: Sanitizers, cfe-commits, danielkiss, hiraditya, kristof.beyls. Herald added projects: clang, Sanitizers, LLVM. pcc requested review of this revision. >From a code size perspective it turns out to be better t

[PATCH] D90424: AArch64: Use SBFX instead of UBFX to extract address granule in outlined HWASan checks.

2020-10-29 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added reviewers: eugenis, hctim. Herald added subscribers: cfe-commits, danielkiss, hiraditya, kristof.beyls. Herald added projects: clang, LLVM. pcc requested review of this revision. In a kernel (or in general in environments where bit 55 of the address is set) the

[PATCH] D90422: AArch64: Switch to x20 as the shadow base register for outlined HWASan checks.

2020-10-29 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. For the kernel I measured a small regression in boot time (with a version of this change that uses x20 for the v1 checks as well since the kernel doesn't use short granules yet) -- from 6.65s to 6.70s or 0.8%. But that's a fraction of the size gains which were 4% for kernel

[PATCH] D46791: Make -gsplit-dwarf generally available

2020-10-30 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Correct, clang no longer uses objcopy for this as of D47093 . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D46791/new/ https://reviews.llvm.org/D46791 ___ cfe-commits mailing list cfe-com

[PATCH] D90422: AArch64: Switch to x20 as the shadow base register for outlined HWASan checks.

2020-10-30 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG3859fc653fb4: AArch64: Switch to x20 as the shadow base register for outlined HWASan checks. (authored by pcc). Repository: rG LLVM Github Monorep

[PATCH] D90424: AArch64: Use SBFX instead of UBFX to extract address granule in outlined HWASan checks.

2020-10-30 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc9b1a2b41dca: AArch64: Use SBFX instead of UBFX to extract address granule in outlined HWASan… (authored by pcc). Repository: rG LLVM Github Monor

[PATCH] D100581: [Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable

2021-05-17 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. This warning seems to have a lot of false positives on things like reference arguments that are used as output parameters. For example here is a small sample of output from a stage2 build of part of LLVM: In file included from ../llvm/lib/BinaryFormat/Minidump.cpp:9: In

[PATCH] D102943: Hashing: use a 64-bit storage type on all platforms.

2021-05-21 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Isn't the bug here that module hashing is using `hash_code`? So shouldn't the correct fix be to use a specific hashing algorithm for module hashes? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102943/new/ https://reviews.llvm

[PATCH] D103845: [compiler-rt][hwasan] Add newline between record_addr lines on frame record dumps

2021-06-07 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc requested changes to this revision. pcc added a comment. This revision now requires changes to proceed. This isn't how the output looks on Android. Are you sure this isn't a Fuchsia-specific bug in the output formatting? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D103845: [compiler-rt][hwasan] Add newline between record_addr lines on frame record dumps

2021-06-08 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. In D103845#2806211 , @leonardchan wrote: > In D103845#2804441 , @pcc wrote: > >> This isn't how the output looks on Android. Are you sure this isn't a >> Fuchsia-specific bug in the output f

[PATCH] D103845: [compiler-rt][hwasan] Add newline between record_addr lines on frame record dumps

2021-06-09 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Thanks for tracking this down. It seems best to change the Printf call to add the newline, since otherwise it looks like you'd be adding a spurious newline to the other callers of `RenderFrame` on Fuchsia. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D103845: [compiler-rt][hwasan] Add newline between record_addr lines on frame record dumps

2021-06-14 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103845/new/ https://reviews.llvm.org/D103845 ___ cfe-c

[PATCH] D104058: ThinLTO: Fix inline assembly references to static functions with CFI

2021-06-17 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM Comment at: clang/test/CodeGen/thinlto-cfi-icall-static-inline-asm.c:3 + +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -flto=thin -fsanitize=cfi-icall -f

[PATCH] D104830: AST: Create __va_list in the std namespace even in C.

2021-06-23 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added reviewers: rsmith, eugenis. pcc requested review of this revision. Herald added a project: clang. This ensures that the mangled type names match between C and C++, which is significant when using -fsanitize=cfi-icall. Ideally we wouldn't have created this names

[PATCH] D104830: AST: Create __va_list in the std namespace even in C.

2021-06-23 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc updated this revision to Diff 354130. pcc added a comment. Add test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104830/new/ https://reviews.llvm.org/D104830 Files: clang/lib/AST/ASTContext.cpp clang/test/CodeGen/aarch64-varargs.c clang

[PATCH] D104830: AST: Create __va_list in the std namespace even in C.

2021-06-23 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe655e74a318e: AST: Create __va_list in the std namespace even in C

[PATCH] D94355: [Passes] Add relative lookup table converter pass

2021-06-23 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Herald added a subscriber: ormris. Comment at: llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp:73 + return false; + +// If an operand in the lookup table is not dso_local, In the version of the patch that you committed, y

[PATCH] D108223: gn build: Build libclang.so on ELF platforms.

2021-08-17 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added a reviewer: thakis. pcc requested review of this revision. Herald added a project: LLVM. This requires changing the ELF build to enable -fPIC, consistent with other platforms. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D108223 Files: l

[PATCH] D108223: gn build: Build libclang.so on ELF platforms.

2021-08-17 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc updated this revision to Diff 366966. pcc added a comment. Herald added subscribers: ormris, steven_wu, hiraditya. Also libLTO.so Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108223/new/ https://reviews.llvm.org/D108223 Files: llvm/utils/gn

[PATCH] D108223: gn build: Build libclang.so on ELF platforms.

2021-08-17 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn:16 - # For now, make libclang a static lib there. - libclang_target_type = "static_library" -} else { thakis wrote: > probably should update these too: > > ``` > % rg

[PATCH] D108223: gn build: Build libclang.so on ELF platforms.

2021-08-18 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb2e77cd095a6: gn build: Build libclang.so and libLTO.so on ELF platforms. (authored by pcc). Changed prior to commit: https://reviews.llvm.org/D108223?vs=366966&id=367318#toc Repository: rG LLVM Gith

[PATCH] D107850: [asan] Implemented intrinsic for the custom calling convention similar used by HWASan for X86.

2021-08-19 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:1640 +def int_asan_check_memaccess : + Intrinsic<[],[llvm_ptr_ty, llvm_i8_ty, llvm_i8_ty], eugenis wrote: > vitalybuka wrote: > > kstoimenov wrote: > > > vitalybuka wrote: > > > > vitaly

[PATCH] D107850: [asan] Implemented intrinsic for the custom calling convention similar used by HWASan for X86.

2021-08-19 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:1640 +def int_asan_check_memaccess : + Intrinsic<[],[llvm_ptr_ty, llvm_i8_ty, llvm_i8_ty], kstoimenov wrote: > eugenis wrote: > > vitalybuka wrote: > > > pcc wrote: > > > > eugenis wrote

[PATCH] D108479: [Clang] Add __builtin_addressof_nocfi

2021-10-27 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM Comment at: clang/lib/AST/APValue.cpp:133 +void APValue::LValueBase::setNoCFIValue(bool NoCFI) { + if (is()) { +Local.NoCFIValue = NoCFI; Remove braces

[PATCH] D112761: cfi-icall: Add -fsanitize-cfi-promotion-aliases

2021-10-28 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc requested changes to this revision. pcc added a comment. This revision now requires changes to proceed. I asked @samitolvanen out-of-band to check whether this really needs a flag since it seems like there could be some underlying issue that needs to be resolved so that we can do this uncond

[PATCH] D108479: [Clang] Add __builtin_addressof_nocfi

2021-11-04 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc requested changes to this revision. pcc added subscribers: rjmccall, rsmith. pcc added a comment. This revision now requires changes to proceed. In D108479#3108360 , @ardb wrote: > I would argue that the existing __builtin_addressof() should absorb th

[PATCH] D108479: [Clang] Add __builtin_addressof_nocfi

2021-11-05 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. > Maybe it should even be semantically restricted to require a constant decl > reference as its operand? I think we should do this. Maybe it should be named something like `__builtin_symbol_address` if we're intending for this to have an effect with PAuth as well? Reposi

[PATCH] D108479: [Clang] Add __builtin_addressof_nocfi

2021-11-05 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added subscribers: rjmccall, rsmith. pcc added a comment. (Adding back @rsmith, @rjmccall.) In D108479#3113035 , @samitolvanen wrote: > In D108479#3112492 , @rjmccall > wrote: > >> You could also make this

[PATCH] D113738: [LTO] Allow passing -Os/-Oz as the optimization level

2021-11-12 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Please see D63976 where we rejected a similar change in favor of just letting this be controllable at compile time. To the extent that the pass pipeline is affected by the size optimization level, I think we should change the passes so that

[PATCH] D108479: [Clang] Add __builtin_addressof_nocfi

2021-11-15 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. In D108479#3129577 , @rjmccall wrote: > In D108479#3129571 , @jrtc27 wrote: > >> For CHERI there's the added complication that descriptors and trampolines >> can exist for security reasons wh

[PATCH] D104830: AST: Create __va_list in the std namespace even in C.

2021-11-20 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Agreed that this should probably be done in the mangler, I'll try to take a look next week. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104830/new/ https://reviews.llvm.org/D104830 __

[PATCH] D115015: CodeGen: Strip exception specifications from function types in CFI type names.

2021-12-02 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added a reviewer: eugenis. pcc requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. With C++17 the exception specification has been made part of the function type, and therefore part of mangled type names. However

[PATCH] D120862: Sema: Allow scoped enums as source type for integral conversion.

2022-09-30 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Ping^2. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120862/new/ https://reviews.llvm.org/D120862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[PATCH] D135421: Driver: Change default Android linker to lld.

2022-10-06 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added reviewers: srhines, rprichard, danalbert. Herald added subscribers: danielkiss, cryptoad. Herald added a project: All. pcc requested review of this revision. Herald added a subscriber: MaskRay. Herald added a project: clang. The clang distributed with the Andro

[PATCH] D135421: Driver: Change default Android linker to lld.

2022-10-12 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135421/new/ https://reviews.llvm.org/D135421 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[PATCH] D135421: Driver: Change default Android linker to lld.

2022-10-13 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG8d9c4a7425d9: Driver: Change default Android linker to lld. (authored by pcc). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D120862: Sema: Allow scoped enums as source type for integral conversion.

2022-10-13 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Does that DR apply retroactively to C++17? I get the impression that "Status: C++20" means that the issue was only fixed in C++20, which would make this well-formed with `-std=c++17`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D139395: Add CFI integer types normalization

2023-01-31 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. LGTM with nits Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1694 + getCXXABI().getMangleContext().mangleTypeName( + T, Out, !!getCodeGenOpts().SanitizeCfiICallNormalizeIntegers); + Is the !! necessary he

[PATCH] D139395: Add CFI integer types normalization

2023-01-31 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139395/new/ https://reviews.llvm.org/D139395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D139395: Add CFI integer types normalization

2023-01-19 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. In D139395#4066948 , @samitolvanen wrote: > Thanks for the patch, Ramon. This looks like a reasonable approach to me, and > just for reference, here appears to be the corresponding rustc change: > > https://github.com/rust-lang/rust

[PATCH] D127876: [clang] Don't emit type test/assume for virtual classes that should never participate in WPD

2022-06-15 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc requested changes to this revision. pcc added a comment. This revision now requires changes to proceed. This diverges from the documented behavior of `-lto-whole-program-visibility`. The flag is meant to give all classes hidden LTO visibility, but now it only does that to some of them. Rep

[PATCH] D127876: [clang] Don't emit type test/assume for virtual classes that should never participate in WPD

2022-06-15 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. In D127876#3586154 , @aeubanks wrote: > In D127876#3586134 , @pcc wrote: > >> This diverges from the documented behavior of >> `-lto-whole-program-visibility`. The flag is meant to give all c

[PATCH] D127876: [clang] Don't emit type test/assume for virtual classes that should never participate in WPD

2022-06-15 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. Okay, it seems reasonable enough to have the `[[clang::lto_visibility_public]]` attribute override the `--lto-whole-program-visibility` flag. What I'm not sure about though is whether `__declspec(uu

[PATCH] D119296: KCFI sanitizer

2022-06-23 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6694 - if (isExternallyVisible(T->getLinkage())) { + if (isExternallyVisible(T->getLinkage()) || !OnlyExternal) { std::string OutName; It would be better to have a separate functi

[PATCH] D115844: [ubsan] Using metadata instead of prologue data for function sanitizer

2022-06-23 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM > Yes, but not indirectly called from C/C++ but rather from compiler-generated > code right? That's presumably why this patch + D116130 > worked for @zhuhan0

[PATCH] D71913: [LTO/WPD] Enable aggressive WPD under LTO option

2020-03-02 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/test/CodeGenCXX/lto-visibility-inference.cpp:73 c1->f(); - // ITANIUM-NOT: type.test{{.*}}!"_ZTS2C2" + // ITANIUM: type.test{{.*}}!"_ZTS2C2" // MS: type.test{{.*}}!"?AUC2@@" tejohnson wrote: > evgeny777 wrote:

[PATCH] D69574: Remove lazy thread-initialisation

2019-11-01 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69574/new/ https://reviews.llvm.org/D69574 ___ cfe-c

[PATCH] D70692: IRGen: Call SetLLVMFunctionAttributes{, ForDefinition} on __cfi_check_fail.

2019-11-25 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added a reviewer: eugenis. Herald added a project: clang. This has the main effect of causing target-cpu and target-features to be set on __cfi_check_fail, causing the function to become ABI-compatible with other functions in the case where these attributes affect AB

[PATCH] D70692: IRGen: Call SetLLVMFunctionAttributes{, ForDefinition} on __cfi_check_fail.

2019-11-25 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG90b8bc003caa: IRGen: Call SetLLVMFunctionAttributes{,ForDefinition} on __cfi_check_fail. (authored by pcc). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70

[PATCH] D70765: LTOVisibility.rst: fix up syntax in example

2019-11-27 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc accepted this revision. pcc added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70765/new/ https://reviews.llvm.org/D70765 ___ cfe-c

[PATCH] D71154: Driver: Don't look for libc++ headers in the install directory on Android.

2019-12-06 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added reviewers: danalbert, srhines. Herald added a reviewer: EricWF. Herald added a subscriber: ldionne. Herald added a project: clang. The NDK uses a separate set of libc++ headers in the sysroot. Any headers in the installation directory are not going to work on A

[PATCH] D71154: Driver: Don't look for libc++ headers in the install directory on Android.

2019-12-06 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc marked an inline comment as done. pcc added inline comments. Comment at: clang/test/Driver/android-no-installed-libcxx.cpp:8 +// RUN: -stdlib=libc++ -fsyntax-only %s -### 2>&1 | FileCheck %s +// CHECK-NOT: "-internal-isystem" "{{.*}}v1" danalbert wrote: > T

[PATCH] D71154: Driver: Don't look for libc++ headers in the install directory on Android.

2019-12-06 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG198fbcb81749: Driver: Don't look for libc++ headers in the install directory on Android. (authored by pcc). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D711

[PATCH] D71154: Driver: Don't look for libc++ headers in the install directory on Android.

2019-12-09 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc reopened this revision. pcc added a comment. This revision is now accepted and ready to land. Relanding with a fix for the problem found by @davezarzycki. The test needed to be adjusted to set `--sysroot`, otherwise it will fail in the case where a directory named `/usr/include/c++/v1` or `/

[PATCH] D71154: Driver: Don't look for libc++ headers in the install directory on Android.

2019-12-09 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbab9849963eb: Reland 198fbcb8, "Driver: Don't look for libc++ headers in the install… (authored by pcc). Changed prior to commit: https://reviews.llvm.org/D71154?vs=232683&id=232892#toc Repository: r

[PATCH] D75655: [Docs] Document -lto-whole-program-visibility

2020-03-05 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/docs/LTOVisibility.rst:40 +to hidden LTO visibility when the ``-lto-whole-program-visibility`` lld linker +option is applied (``-plugin-opt=whole_program_visibility`` for gold). This +can be used when it is known that the LTO link has

[PATCH] D71913: [LTO/WPD] Enable aggressive WPD under LTO option

2020-03-05 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/test/CodeGenCXX/lto-visibility-inference.cpp:73 c1->f(); - // ITANIUM-NOT: type.test{{.*}}!"_ZTS2C2" + // ITANIUM: type.test{{.*}}!"_ZTS2C2" // MS: type.test{{.*}}!"?AUC2@@" tejohnson wrote: > pcc wrote: > > te

[PATCH] D75655: [Docs] Document -lto-whole-program-visibility

2020-03-12 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/docs/LTOVisibility.rst:45 +build system, and the binary will not dlopen any libraries deriving from the +binary’s classes. This is useful in situations where it is not safe to specify +``-fvisibility=hidden`` at compile time. -

[PATCH] D74150: Update hwasan docs to cover outlined checks and globals.

2020-02-06 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc created this revision. pcc added reviewers: eugenis, hctim, kcc. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D74150 Files: clang/docs/HardwareAssistedAddressSanitizerDesign.rst Index: clang/docs/Hard

[PATCH] D74150: Update hwasan docs to cover outlined checks and globals.

2020-02-06 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc marked 5 inline comments as done. pcc added inline comments. Comment at: clang/docs/HardwareAssistedAddressSanitizerDesign.rst:87 + bl __hwasan_check_x0_2_short // call outlined tag check +// (a

[PATCH] D74150: Update hwasan docs to cover outlined checks and globals.

2020-02-06 Thread Peter Collingbourne via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. pcc marked an inline comment as done. Closed by commit rG7931e8eee3da: Update hwasan docs to cover outlined checks and globals. (authored by pcc). Changed prior to commit: https://reviews.llvm.org/D74150?vs=242962&id=2430

<    1   2   3   4   >