15978 Commits

Author SHA1 Message Date
Andrew Browne
065d2e1d8b [DFSan] Fix handling of libAtomic external functions.
Implementation based on MSan.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D132070
2022-08-22 16:04:29 -07:00
Vitaly Buka
d848186a3b [tsan] Keep thread/stack for closed FD
Fixes b/242869837

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D132068
2022-08-22 12:00:52 -07:00
Vitaly Buka
cab58b7e5c [sanitizer] use ../runtimes path to build libcxx 2022-08-21 18:41:55 -07:00
John Ericson
176db3b3ab [RFC] Remove support for building C++ with LLVM_ENABLE_PROJECTS
This has been officially deprecated since D112724, meaning the
deprecation warning is present in released 14 and 15.

This makes me think that now, shortly after the 15 release is branched,
is a good time to pull the trigger.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D132324
2022-08-21 08:10:56 -04:00
Vitaly Buka
fbebf0f6de [msan] Bump max allocation on aarch64 2022-08-19 21:16:31 -07:00
Ellis Hoag
5779966da8 Revert "Revert "[compiler-rt] Fix check for cross-compiling""
This reverts commit 18f6b05e0a5a4197bac787f5522669576c134869.

This is a reland of https://reviews.llvm.org/D132130 which I incorrectly
thought had broken the builds.

Differential Revision: https://reviews.llvm.org/D132230
2022-08-19 07:00:51 -07:00
David Blaikie
89d7db9d81 Revert "[tsan] Keep thread/stack for closed FD"
Test is flaky.

This reverts commit e9c5bde88ea2e35fadb15c5e5a1d2cb583fd0772.
2022-08-19 04:01:42 +00:00
John Ericson
e941b031d3 Revert "[cmake] Use CMAKE_INSTALL_LIBDIR too"
This reverts commit f7a33090a91015836497c75f173775392ab0304d.

Unfortunately this causes a number of failures that didn't show up in my
local build.
2022-08-18 22:46:32 -04:00
Shoaib Meenai
d7a4ff9986 [compiler-rt] Clean up explicit -std=c++17 addition
This was superseded by 5737f6a527d782e6577e5cc1e0c743df2c98546a. Clean
it up as suggested by Mike Hommey in https://reviews.llvm.org/D131937.
2022-08-18 15:53:47 -07:00
Ellis Hoag
18f6b05e0a Revert "[compiler-rt] Fix check for cross-compiling"
This reverts commit ee80903a2ceb03f4617550eba55881f7b80ebb8e.

This seems to have broke builds

Differential Revision: https://reviews.llvm.org/D132174
2022-08-18 13:43:21 -07:00
Ellis Hoag
ee80903a2c [compiler-rt] Fix check for cross-compiling
When checking if we are cross-compiling, use `CMAKE_HOST_SYSTEM_NAME`
rather than `CMAKE_HOST_SYSTEM` which seems to have the full version
number attached.

Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D132130
2022-08-18 13:30:46 -07:00
John Ericson
f7a33090a9 [cmake] Use CMAKE_INSTALL_LIBDIR too
We held off on this before as `LLVM_LIBDIR_SUFFIX` conflicted with it.
Now we return this.

`LLVM_LIBDIR_SUFFIX` is kept as a deprecated way to set
`CMAKE_INSTALL_LIBDIR`. The other `*_LIBDIR_SUFFIX` are just removed
entirely.

I imagine this is too potentially-breaking to make LLVM 15. That's fine.
I have a more minimal version of this in the disto (NixOS) patches for
LLVM 15 (like previous versions). This more expansive version I will
test harder after the release is cut.

Reviewed By: sebastian-ne, ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D130586
2022-08-18 15:33:35 -04:00
Vitaly Buka
e9c5bde88e [tsan] Keep thread/stack for closed FD
Fixes b/242869837

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D132068
2022-08-18 01:29:29 -07:00
Vitaly Buka
3f5f2905c4 [test] Propagate HWASAN_OPTIONS 2022-08-17 18:59:49 -07:00
Vitaly Buka
36bdec44a2 [NFC][tsan] Use AddThread(Tid tid... 2022-08-17 13:53:13 -07:00
John Ericson
d784ecfea9 [compiler-rt][libunwind][runtimes] Recategorize llvm_check_linker_flag langs
Done according to @phosek's comments in D117537, but not done then to
separate pure refactor (that) from possible behavior change (this).

Wasn't working before, but I think that was due to an issue of mismatched variable names fixed in D110005.

Reviewed By: phosek, #libunwind, #libc_abi

Differential Revision: https://reviews.llvm.org/D117833
2022-08-17 12:35:36 -04:00
Maxim Schessler
aa0e9046c1 Libfuzzer fix for Ctrl + c not working with -fork and -ignore_crashes=1
In some cases running Libfuzzer in fork mode with -ignore_crashes=1 counts ctrl+c as crash and restarts.

Thread: https://github.com/google/oss-fuzz/issues/4547

Credit: Marcel Boehme <marcel.boehme@acm.org>

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D130990
2022-08-16 16:45:39 -07:00
Shoaib Meenai
5737f6a527 [compiler-rt] Build with C++17 explicitly
We've started using C++17 constructs in compiler-rt now (e.g.
string_view in ORC), but when using the bootstrapping build, we won't
inherit the C++ standard from LLVM, and compilation may fail if we
default to an older standard. Explicitly build compiler-rt with C++17 in
a standalone build, which matches what other subprojects (e.g. Clang and
LLD) do.
2022-08-16 16:24:42 -07:00
Nico Weber
f56e486fdc [gn build] Make ubsan_init_standalone_preinit.cpp syncable
...after https://reviews.llvm.org/D131916
2022-08-15 18:17:06 -04:00
Kevin Athey
c22841049e [MSAN] clean up style from D131728
Depends on D131728

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131903
2022-08-15 11:46:07 -07:00
Martin Storsjö
156136502b [ORC_RT][COFF] Fix cross compilation with mingw headers
Mingw headers are all lowercase, and can be used for cross compilation
from case sensitive file systems.

The official Windows SDK headers aren't self-consistent wrt upper/lower
case, so those headers can't be used on case sensitive systems without
a layer providing case insensitivity anyway.

This matches other includes of windows.h throughout the codebase.
2022-08-14 14:23:25 +03:00
Kazu Hirata
062f157c7f Ensure newlines at the end of files (NFC) 2022-08-13 12:55:45 -07:00
Vitaly Buka
57d0e9bf96 [test][sanitizer] Disable netdb tests on Android 2022-08-13 01:07:12 -07:00
Vitaly Buka
c34b0720ca [test][sanitizer] Fix REQUIRES in the test 2022-08-13 00:04:55 -07:00
Vitaly Buka
cd269daf25 [test][asan] Remove -fsanitize-address-use-after-scope
It's enabled by default in D31479.
2022-08-13 00:04:55 -07:00
Sunho Kim
9189a26664 [ORC_RT][COFF] Initial platform support for COFF/x86_64.
Initial platform support for COFF/x86_64.

Completed features:
* Statically linked orc runtime.
* Full linking/initialization of static/dynamic vc runtimes and microsoft stl libraries.
* SEH exception handling.
* Full static initializers support
* dlfns
* JIT side symbol lookup/dispatch

Things to note:
* It uses vc runtime libraries found in vc toolchain installations.
* Bootstrapping state is separated because when statically linking orc runtime it needs microsoft stl functions to initialize the orc runtime, but static initializers need to be ran in order to fully initialize stl libraries.
* Process symbols can't be used blidnly on msvc platform; otherwise duplicate definition error gets generated. If process symbols are used, it's destined to get out-of-reach error at some point.
* Atexit currently not handled -- will be handled in the follow-up patches.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D130479
2022-08-13 13:48:40 +09:00
Vitaly Buka
4b33ea052a [sanitizer] Add dn_comp interceptor
Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D129247
2022-08-12 16:57:49 -07:00
Kevin Athey
532564de17 [MSAN] add flag to suppress storage of stack variable names with -sanitize-memory-track-origins
Allows for even more savings in the binary image while simultaneously removing the name of the offending stack variable.

Depends on D131631

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131728
2022-08-12 11:59:53 -07:00
Kevin Athey
ec277b67eb [MSAN] Separate id ptr from constant string for variable names used in track origins.
The goal is to reduce the size of the MSAN with track origins binary, by making
the variable name locations constant which will allow the linker to compress
them.

Follows: https://reviews.llvm.org/D131415

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131631
2022-08-12 08:47:36 -07:00
Kevin Athey
4735104f09 [MSAN] remove unused debugging statements (NFC)
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131748
2022-08-11 20:24:34 -07:00
Vitaly Buka
aca1276160 [msan] Avoid unnecessary PC increment/decrement
Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D131692
2022-08-11 14:29:07 -07:00
Vitaly Buka
4248f32b9e [NFC][sanitizer] Use __builtin_extract_return_addr on all platforms
On most platforms it does nothing, so this eliminates a need for one #if.
2022-08-11 09:48:29 -07:00
Vitaly Buka
e41c5aaebe [NFC][sanitizer] Add () into a few macros 2022-08-11 09:48:28 -07:00
Vitaly Buka
c615411d82 [test][asan] Disable symbolization
Reduces runtime of the test.
Unrelated pre-merge checks often timeouts here.
2022-08-11 00:02:02 -07:00
Vitaly Buka
af77e5e4c0 [msan] Extract SetAllocaOrigin 2022-08-10 20:53:02 -07:00
Vitaly Buka
d1040c455f [msan] Another try for powerpc fix after D131205 2022-08-10 20:39:25 -07:00
Vitaly Buka
05b3374925 [msan] Try to fix powerpc after D131205 2022-08-10 19:28:30 -07:00
Phoebe Wang
f061cfb317 [compiler-rt][BF16] Provide __truncdfbf2 and __truncsfbf2 only when __bf16 is available
Differential Revision: https://reviews.llvm.org/D131147
2022-08-11 09:20:08 +08:00
Vitaly Buka
ad5f7895ef [test][sanitizer] Fix REQUIRES of the test
getnetent is availible from API 28
2022-08-10 16:59:40 -07:00
Vitaly Buka
e87ee2f4a9 [test][sanitizer] Switch test to a different group 2022-08-10 16:59:40 -07:00
Vitaly Buka
58063c8ade [test][sanitizer] Change exit code to debug llvm-avr-linux 2022-08-10 16:29:28 -07:00
Vitaly Buka
27b1a8273d [test][sanitizer] Fix REQUIRES in few tests 2022-08-10 16:17:12 -07:00
Vitaly Buka
6b12043beb [test][sanitizer] Fix getgrouplist test 2022-08-10 15:48:44 -07:00
Kevin Athey
057cabd997 Remove function name from sanitize-memory-track-origins binary.
This work is being done to reduce the size of MSAN with track origins binary.

Builds upon: https://reviews.llvm.org/D131205

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131415
2022-08-10 15:45:40 -07:00
Kevin Athey
d7a47a9bb5 Desist from passing function location to __msan_set_alloca_origin4.
This is done by calling __msan_set_alloca_origin and providing the location of the variable by using the call stack.
This is prepatory work for dropping variable names when track-origins is enabled.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131205
2022-08-10 09:02:53 -07:00
Phoebe Wang
800d5e178f Revert "Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available""
This reverts commit 0729d00135ccbe1514a49168bbf26986823235c2.

Buildbot https://lab.llvm.org/buildbot/#/builders/19/builds/11989 failed
with "error: ISO C requires a translation unit to contain at least one declaration [-Werror,-Wempty-translation-unit]"
2022-08-10 17:27:44 +08:00
Fangrui Song
0e08061229 tsan: update Go rules to use -std=c++17
llvm-project has switched to require C++17.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D131536
2022-08-10 00:32:40 -07:00
Phoebe Wang
0729d00135 Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available"
Disable the build on macOS due to the bot fail.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D131147
2022-08-10 13:27:21 +08:00
Med Ismail Bennani
5990cf3806 Revert "Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available""
This reverts commit ab4e5ed441d475ead43bc4ce1cdef842688292f4 since it
causes a build failure on macOS:

https://green.lab.llvm.org/green/job/lldb-cmake/45984/
2022-08-09 21:45:21 -07:00
Phoebe Wang
ab4e5ed441 Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available"
Fix the mising change for truncdfbf2.c

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D131147
2022-08-10 10:22:15 +08:00