17257 Commits

Author SHA1 Message Date
Zequan Wu
f934d6b425 Revert "[Profile] Remove duplicate file locks when enabled continuous mode and online merging."
This reverts commit 985486dca48bffd9e991d9f5ac32e1d109ae000f.

This seems to cause malformed profdata: crbug.com/1469456

(cherry picked from commit 4b08be77c98a4c15b8b3d634fab4ffc24bf4ef38)
2023-08-16 08:53:32 +02:00
YunQiang Su
bdf92159c8 MIPS: clear_cache, use _flush_cache instead of cacheflush
The cacheflush is only defined with __USE_MISC, which depends on _DEFAULT_SOURCE,
_GNU_SOURCE or _BSD_SOURCE, or _SVID_SOURCE.

If CC is called with -std=c11, these macros won't be defined, Let's use
_flush_cache, which is defined always.

Reviewed By: brad, jrtc27

Differential Revision: https://reviews.llvm.org/D156072

(cherry picked from commit 0f99bc2d685c572c3b38fd0e1ca56be12d7e2f6a)
2023-08-08 09:24:10 +02:00
Rainer Orth
34cf263e61 [sanitizer_common] Remove hacks for __builtin_return_address abuse on SPARC
As detailed in Issue #57624, the introduction of
`__builtin_extract_return_address` to `GET_CALLER_PC` in
4248f32b9ebe87c7af8ee53911efd47c2652f488
<https://reviews.llvm.org/rG4248f32b9ebe87c7af8ee53911efd47c2652f488> broke
`TestCases/Misc/missing_return.cpp` on Solaris/SPARC.  Unlike most other
targets, the builtin isn't a no-op on SPARC and thus has always been
necessary. Its lack had previously been worked around by calls to
`GetNextInstructionPc` in `sanitizer_stacktrace_sparc.cpp`
(`BufferedStackTrace::UnwindFast`) and `sanitizer_unwind_linux_libcdep.cpp`
(`BufferedStackTrace::UnwindSlow`).  However, those calls are superfluous
now and actually harmful.

This patch removes those hacks, fixing the failure.

Tested on `sparcv9-sun-solaris2.11` and on `sparc-sun-solaris2.11` in the
GCC tree.  On the latter, several more testcase failures had been caused by
this issue since ASan actually works with `gcc` on SPARC, unlike `clang`.

Differential Revision: https://reviews.llvm.org/D156504

(cherry picked from commit 679c076ae446af81eba81ce9b94203a273d4b88a)
2023-08-07 09:24:12 +02:00
Craig Topper
d1603c3d90 [X86] Workaround possible CPUID bug in Sandy Bridge.
Don't access leaf 7 subleaf 1 unless subleaf 0 says it is
supported via EAX.

Intel documentation says invalid subleaves return 0. We had been
relying on that behavior instead of checking the max sublef number.

It appears that some Sandy Bridge CPUs return at least the subleaf 0
EDX value for subleaf 1. Best guess is that this is a bug in a
microcode patch since all of the bits we're seeing set in EDX were
introduced after Sandy Bridge was originally released.

This is causing avxvnniint16 to be incorrectly enabled with -march=native
on these CPUs.

Reviewed By: pengfei, anna

Differential Revision: https://reviews.llvm.org/D156963

(cherry picked from commit 2a5e3f4c6c2cdd2aab55fbfdb703ca8163351ea9)
2023-08-04 07:51:01 +02:00
Freddy Ye
6d23a3faa4 [X86] Support -march=graniterapids-d and update -march=graniterapids
Reviewed By: pengfei, RKSimon, skan

Differential Revision: https://reviews.llvm.org/D155798
2023-07-25 13:48:31 +08:00
Alex Richardson
e3374c8c31 [builtins] Avoid using CRT_LDBL_128BIT in implementation. NFC
Currently the *tf builtin functions can only be built if long double is an
IEEE float, which prevents them from being available e.g. for x86 targets
(unlike libgcc which has them). This non-functional change prepares the
builtins library *tf functions for being able to target x86 by decoupling
their presence from CRT_LDBL_128BIT and instead checking for a
CRT_HAS_TF_MODE macro. This change is NFC since the CRT_HAS_TF_MODE is
currently only set if long double is an IEEE 128-bit float.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D153812
2023-07-24 17:19:11 -07:00
Alex Richardson
b114940012 [builtins] Drop -fnested-functions flag from tests
This flag does nothing for clang and is apparently not supported by GCC:
aarch64-linux-gnu-gcc: error: unrecognized command-line option '-fnested-functions'; did you mean '-Wunused-function'?
It looks like it was maybe supported by Apple GCC, but that is no longer
a supported compiler.

Differential Revision: https://reviews.llvm.org/D153819
2023-07-24 17:19:11 -07:00
Alex Richardson
cdc6f4cdcd [builtins] Fix building trunc*fhf2_test with GCC
GCC does not support __fp16, use the TYPE_FP16 macro instead.

Differential Revision: https://reviews.llvm.org/D153813
2023-07-24 17:19:11 -07:00
Vitaly Buka
2ba8a63e33 [NFC] Add MprotectReadWrite
It's unused, but I need it for debuging.
Seems usefull for completeness.

Reviewed By: thurston

Differential Revision: https://reviews.llvm.org/D156180
2023-07-24 16:12:20 -07:00
Wu, Yingcong
fd0aa70528 [sanitizer] use the right type for sizeof for interceptor hook
`PRE_READ` is called with a pointer and the size of the object
the pointer points to. But there is one line of code not calling
`PRE_READ` correctly(likely missing a dereference).
This patch fixes the problem.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D154676
2023-07-23 20:12:39 -07:00
Fangrui Song
7a31ac3118 [InstrProf] Stabilize --show-prof-sym-list dump order
D118181 leverages the iteration order of StringSet, which is not
guaranteed to be deterministic.
2023-07-22 15:47:44 -07:00
Jessica Clarke
2b0f5df7b4 [builtins][Mips] Un-break FreeBSD build of __clear_cache
Commit 674a17e9bbe8 ("MIPS/compiler_rt: use synci to flush icache on
r6") completely removed the OS-specific guards under the guise of "For
pre-r6, we can use cacheflush libc function, which is same on Linux and
FreeBSD." However, the code in question had guards for Linux and
OpenBSD, not Linux and FreeBSD, and FreeBSD does not have a cacheflush
libc function as claimed, so this was neither the statement they
intended to make nor was it sufficient justification for making the code
completely unconditional. Whilst the upcoming FreeBSD 14 release has
dropped support for MIPS, FreeBSD 13 has support for it.

Fix this by only calling cacheflush on the OSes where it was previously
called, and not on other OSes where it either definitely isn't available
(FreeBSD) or is unknown (any other OS than the three mentioned in this
commit).
2023-07-22 23:01:21 +01:00
Kirill Stoimenov
51e49e12e7 [HWASAN][LSAN] Replace cstdint with stdint.h
Reviewed By: brooksmoses, MaskRay

Differential Revision: https://reviews.llvm.org/D155994
2023-07-21 22:20:12 +00:00
Arthur Eubanks
7be84ba914 [Sanitizers][Darwin][Test] Mark symbolize_pc test on Darwin/TSan+UBSan as UNSUPPORTED
Followup to https://reviews.llvm.org/rG760c208f6ff9e97a9a11523c00874a1eec4f876b which XFAIL'd them, but they pass in some configurations.
2023-07-21 09:50:02 -07:00
Christopher Ferris
af41f79f40 [scudo] Clean up tests.
Modify the tests so that all clang warnings can be turned up to high.

Fix all places flagged by -Wconversion.

Fix a few unused variables not marked with UNUSED.

For the memtag testing, only compile some tests for 64 bit since
compiling them on 32 bit leads to warnings/errors. All of the tests
are already skipped on 32 bit OSes, so this will not affect any
real tests.

Reviewed By: Chia-hungDuan

Differential Revision: https://reviews.llvm.org/D155749
2023-07-20 14:02:40 -07:00
Mariusz Borsa
760c208f6f [Sanitizers][Darwin][Test] XFAIL symbolize_pc test on Darwin/TSan+UBSan 2023-07-20 12:58:30 -07:00
Daniel Thornburgh
ee25276766 [sanitizer-common] Run module msan init before early sigaction test
MSAN wrappers can be inserted for e.g. the access to stderr in the
constructor of the test, which can segfault if the constructor function
runs before these data structures have been initialized.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D155648
2023-07-19 10:59:05 -07:00
Jake Egan
0680ca7f8c [InstrProf][NFC] Ignore -Wcast-qual after D153911 to fix build failure on AIX
/scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c:202:40: error: cast from 'const int (*)[0]' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
                               (void *)&dummy_name, (void *)&dummy_vnds};
                                       ^
1 error generated.
2023-07-19 13:50:55 -04:00
Jie Fu
51c8cacafd [InstrProf] Ignore -Wcast-qual after D153911 to fix build failure (NFC)
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:46:60: error: cast from 'const char *' to 'struct __llvm_profile_header *' drops const qualifier [-Werror,-Wcast-qual]
  __llvm_profile_header *Header = (__llvm_profile_header *)ProfileData;
                                                           ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:49:30: error: cast from 'const char *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
      (__llvm_profile_data *)(ProfileData + sizeof(__llvm_profile_header) +
                             ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:77:41: error: cast from 'const struct __llvm_profile_data *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
       DstData = (__llvm_profile_data *)__llvm_profile_begin_data();
                                        ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:109:60: error: cast from 'const char *' to 'struct __llvm_profile_header *' drops const qualifier [-Werror,-Wcast-qual]
  __llvm_profile_header *Header = (__llvm_profile_header *)ProfileData;
                                                           ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:116:30: error: cast from 'const char *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
      (__llvm_profile_data *)(ProfileData + sizeof(__llvm_profile_header) +
                             ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:129:40: error: cast from 'const struct __llvm_profile_data *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
      DstData = (__llvm_profile_data *)__llvm_profile_begin_data(),
                                       ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:179:34: error: cast from 'const char *' to 'struct ValueProfData *' drops const qualifier [-Werror,-Wcast-qual]
    VPMergeHook((ValueProfData *)SrcValueProfData, DstData);
                                 ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:181:46: error: cast from 'const char *' to 'struct ValueProfData *' drops const qualifier [-Werror,-Wcast-qual]
        SrcValueProfData + ((ValueProfData *)SrcValueProfData)->TotalSize;
                                             ^
...
2023-07-19 18:00:05 +08:00
Martin Storsjö
9f4dfcb795 [CMake] Clean up old code for handling MSVC runtime setting the old way
This was left in place to reduce the risk of breaking anything,
and to keep the diff smaller, in D155233.

Differential Revision: https://reviews.llvm.org/D155431
2023-07-19 11:25:28 +03:00
Fangrui Song
307e19784a [test] Make fuzzer/value-profile-div.test x86 specific
The test requires that an integer division by zero causes a trap, leading to a
signal like SIGFPE. This is the case on x86. On many other architectures, such
as Arm (unless software division is used and `__aeabi_idiv0` is patched),
Power, RISC-V, LoongArch, there is no trap. Therefore, it's more appropriate to
invert the condition to run the test.

Reviewed By: Ami-zhang

Differential Revision: https://reviews.llvm.org/D155644
2023-07-18 22:11:27 -07:00
Christopher Ferris
902c41fc80 [scudo] Fix memtag tests.
A few memtag tests were using EXPECT_DEBUG_DEATH which executes the
statement unless NDEBUG is set. This meant the statement would
cause an abort, but the EXPECT_DEATH part was not done. Change these
to simply EXPECT_DEATH, these tests already verify that SCUDO_DEBUG
is set before checking for DEATH.

Reviewed By: Chia-hungDuan

Differential Revision: https://reviews.llvm.org/D155538
2023-07-18 13:52:16 -07:00
Kirill Stoimenov
0365ccd2a1 [HWASAN][LSAN] Fix false positive memory leak reports on X86_64
Before this patch when running HWASAN on x86_64 with with memory tagging support we got a bunch of false memory leak reports. The reason for that is that the heuristic used to detect if an 8 bytes could be a user pointer was not valid when memory tagging is used as the top byte could contain non-zero information.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D155338
2023-07-18 19:04:30 +00:00
Mitch Phillips
03dc87e939 Revert "[sanitizer][asan][win] Intercept _strdup on Windows instead of strdup"
This reverts commit 31263211c6a4ef454216f2edbf9b2083a4c1474d.

Reason: Broke the ASan Windows bot: https://reviews.llvm.org/rG31263211c6a4ef454216f2edbf9b2083a4c1474d
2023-07-18 12:19:56 +02:00
Charlie Barto
31263211c6 [sanitizer][asan][win] Intercept _strdup on Windows instead of strdup
Intercept `_strdup` on windows, instead of the nonexistent `strdup`.
2023-07-17 21:06:50 -07:00
Youling Tang
9c2f792dce [fuzzer] Enable loongarch64
Enable fuzzer on loongarch64.

Reviewed By: SixWeining, xen0n, MaskRay

Differential Revision: https://reviews.llvm.org/D140601
2023-07-18 09:40:25 +08:00
Daniel Thornburgh
b872233764 [ubsan] Make sigaction.cpp test UNSUPPORTED rather than XFAIL
The test fails on some builders but not on others; there's likely some
kind of environment dependence that should be investigated.

See https://reviews.llvm.org/D155317
2023-07-17 16:18:21 -07:00
Leonard Grey
ac604cc310 [lsan][Darwin] Unconditionally strip high bits from potential pointers
The method cache stashes a mask in the high bits under some circumstances:
689525d556/runtime/objc-cache.mm (L589)

I'm hitting this now on macOS 13.4 arm64, so we can no longer rely on OBJC_FAST_IS_RW to identify potential pointers that need to be transformed

Differential Revision: https://reviews.llvm.org/D153471
2023-07-17 15:18:53 -04:00
Leandro Lupori
33acdc1e2f [compiler-rt][xray] Fix alignment of XRayFileHeader
XRayFileHeader storage was obtained from std::aligned_storage
using its default alignment and not the struct's alignment
requirement. This was causing a bus error on AArch32, on armv8
machines, where vld1.64/vst1.64 instructions with 128-bit
alignment requirement were being used to copy XRayFileHeader.

There is still another issue with fdr-single-thread.cpp test on
armv7. Now it runs until completion and produces a valid log file,
but for some reason the function name appears as _end in it,
instead of the expected mangled fn name.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D155013
2023-07-17 10:51:27 -03:00
Simi Pallipurath
6f4f1023fa [compiler-rt] [Arm] Make the tests for the runtime functions __aeabi_c{d,f} work on Big-Endian.
We are trying to build the compiler-rt as big-endian. And found that the tests compiler-rt/test/builtins/Unit/arm/aeabi_cdcmpeq_test.c and compiler-rt/test/builtins/Unit/arm/aeabi_cfcmpeq_test.c do not work on big endian at the moment. This patch makes these tests work on big endian as well.

Reviewed By: peter.smith, simon_tatham

Differential Revision: https://reviews.llvm.org/D155208
2023-07-17 12:27:32 +01:00
Sylvestre Ledru
b446c6dfcf cmake: set _LARGEFILE_SOURCE=1 to fix a cmake error
```
-- Performing additional configure checks with target flags: -mips32r2;-mabi=32;-D_LARGEFILE_SOURCE;-D_FILE_OFFSET_BITS=64
-- Performing Test COMPILER_RT_HAS_mips_FLOAT16
CMake Error: Parse error in command line argument: _LARGEFILE_SOURCE
 Should be: VAR:type=value
```
See: https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-16&arch=mips64el&ver=1%3A16.0.6-4&stamp=1689111818&raw=0

Differential Revision: https://reviews.llvm.org/D155409
2023-07-17 09:59:56 +02:00
MarcoFalke
fa8401f9bf
[compiler-rt][NFC] Avoid implicit-integer-sign-change in FuzzedDataProvider::ConsumeIntegralInRange
This makes the implicit conversion that is happening explicit.
Otherwise, each user is forced to suppress this
implicit-integer-sign-change runtime error in their their UBSAN
suppressions file.

For example, the runtime error might look like:

runtime error: implicit conversion from type 'long' of value -9223372036854775808 (64-bit, signed) to type 'uint64_t' (aka 'unsigned long') changed the value to 9223372036854775808 (64-bit, unsigned)
    #0 0x55fe29dea91d in long FuzzedDataProvider::ConsumeIntegralInRange<long>(long, long) src/./test/fuzz/FuzzedDataProvider.h:233:25
    [...]
SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change test/fuzz/FuzzedDataProvider.h:233:25 in

Differential Revision: https://reviews.llvm.org/D155206
2023-07-17 09:32:19 +02:00
Martin Storsjö
c6bd873403 [CMake] Switch the CMP0091 policy (MSVC_RUNTIME_LIBRARY) to the new behaviour
With the new behaviour, the /MD or similar options aren't added to
e.g. CMAKE_CXX_FLAGS_RELEASE, but are added separately by CMake.
They can be changed by the cmake variable
CMAKE_MSVC_RUNTIME_LIBRARY or with the target property
MSVC_RUNTIME_LIBRARY.

LLVM has had its own custom CMake flags, e.g. LLVM_USE_CRT_RELEASE,
which affects which CRT is used for release mode builds. Deprecate
these and direct users to use CMAKE_MSVC_RUNTIME_LIBRARY directly
instead (and do a best effort attempt at setting CMAKE_MSVC_RUNTIME_LIBRARY
based on the existing LLVM_USE_CRT_ flags). This only handles the
simple cases, it doesn't handle multi-config generators with
different LLVM_USE_CRT_* variables for different configs though,
but that's probably fine - we should move over to the new upstream
CMake mechanism anyway, and push users towards that.

Change code in compiler-rt, that previously tried to override the
CRT choice to /MT, to set CMAKE_MSVC_RUNTIME_LIBRARY instead of
meddling in the old variables.

This resolves the policy issue in
https://github.com/llvm/llvm-project/issues/63286, and should
handle the issues that were observed originally when the
minimum CMake version was bumped, in
https://github.com/llvm/llvm-project/issues/62719 and
https://github.com/llvm/llvm-project/issues/62739.

Differential Revision: https://reviews.llvm.org/D155233
2023-07-17 09:59:05 +03:00
Caslyn Tonelli
c3767a943f [ubsan] Disable sigaction.cpp on archs for debugging
Add `ubsan-tsan` condition to test disablement.

Differential Revision: https://reviews.llvm.org/D155317
2023-07-15 15:02:50 +00:00
Dmitry Vyukov
f6db55ea66 ubsan: disable sigaction test for aarch64
The test seems to segfault on aarch64 with tsan:
https://lab.llvm.org/buildbot/#/builders/179/builds/6662
Reason unknown, needs debugging.

Reviewed By: melver, Caslyn

Differential Revision: https://reviews.llvm.org/D155272
2023-07-14 16:39:29 +00:00
Weining Lu
ef33d6cbfc [XRay] Add initial support for loongarch64
Only support patching FunctionEntry/FunctionExit/FunctionTailExit for now.

Reviewed By: MaskRay, xen0n
Co-Authored-By: zhanglimin <zhanglimin@loongson.cn>

Differential Revision: https://reviews.llvm.org/D140727
2023-07-14 09:27:13 +08:00
Pavel Iliin
61962aa1ee [compiler-rt][AArch64] Correct how FMV use ifunc resolver abi.
The patch fixes second argument of Function Multi Versioning resolvers,
it is pointer to an extendible struct containing hwcap and hwcap2 not a
unsigned long hwcap2. Also fixes FMV features caching in resolver.

Differential Revision: https://reviews.llvm.org/D155026
2023-07-14 00:37:48 +01:00
Dmitry Vyukov
1377179396 sanitizer_common: initialize sanitizer runtimes lazily from signal interceptors
Currently if a program calls sigaction very early (before non-lazy sanitizer
initialization, in particular if .preinit_array initialization is not enabled),
then sigaction will wrongly fail since the interceptor is not initialized yet.

In all other interceptors we do lazy runtime initialization for this reason,
but we don't do it in the signal interceptors.
Do lazy runtime initialization in signal interceptors as well.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D155188
2023-07-13 16:28:25 +02:00
Blue Gaston
020cdaff61 [Asan][Darwin][GCD] Add interceptor for dispatch_mach_create_f
When enabling DriverKit, Address Sanitizer was unable to
intercept thread creation directly for dispatch workerthreads.

Because of this calls to GetStackTraceFromID failed and ASan was
unable to capture a meaningful stack trace.

This patch adds an interceptor for a dispatch function as a proxy
that is "close enough" to thread creation so that ASan is able
to meaningfully capture and register the dispatched thread.

Note: I propose not adding a test for this change.
Because this change is only meaningful in such a narrow usecase on Darwin
and is incredibly difficult to add a meaningful test.

Differential Revision: https://reviews.llvm.org/D154753
2023-07-12 20:52:10 -07:00
Petr Hosek
bb7a902c76 [CMake] Use COMPILER_RT_BUILD_CRT in the condition for test
Unlike COMPILER_RT_HAS_CRT this handles the case where CRT is available
but has been disabled by setting COMPILER_RT_BUILD_CRT. This addresses
an issue reported on D153989.

Differential Revision: https://reviews.llvm.org/D155126
2023-07-12 22:30:43 +00:00
Daniel Thornburgh
6be453ed7f [debuginfod] Use dedicated cache dir for tests 2023-07-12 14:28:56 -07:00
Chia-hung Duan
1a4bc114ec Reland "[scudo] Support partial concurrent page release in SizeClassAllocator64"
This reverts commit 2f04b688aadef747172a8f4a7d1658dc049b1e24.

Reviewed By: cferris

Differential Revision: https://reviews.llvm.org/D155015
2023-07-12 18:25:01 +00:00
Petr Hosek
286f4c0f07 Revert "[CMake] Use COMPILER_RT_BUILD_CRT in the condition for test"
This reverts commit 926f3759ec62a8f170e76a60316cc0bdd9dd2ec9.
2023-07-12 18:02:19 +00:00
Petr Hosek
926f3759ec [CMake] Use COMPILER_RT_BUILD_CRT in the condition for test
Unlike COMPILER_RT_HAS_CRT this handles the case where CRT is available
but has been disabled by setting COMPILER_RT_BUILD_CRT.
2023-07-12 17:41:16 +00:00
Petr Hosek
b47beecc81 [compiler-rt] Move crt into builtins
On Linux crt is typically use in combination with builtins. In the Clang
driver the use of builtins and crt is controlled by the --rtlib option.
Both builtins and crt also have similar build requirements where they
need to be built before any other runtimes and must avoid dependencies.
We also want builtins and crt these to be buildable separately from the
rest of compiler-rt for bootstrapping purposes. Given how simple crt is,
rather than maintaining a separate directory with its own separate build
setup, it's more efficient to just move crt into builtins. We still use
separate CMake option to control whether to built crt same as before.

This is an alternative to D89492 and D136664.

Differential Revision: https://reviews.llvm.org/D153989
2023-07-11 23:05:45 +00:00
Daniel Thornburgh
580f9f7ef0 [llvm-cov][debuginfod] Make test more hermetic 2023-07-11 16:00:46 -07:00
Martin Storsjö
4579843d59 [compiler-rt] [test] Mark a windows specific test as requiring an MSVC like environment
This test relies on MSVC style linking details, such as -Wl,-dll
(which could be expressed with just "-shared", which would work
with MinGW too) and an implicitly created import library named
"<basename>.lib" (which isn't created when linking in MinGW mode).

This fixes running the compiler-rt tests in MinGW environments.
2023-07-12 00:11:47 +03:00
Thurston Dang
0c9145f413 [msan] Fix -Wcast-qual error in msan_dl.cpp
Fix build breakage from https://reviews.llvm.org/D154272.
(I accidentally dropped the fix when I relanded the patch.)
2023-07-11 21:04:51 +00:00
Chia-hung Duan
2f04b688aa Revert "[scudo] Support partial concurrent page release in SizeClassAllocator64"
We should merge two top TransferBatches so that the range marking can be
done correctly

This reverts commit 57ae8a2a1acb1aa1a5f55c29b1b338a780d649d5.

Differential Revision: https://reviews.llvm.org/D155009
2023-07-11 20:33:58 +00:00
Thurston Dang
9095d5c44b Reland '[msan] Intercept dladdr1, and refactor dladdr'
Relanding with #if SANITIZER_GLIBC to avoid breaking FreeBSD.
Also incorporates Arthur's BUILD.gn fix (thanks!) from https://reviews.llvm.org/rGc1e283851772ba494113311405d48cfb883751d1

Original commit message:
This patch adds an msan interceptor for dladdr1 (with support for RTLD_DL_LINKMAP and RTLD_DL_SYMENT) and an accompanying test. It also adds a helper file, msan_dl.cpp, that contains UnpoisonDllAddrInfo (refactored out of the dladdr interceptor) and UnpoisonDllAddr1ExtraInfo.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D154272
2023-07-11 20:05:54 +00:00