summaryrefslogtreecommitdiffstats
path: root/llvm/utils/gn/secondary/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
* gn build: Silence mismatched-new-delete warning in scudo C++ wrapper tests.Peter Collingbourne2019-12-201-0/+4
| | | | | | | These tests are deliberately mismatching new and delete, so the warnings are just noise. Differential Revision: https://reviews.llvm.org/D71783
* scudo: Add a basic malloc/free benchmark.Peter Collingbourne2019-12-092-0/+11
| | | | Differential Revision: https://reviews.llvm.org/D71104
* gn build: Change scudo's list of supported platforms to a whitelist.Peter Collingbourne2019-12-061-5/+1
| | | | | | | | Scudo only supports building for android/linux/fuchsia, so require target_os to be one of linux/fuchsia to do a stage2_unix scudo build. Android is already covered by the stage2_android* toolchains below. Differential Revision: https://reviews.llvm.org/D71131
* gn build: Unbreak mac build after 4066591Nico Weber2019-12-061-1/+5
|
* gn build: Add support for building scudo and its unit tests.Peter Collingbourne2019-12-053-0/+190
| | | | Differential Revision: https://reviews.llvm.org/D71081
* Revert "Revert "gn build: (manually) try to merge 1689ad27af""Nico Weber2019-11-271-0/+2
| | | | | This reverts commit 88276ddbfea753ac13da5a64c2020b7b0a06617f. The original change relanded.
* gn build: (manually) merge 9e676d9c7eNico Weber2019-11-251-0/+1
|
* Reland "[CMake] Support installation of InstrProfData.inc"Petr Hosek2019-11-221-0/+5
| | | | | | | | | | | This header fragment is useful on its own for any consumer that wants to use custom instruction profile runtime with the LLVM instrumentation. The concrete use case is in Fuchsia's kernel where we want to use instruction profile instrumentation, but we cannot use the compiler-rt runtime because it's not designed for use in the kernel environment. This change allows installing this header as part of compiler-rt. Differential Revision: https://reviews.llvm.org/D64532
* Revert "gn build: (manually) try to merge 1689ad27af"Nico Weber2019-11-191-2/+0
| | | | | This reverts commit e4ec2ecf6d4768d681a89263c0a4d29a7b7761ad. 1689ad27af was reverted as well.
* gn build: (manually) try to merge 1689ad27afNico Weber2019-11-181-0/+2
|
* gn build: Add support for cross-compiling the builtins and profile runtimes ↵Peter Collingbourne2019-10-311-68/+64
| | | | | | for Android aarch64 and arm. Differential Revision: https://reviews.llvm.org/D69681
* gn build: s/target_/current_/g in compiler-rt/lib/{builtins,profile}.Peter Collingbourne2019-10-312-20/+20
| | | | | | Fixes stage2 cross compilation. Differential Revision: https://reviews.llvm.org/D69680
* gn build: (manually) merge 67474c60d34Nico Weber2019-10-301-0/+2
|
* gn build: pacify "gn format" after 371102Nico Weber2019-09-131-0/+2
| | | | llvm-svn: 371858
* gn build: (manually) merge r358706Nico Weber2019-09-051-18/+24
| | | | llvm-svn: 371102
* gn build: (manually) merge r371003Nico Weber2019-09-051-0/+3
| | | | llvm-svn: 371091
* hwasan: Untag unwound stack frames by wrapping personality functions.Peter Collingbourne2019-08-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | One problem with untagging memory in landing pads is that it only works correctly if the function that catches the exception is instrumented. If the function is uninstrumented, we have no opportunity to untag the memory. To address this, replace landing pad instrumentation with personality function wrapping. Each function with an instrumented stack has its personality function replaced with a wrapper provided by the runtime. Functions that did not have a personality function to begin with also get wrappers if they may be unwound past. As the unwinder calls personality functions during stack unwinding, the original personality function is called and the function's stack frame is untagged by the wrapper if the personality function instructs the unwinder to keep unwinding. If unwinding stops at a landing pad, the function is still responsible for untagging its stack frame if it resumes unwinding. The old landing pad mechanism is preserved for compatibility with old runtimes. Differential Revision: https://reviews.llvm.org/D66377 llvm-svn: 369721
* gn build: Merge r367463Nico Weber2019-07-311-64/+81
| | | | llvm-svn: 367464
* compiler-rt: Rename .cc file in lib/profile to .cppNico Weber2019-07-311-1/+1
| | | | | | | | See https://reviews.llvm.org/D58620 for discussion. Note how the comment in the file already said ".cpp" :) llvm-svn: 367460
* gn build: Merge r367456Nico Weber2019-07-311-4/+4
| | | | llvm-svn: 367457
* gn build: Merge r367452 and add standalone sourcesNico Weber2019-07-311-10/+23
| | | | llvm-svn: 367454
* gn build: Add build files for compiler-rt/lib/profileNico Weber2019-07-313-1/+68
| | | | | | Differential Revision: https://reviews.llvm.org/D65518 llvm-svn: 367450
* gn build: Make builtin library build on macOSNico Weber2019-07-311-1/+5
| | | | | | | | For now, it only builds the x86_64 slice. Differential Revision: https://reviews.llvm.org/D65513 llvm-svn: 367449
* gn build: Fix redundant object files in builtin lib.Nico Weber2019-07-311-53/+73
| | | | | | | | | | | | | | | | | | | | | | compiler-rt's builtin library has generic implementations of many functions, and then per-arch optimized implementations of some. In the CMake build, both filter_builtin_sources() and an explicit loop at the end of the build file (see D37166) filter out the generic versions if a per-arch file is present. The GN build wasn't doing this filtering. Just do the filtering manually and explicitly, instead of being clever. While here, also remove files from the mingw/arm build that are redundantly listed after D39938 / r318139 (both from the CMake and the GN build). While here, also fix a target_os -> target_cpu typo. Differential Revision: https://reviews.llvm.org/D65512 llvm-svn: 367448
* gn build: Wrap two comments to 80 columnsNico Weber2019-07-221-2/+3
| | | | llvm-svn: 366763
* [GN] Generation failure caused by trailing space in file namePetr Hosek2019-06-231-1/+1
| | | | | | | | | | | | | | | | | | When I executed gn.py gen out/gn I got the following error: ERROR at //compiler-rt/lib/builtins/BUILD.gn:162:7: Only source, header, and object files belong in the sources of a static_library. //compiler-rt/lib/builtins/emutls.c is not one of the valid types. "emutls.c ", ^---------- See //compiler-rt/lib/BUILD.gn:3:5: which caused the file to be included. "//compiler-rt/lib/builtins", ^--------------------------- It turns out to be that the latest gn doesn't accept ill-format file name. And the emutls.c above has a trailing space. Remove the trailing space should work. Patch By: myhsu Differential Revision: https://reviews.llvm.org/D63449 llvm-svn: 364162
* gn build: Merge r363483.Peter Collingbourne2019-06-171-0/+2
| | | | llvm-svn: 363610
* gn-build: Re-run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py ↵Nico Weber2019-04-081-2/+3
| | | | | | format` llvm-svn: 357906
* [gn] Support for per-target runtime directory layoutPetr Hosek2019-04-062-6/+6
| | | | | | | | | | This change also introduces the clang_enable_per_target_runtime_dir to enable the use of per-target runtime directory layout which is the equivalent of LLVM_ENABLE_PER_TARGET_RUNTIME_DIR CMake option. Differential Revision: https://reviews.llvm.org/D60332 llvm-svn: 357850
* gn build: Pacify `gn format`Nico Weber2019-04-051-0/+8
| | | | llvm-svn: 357830
* [gn] Support for building compiler-rt builtinsPetr Hosek2019-04-052-0/+481
| | | | | | | | | | | | | | | | This is support for building compiler-rt builtins, The library build should be complete for a subset of supported platforms, but not all CMake options have been replicated in GN. We always use the just built compiler to build all the runtimes, which is equivalent to the CMake runtimes build. This simplifies the build configuration because we don't need to support arbitrary host compiler and can always assume the latest Clang. With GN's toolchain support, this is significantly more efficient than the CMake runtimes build. Differential Revision: https://reviews.llvm.org/D60331 llvm-svn: 357821
* Remove esan.Nico Weber2019-03-111-3/+0
| | | | | | | | | | | It hasn't seen active development in years, and it hasn't reached a state where it was useful. Remove the code until someone is interested in working on it again. Differential Revision: https://reviews.llvm.org/D59133 llvm-svn: 355862
* [HWASan] Save + print registers when tag mismatch occurs in AArch64.Mitch Phillips2019-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change change the instrumentation to allow users to view the registers at the point at which tag mismatch occured. Most of the heavy lifting is done in the runtime library, where we save the registers to the stack and emit unwind information. This allows us to reduce the overhead, as very little additional work needs to be done in each __hwasan_check instance. In this implementation, the fast path of __hwasan_check is unmodified. There are an additional 4 instructions (16B) emitted in the slow path in every __hwasan_check instance. This may increase binary size somewhat, but as most of the work is done in the runtime library, it's manageable. The failure trace now contains a list of registers at the point of which the failure occured, in a format similar to that of Android's tombstones. It currently has the following format: Registers where the failure occurred (pc 0x0055555561b4): x0 0000000000000014 x1 0000007ffffff6c0 x2 1100007ffffff6d0 x3 12000056ffffe025 x4 0000007fff800000 x5 0000000000000014 x6 0000007fff800000 x7 0000000000000001 x8 12000056ffffe020 x9 0200007700000000 x10 0200007700000000 x11 0000000000000000 x12 0000007fffffdde0 x13 0000000000000000 x14 02b65b01f7a97490 x15 0000000000000000 x16 0000007fb77376b8 x17 0000000000000012 x18 0000007fb7ed6000 x19 0000005555556078 x20 0000007ffffff768 x21 0000007ffffff778 x22 0000000000000001 x23 0000000000000000 x24 0000000000000000 x25 0000000000000000 x26 0000000000000000 x27 0000000000000000 x28 0000000000000000 x29 0000007ffffff6f0 x30 00000055555561b4 ... and prints after the dump of memory tags around the buggy address. Every register is saved exactly as it was at the point where the tag mismatch occurs, with the exception of x16/x17. These registers are used in the tag mismatch calculation as scratch registers during __hwasan_check, and cannot be saved without affecting the fast path. As these registers are designated as scratch registers for linking, there should be no important information in them that could aid in debugging. Reviewers: pcc, eugenis Reviewed By: pcc, eugenis Subscribers: srhines, kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, hiraditya, jdoerfert, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58857 llvm-svn: 355738
* gn build: Add a cfi/sources target.Nico Weber2019-03-021-0/+8
| | | | | | | | This build target is currently unused, but after r355144 the sync script started complaining about cfi.cpp not being listed, and this makes the script happy again. llvm-svn: 355275
* [hwasan, asan] Intercept vfork.Evgeniy Stepanov2019-02-271-0/+1
| | | | | | | | | | | | | | | Summary: Intercept vfork on arm, aarch64, i386 and x86_64. Reviewers: pcc, vitalybuka Subscribers: kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58533 llvm-svn: 355030
* gn build: Merge r354989Nico Weber2019-02-271-11/+11
| | | | llvm-svn: 354991
* Revert "[asan] Fix vfork handling.", +1Evgeniy Stepanov2019-02-211-1/+0
| | | | | | Revert r354625, r354627 - multiple build failures. llvm-svn: 354629
* [hwasan,asan] Intercept vfork.Evgeniy Stepanov2019-02-211-0/+1
| | | | | | | | | | | | | | Summary: AArch64 only for now. Reviewers: vitalybuka, pcc Subscribers: srhines, kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, jdoerfert, #sanitizers, llvm-commits, kcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58313 llvm-svn: 354625
* gn build: Merge r354156Nico Weber2019-02-182-0/+2
| | | | llvm-svn: 354242
* gn build: Create regular archives for the sanitizer runtimes.Peter Collingbourne2019-02-011-2/+8
| | | | | | | | | | We'll need to do this eventually if we create an installable package. For now, this lets me use the archives to build Android, whose build system wants to copy the archives to another location. Differential Revision: https://reviews.llvm.org/D57607 llvm-svn: 352907
* gn build: Add headers to compiler-rt build files.Peter Collingbourne2019-01-164-0/+103
| | | | | | Also fix sort order in llvm/lib/CodeGen/GlobalISel/BUILD.gn. llvm-svn: 351367
* gn build: Add check-hwasan target.Peter Collingbourne2019-01-161-0/+10
| | | | | | | | | | | | | | | | | | | | The Android sanitizer tests are currently some of the most difficult to run correctly, requiring at least 3 build directories which have to be configured in just the right way and built in the correct order (see e.g. [1] and the functions that it calls). This patch adds a check-hwasan target which greatly simplifies running the hwasan tests for gn users, taking advantage of its support for multiple toolchains. With this the tests can be run simply by setting an NDK path and running "ninja check-hwasan" with a compatible Android device connected. The Linux/x86_64 and Android/aarch64 targets are tested in parallel. [1] https://github.com/llvm/llvm-zorg/blob/master/zorg/buildbot/builders/sanitizers/buildbot_android.sh Differential Revision: https://reviews.llvm.org/D56713 llvm-svn: 351277
* gn build: Add a stage2 host toolchain and make the hwasan runtime buildable ↵Peter Collingbourne2019-01-152-16/+24
| | | | | | | | on x86_64 Linux. Differential Revision: https://reviews.llvm.org/D56711 llvm-svn: 351258
* gn build: Add a resource_dir.gni file.Peter Collingbourne2019-01-151-2/+2
| | | | | | | | | | | The path to the resource directory will end up being used in several more places once the support for running check-hwasan lands. This moves the definition to a central location so that it can be used from those places. Differential Revision: https://reviews.llvm.org/D56700 llvm-svn: 351255
* gn build: Add build files for ↵Peter Collingbourne2019-01-154-0/+220
compiler-rt/lib/{hwasan,interception,sanitizer_common,ubsan}. This allows the hwasan runtime to be built for Android aarch64. Differential Revision: https://reviews.llvm.org/D56628 llvm-svn: 351246
OpenPOWER on IntegriCloud