105 Commits

Author SHA1 Message Date
Peter Collingbourne
77e703927f [𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.6-beta.1

[skip ci]
2025-08-15 14:23:47 -07:00
Peter Collingbourne
b2c828372f [𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.6-beta.1

[skip ci]
2025-08-15 14:13:27 -07:00
Peter Collingbourne
e3a638c5c0 [𝘀𝗽𝗿] changes to main this commit is based on
Created using spr 1.3.6-beta.1

[skip ci]
2025-08-15 13:48:16 -07:00
Peter Collingbourne
3fa07ed5b3
Rename config.host_os to config.target_os.
config.host_os is derived from CMAKE_SYSTEM_NAME
which specifies the target. See:
https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html

To reduce confusion, rename it to config.target_os.

The variable name config.target_os was already being used by the Orc
tests. Rename it to config.orc_test_target_os with a FIXME to remove.

Reviewers: JDevlieghere, MaskRay

Reviewed By: MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/149015
2025-07-17 11:12:29 -07:00
thetruestblue
1c541aa9f9
[Apple][NFC] Update macOS aligned version for lit config (#143576)
This updates the aligned version for version 26.

Note: This change is for correctness only and has no functional impact
currently. `get_macos_aligned_version` is currently only consumed when
substituting flags based on min version.

rdar://152851947
2025-07-16 20:17:37 -07:00
Peter Collingbourne
968d38d1d7 compiler-rt: test: Use the host instead of the target to select %expect_crash.
When running tests in a cross-compiled build, %expect_crash is
run on the host, not the target, so we need to check the host
OS. config.host_os surprisingly refers to the target OS because it
is derived from CMAKE_SYSTEM_NAME which specifies the target. See:
https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_NAME.html

Another speculative fix for:
https://lab.llvm.org/buildbot/#/builders/193/builds/9070
2025-07-15 19:46:12 -07:00
Hubert Tong
7712de3062
[compiler-rt][tests][AIX] Use /opt/freeware/bin/env (#133160)
`env -u` is not supported by the system `env` utility on AIX.

`/opt/freeware/bin/env` is the standard path for the GNU coreutils `env`
utility as distributed by the AIX Toolbox for Open Source Software.

Adding `/opt/freeware/bin` to `PATH` causes issues by picking up other
utilities that are less capable, in an AIX context, than the system
ones.

This patch modifies the relevant usage of `env` to use (on AIX) the full
path to `/opt/freeware/bin/env`.
2025-03-27 16:02:40 -04:00
Midhunesh
d75a40a9c1
Add cmake option to enable/disable searching PATH for symbolizer (#129012)
Introduced a cmake option that is disabled by default that suppresses
searching via the PATH variable for a symbolizer. The option will be
enabled for downstream builds where the user will need to specify the
symbolizer path more explicitly, e.g., by using ASAN_SYMBOLIZER_PATH.
2025-03-25 16:29:35 -07:00
Jérôme Duval
d084bc291a
[compiler-rt][profile] Add support for LLVM profile for Haiku (#107575)
Haiku uses typical UNIX interfaces.

All tests pass except
instrprof-error.c
Posix/gcov-dlopen.c
Posix/gcov-destructor.c
Posix/instrprof-dlopen-norpath.test

---------

Co-authored-by: Petr Hosek <phosek@google.com>
2024-11-05 03:14:25 -05:00
Martin Storsjö
a14a83d9a1
[compiler-rt] [test] Fix using toolchains that rely on Clang default configs (#113491)
The use of CLANG_NO_DEFAULT_CONFIG in the tests was added because some
Linux distributions had a global default config file, that added flags
relating to hardening, which interfere with the sanitizer tests. By
setting CLANG_NO_DEFAULT_CONFIG, the global default config files that
are found are ignored, and the sanitizers get the expected default
compiler behaviour.

(This was https://github.com/llvm/llvm-project/issues/60394, which was
fixed in 8ab762557fb057af1a3015211ee116a975027e78.)

However, some toolchains may rely on default config files for mandatory
parts required for functioning at all - setting things like sysroots,
-rtlib, -unwindlib, -stdlib, -fuse-ld etc. In such a case we can't
forcibly disable any default config, because it will break the otherwise
working toolchain.

Add a test for whether the compiler works while passing
--no-default-config to it. If the option is accepted and the toolchain
still works while that is set, set CLANG_NO_DEFAULT_CONFIG while running
tests.

(This adds a little bit of inconsistency, as we're testing for the
command line option, while using the environment variable. However doing
compile testing with an environment variable isn't quite as easily
doable, and passing an extra command line flag to all compile commands
while testing, is a bit clumsy - therefore this inconsistency.)
2024-10-24 23:45:14 +03:00
Rainer Orth
11903e8c96
[sanitizer][test] Unify LD_LIBRARY_PATH handling (#111498)
When testing on Linux/sparc64 with a `runtimes` build, the
`UBSan-Standalone-sparc :: TestCases/Misc/Linux/sigaction.cpp` test
`FAIL`s:
```
runtimes/runtimes-bins/compiler-rt/test/ubsan/Standalone-sparc/TestCases/Misc/Linux/Output/sigaction.cpp.tmp: error while loading shared libraries: libclang_rt.ubsan_standalone.so: wrong ELF class: ELFCLASS64
```
It turns out SPARC needs the same `LD_LIBRARY_PATH` handling as x86.

This is what this patch does, at the same time noticing that the current
duplication between `lit.common.cfg.py` and
`asan/Unit/lit.site.cfg.py.in` isn't necessary.

Tested on `sparc64-unknown-linux-gnu` and `x86_64-pc-linux-gnu`.
2024-10-15 10:06:11 +02:00
Charlie Barto
81935c5e96
[compiler-rt] [MSVC] Detect MSVC as a compiler-id for lit. (#108255)
This is only for "real" msvc and is to support running sanitizer tests
with "real" MSVC. Most compiler-rt tests do not yet pass with msvc,
which will be addressed in future PRs for asan, sanitizer_common, and
the fuzzer.

We've been using these changes to lit to run CI for the version of
address sanitizer that ships with MSVC, by upstreaming them we can avoid
being broken by future lit changes and allow contributors (importantly
_us_) to run the MSVC tests on changes developed in the open.
2024-09-12 10:30:13 -07:00
Petr Hosek
eb0e4b1415
[Fuzzer] Passthrough zlib CMake paths into the test (#107926)
We shouldn't assume that we're using system zlib installation.
2024-09-09 19:21:59 -07:00
Fangrui Song
bbdccf4c94
[asan,test] Disable _FORTIFY_SOURCE test incompatible with glibc 2.40
In terms of bug catching capability, `_FORTIFY_SOURCE` does not perform
as well as some dynamic instrumentation tools. When a sanitizer is used,
generally `_FORTIFY_SOURCE` should be disabled since sanitizer runtime
does not implement most `*_chk` functions. Using `_FORTIFY_SOURCE`
will regress error checking (asan/hwasan/tsan) or cause false positives
(msan).

`*printf_chk` are the most pronounced `_chk` interceptors for
uninstrumented DSOes (https://reviews.llvm.org/D40951).

glibc 2.40 introduced `pass_object_info` style fortified source for some
functions ([1]). `fprintf` will be mangled as
`_ZL7fprintfP8_IO_FILEU17pass_object_size1PKcz`, which has no associated
interceptor, leading to printf-fortify-5.c failure.

Just disable the test. Fix #100877

[1]: https://sourceware.org/pipermail/libc-alpha/2024-February/154531.html

Pull Request: https://github.com/llvm/llvm-project/pull/101566
2024-08-02 10:10:15 -07:00
thetruestblue
1791b11b7d
[Darwin] Fix lit substitution for mtargetos flag on darwin devices (#96953)
Changes substitution logic to appropriately parse either format for min
deployment flag: -mtargetos={platform}{major}.{min){?-simulator} or
-m{platform}-{sim}-version-min={major}.{min} as the
apple_platform_min_deployment_target_flag.

rdar://130022065
2024-06-29 11:06:03 -07:00
Jan Voung
c467e6097e
Check if LLD is built when checking if lto_supported (#92752)
Otherwise, older copies of LLD may not understand the latest bitcode
versions (for example, if we increase
`ModuleSummaryIndex::BitCodeSummaryVersion`)

Related to
https://github.com/llvm/llvm-project/pull/90692#issuecomment-2113250317
2024-06-07 09:29:31 -07:00
Mircea Trofin
e4763ca83b
[ctx_profile] Pull ContextNode in a .inc file (#91669)
This pulls out `ContextNode` as we need to use it pretty much as-is to implement a writer. The writer will be implemented on the LLVM side because it takes a dependency on BitStreamWriter.

Since we can't reuse a header between compiler-rt and llvm, we use a header file which is copied on both sides, and test that the 2 copies are identical.

The changes adds the necessary other stuff for compiler-rt/ctx_profile testing.
2024-05-09 16:58:40 -07:00
Alexander Richardson
dfafe3822b
Reland "[compiler-rt] Allow running tests without installing first"
Currently, the testsuite uses the default runtimes path to find the
runtimes libraries which may or may not match the just-built runtimes.
This change uses the `-resource-dir` flag for clang whenever
`COMPILER_RT_TEST_STANDALONE_BUILD_LIBS` is set to ensure that we are
actually testing the currently built libraries rather than the ones
bundled with `${COMPILER_RT_TEST_COMPILER}`.

The existing logic works fine when clang and compiler-rt share the same
build directory ``-DLLVM_ENABLE_PROJECTS=clang;compiler-rt`, but when
building compiler-rt separately we need to tell the compiler used for
the tests where it can find the just-built libraries.

This reduces the fixes check-all failures to one in my configuration:
```
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja
-DCMAKE_C_COMPILER=$HOME/output/upstream-llvm/bin/clang
-DCMAKE_CXX_COMPILER=$HOME/output/upstream-llvm/bin/clang++
-DCOMPILER_RT_INCLUDE_TESTS=ON
-DLLVM_EXTERNAL_LIT=$HOME/build/upstream-llvm-project-build/bin/llvm-lit
-DLLVM_CMAKE_DIR=$HOME/output/upstream-llvm
-DCOMPILER_RT_DEBUG=OFF
-S $HOME/src/upstream-llvm-project/compiler-rt
-B $HOME/src/upstream-llvm-project/compiler-rt/cmake-build-all-sanitizers
```

This relands the previous PR with fixes for Windows.
Depends on https://github.com/llvm/llvm-project/pull/88074 to be merged
first for GCC buildbots.

Pull Request: https://github.com/llvm/llvm-project/pull/88075
2024-04-12 13:20:30 -07:00
Saiyedul Islam
2084a07087
Revert "[compiler-rt] Allow running tests without installing first"
This reverts commit c91254db1dcace869f4d3f1ac659bdd7700a1459.

It was throwing error:
 g++: error: unrecognized command line option ‘-resource-dir=
2024-04-08 03:35:23 -04:00
Alexander Richardson
c91254db1d
[compiler-rt] Allow running tests without installing first
Currently, the testsuite uses the default runtimes path to find the
runtimes libraries which may or may not match the just-built runtimes.
This change uses the `-resource-dir` flag for clang whenever
`COMPILER_RT_TEST_STANDALONE_BUILD_LIBS` is set to ensure that we are
actually testing the currently built libraries rather than the ones
bundled with `${COMPILER_RT_TEST_COMPILER}`.

The existing logic works fine when clang and compiler-rt share the same
build directory ``-DLLVM_ENABLE_PROJECTS=clang;compiler-rt`, but when
building compiler-rt separately we need to tell the compiler used for
the tests where it can find the just-built libraries.

This reduces the fixes check-all failures to one in my configuration:
```
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja
-DCMAKE_C_COMPILER=$HOME/output/upstream-llvm/bin/clang
-DCMAKE_CXX_COMPILER=$HOME/output/upstream-llvm/bin/clang++
-DCOMPILER_RT_INCLUDE_TESTS=ON
-DLLVM_EXTERNAL_LIT=$HOME/build/upstream-llvm-project-build/bin/llvm-lit
-DLLVM_CMAKE_DIR=$HOME/output/upstream-llvm
-DCOMPILER_RT_DEBUG=OFF
-S $HOME/src/upstream-llvm-project/compiler-rt
-B $HOME/src/upstream-llvm-project/compiler-rt/cmake-build-all-sanitizers
```

Reviewed By: vitalybuka, delcypher, MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/83088
2024-04-07 09:50:06 -07:00
Usama Hameed
3bc71c2abf
Get the linker version and pass the it to compiler-rt tests on Darwin. (#86220)
The HOST_LINK_VERSION is a hardcoded string in Darwin clang that detects
the linker version at configure time. The driver uses this information
to build the correct set of arguments for the linker. This patch detects
the linker version again during compiler-rt configuration and passes it
to the tests. This allows a clang built on a machine with a new linker
to run compiler-rt tests on a machine with an old linker.

rdar://125198603
2024-03-22 15:29:36 -07:00
Vitaly Buka
deebf6b312 [tsan] Disabled test dead locking on glibc-2.38
https://github.com/google/sanitizers/issues/1733
2024-03-12 22:22:54 -07:00
Alexander Richardson
2e25926b50
[compiler-rt] Only query llvm-config in the orc tests
This check for assertions is only used inside the test/orc directory, but
doing it in the top level lit config means all testsuites depend on
llvm-config being present. This is not necessarily needed e.g. when
testing just the builtins. While touching this code, simplify it a bit
by using subprocess.check_output() instead of Popen() and use a string
comparison instead of a regex match.

Reviewed By: lhames

Pull Request: https://github.com/llvm/llvm-project/pull/83705
2024-03-06 22:16:30 -08:00
Dinar Temirbulatov
3112578597 [AArch64][compiler-rt] Add memcpy, memset, memmove, memchr builtins. (#77496)
Add naive implementation of memcpy, memset, memmove, memchr for SME
targets.
Co-authored-by: David Sherwood <david.sherwood@arm.com>
2024-01-23 11:26:20 +00:00
Douglas Yung
bffd80d6df Revert "[AArch64][compiler-rt] Add memcpy, memset, memmove, memchr builtins. (#77496)"
This reverts commit 3ab8d2aac7bc2dd45dda3db0b8a71fd27eefb749.

This change is causing issues running lit tests on many bots including:
- https://lab.llvm.org/buildbot/#/builders/197/builds/12119
- https://lab.llvm.org/buildbot/#/builders/184/builds/9792
- https://lab.llvm.org/buildbot/#/builders/93/builds/18455
- https://lab.llvm.org/buildbot/#/builders/231/builds/19858
- https://lab.llvm.org/buildbot/#/builders/121/builds/38426
- https://lab.llvm.org/buildbot/#/builders/230/builds/23990
- https://lab.llvm.org/buildbot/#/builders/57/builds/32391
- https://lab.llvm.org/buildbot/#/builders/247/builds/13502
- https://lab.llvm.org/buildbot/#/builders/275/builds/3601
- https://lab.llvm.org/buildbot/#/builders/269/builds/4211
- https://lab.llvm.org/buildbot/#/builders/18/builds/14161
- https://lab.llvm.org/buildbot/#/builders/19/builds/23893
- https://lab.llvm.org/buildbot/#/builders/37/builds/30295
- https://lab.llvm.org/buildbot/#/builders/77/builds/33979
2024-01-22 18:21:09 -08:00
Dinar Temirbulatov
3ab8d2aac7
[AArch64][compiler-rt] Add memcpy, memset, memmove, memchr builtins. (#77496)
Add naive implementation of memcpy, memset, memmove, memchr for SME
targets.
Co-authored-by: David Sherwood <david.sherwood@arm.com>
2024-01-22 23:40:53 +00:00
Vitaly Buka
771e9cda23 [msan] Intercept mallinfo2 only on GLIBC 2.33+
Followup to #73729
2023-11-29 12:15:14 -08:00
Georgios Eleftheriou
2402b14046
Fix python SyntaxWarnings in check-all output (#72538)
By converting the offending strings to raw string literals.
2023-11-17 16:40:21 -05:00
Alex Brachet
445978ee8c [compiler-rt] Use just built libatomic if available
Use libclang_rt.atomic.so instead of the libatomic installed
on the system if it is available.

Differential Revision: https://reviews.llvm.org/D151680
2023-08-29 21:38:56 +00:00
Vitaly Buka
23d1b6577a [test][sanitizer] Prepare test for Internal Symbolizer
Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D157946
2023-08-15 13:42:01 -07: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
Alex Brachet
0c11478b79 [compiler-rt] Stop using system ldd to detect libc version
The system libc may be different from the libc passed in
CMAKE_SYSROOT. Instead of using the ldd in PATH to detect
glibc version, use the features.h header file.

Differential Revision: https://reviews.llvm.org/D151678
2023-06-26 13:41:19 +00:00
Alex Brachet
fe2f0ab37c [compiler-rt] Use ZLIB_FOUND not LLVM_ENABLE_ZLIB
LLVM_ENABLE_ZLIB is set to On by default and does not imply that ZLIB
was actually found, only being set to FORCE_ON would imply that it was
found before control reached compiler-rt/test/CMakeLists.txt. Instead,
use ZLIB_FOUND which guarantees that zlib is available.

Differential Revision: https://reviews.llvm.org/D151229
2023-05-25 18:55:47 +00:00
Tobias Hieta
f98ee40f4b
[NFC][Py Reformat] Reformat python files in the rest of the dirs
This is an ongoing series of commits that are reformatting our
Python code. This catches the last of the python files to
reformat. Since they where so few I bunched them together.

Reformatting is done with `black`.

If you end up having problems merging this commit because you
have made changes to a python file, the best way to handle that
is to run git checkout --ours <yourfile> and then reformat it
with black.

If you run into any problems, post to discourse about it and
we will try to help.

RFC Thread below:

https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Reviewed By: jhenderson, #libc, Mordante, sivachandra

Differential Revision: https://reviews.llvm.org/D150784
2023-05-25 11:17:05 +02:00
Alex Brachet
4df44a0084 [asan] Don't use libstdc++ in test
It shouldn't be assumed that libstdc++ is always available even on Linux.
Just let the compiler pick the default

Differential Revision: https://reviews.llvm.org/D150809
2023-05-19 15:17:59 +00:00
Fangrui Song
aa6cb0f214 [test] Remove Python<3.3 workaround without shlex.quote
Python>=3.6 has been the requirement since D93097 (2020).
Remove old workarounds.

Remove unused imports from compiler-rt/test/memprof/lit.cfg.py

Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D150410
2023-05-11 23:06:02 -07:00
Vitaly Buka
22aa493ad2 [test][sanitizer] Add feature for "any" GLIBC
"any" is actualy any resonably recent GLIBC.
2023-05-05 17:12:17 -07:00
Michał Górny
488a4b2481 [compiler-rt] [test] Mark dfsan tests XFAIL on glibc-2.37
Mark the two dfsan tests that are known to be broken on glibc-2.37
as XFAIL, to make the test suite start passing on Gentoo again.

Bug: https://github.com/llvm/llvm-project/issues/60678

Differential Revision: https://reviews.llvm.org/D148496
2023-04-18 03:38:15 +02:00
Lang Hames
9d701c8a8d [ORC] Fix fallout from switch to _objc_map/load_images-based registration.
In f448d44663a we switched to calling _objc_map_images and _objc_load_images
for MachO language metadata registration. This patch fixes some bugs arising
from that change:

(1) __objc_imageinfo processing was moved to a post-allocation pass, but this
    prevents us from discarding the redundant copies. This commit moves
    processing back to a pre-prune pass and inserts a symbol for the uniqued
    __objc_image section. Runtime objects use an edge pointing to this symbol
    to access the address.

(2) We were assuming that _objc_map_images & _objc_load_images were available
    in the Objective-C runtime on 10.15, but these functions didn't become
    available until later. This commit bumps the macOS version requirement to
    13.1 where the functions should be available.

(3) The ORC-RT trivial-swift-types-section.S test was missing an
    __objc_unwindinfo section, which triggered an assert that should have
    been an error. The assert has been turned into an error, and the testcase
    has been updated to include an __objc_imageinfo.

rdar://107846455
2023-04-11 16:48:26 -07:00
Alvin Wong
bae2fbaebf [compiler-rt][asan][test] Fix lit test config on MinGW
MinGW is GCC-like and does not support clang-cl, so clean up the lit cfg
to reflect that. Also mark all Windows test cases using clang-cl as
UNSUPPORTED for now. We should probably adapt most of these test cases
to use the GCC-like clang driver, but that will be for later.

Differential Revision: https://reviews.llvm.org/D147057
2023-04-02 01:06:15 +08:00
Sam James
ca50897a76
[compiler-rt] Fix FORTIFY_SOURCE -> _FORTIFY_SOURCE reference (NFC)
As pointed out by maskray.

Fixes: 8ab762557fb057af1a3015211ee116a975027e78
2023-02-04 18:05:26 +00:00
Sam James
8ab762557f [compiler-rt] Disable default config files for tests
Without this, if hardening measures like FORTIFY_SOURCE are are in
/etc/clang/*.cfg, many sanitizer tests will die before the sanitizer
can trap the problem being tested, because e.g. the _chk variants
of common functions will abort first.

This gets the number of failing tests down from 42->3 for me (and the
remaining 3 are unrelated).

See: 52ce6776cf98e993c6ec04ae54b52e1354fff917
See: 136f77805fd89cd30e69b3d1204fbf7efedd9a12
Closes: https://github.com/llvm/llvm-project/issues/60394

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D143322
2023-02-04 18:04:23 +00:00
Michał Górny
ea953b9d9a [compiler-rt] [test] Handle missing ld.gold gracefully
Fix the is_binutils_lto_supported() function to handle missing
executables gracefully.  Currently, the function does not catch
exceptions from subprocess.Popen() and therefore causes lit to crash
if config.gold_executable does not specify a valid executable:

```
lit: /usr/lib/python3.11/site-packages/lit/TestingConfig.py:136: fatal: unable to parse config file '/tmp/portage/sys-libs/compiler-rt-
15.0.0/work/compiler-rt/test/lit.common.cfg.py', traceback: Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/lit/TestingConfig.py", line 125, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/tmp/portage/sys-libs/compiler-rt-15.0.0/work/compiler-rt/test/lit.common.cfg.py", line 561, in <module>
    if is_binutils_lto_supported():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/portage/sys-libs/compiler-rt-15.0.0/work/compiler-rt/test/lit.common.cfg.py", line 543, in is_binutils_lto_supported
    ld_cmd = subprocess.Popen([exe, '--help'], stdout=subprocess.PIPE, env={'LANG': 'C'})
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1022, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1899, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'GOLD_EXECUTABLE-NOTFOUND'
```

Differential Revision: https://reviews.llvm.org/D133358
2022-09-07 07:14:31 +02:00
Yuanfang Chen
e78208f082 [compiler-rt][lit] initialize LIT LLVMConfig instance
to handle lit tools searching. Otherwise
compiler-rt depends on system environment variable PATH for lit tools
which diverge from the other LLVM projects. This reverts D83486 which
really should be implemented in LIT itself when the PATH is constructed.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D122837
2022-08-22 16:36:39 -07:00
Vitaly Buka
3f5f2905c4 [test] Propagate HWASAN_OPTIONS 2022-08-17 18:59:49 -07:00
Blue Gaston
a89982c40d [Sanitizers][Darwin] Allows '-mtargetos' to used to set minimum deployment target.
Currently, m{platform}-version-min is default flag used to set min deployment target within compilter-rt and sanitizers.
However, clang uses flags -target and -mtargetos for setting target triple and minimum deployment targets.
-mtargetos will be the preferred flag to set min version in the future and the
${platform}-version-min flag will not be used for future platforms.

This change allows darwin platforms to use either ${platform}-min-version or -mtargetos
without breaking lit test flags that allows for overriding the default min value in lit tests
Tests using flags: 'darwin_min_target_with_tls_support', 'min_macos_deployment_target'
will no longer fail if they use mtargetos instead of version-min.

rdar://81028225

Differential Revision: https://reviews.llvm.org/D130542
2022-07-26 11:25:49 -07:00
Leonard Chan
474c873148 Revert "[llvm] cmake config groundwork to have ZSTD in LLVM"
This reverts commit f07caf20b9d35e45501c9d5d903fa182b3bdb95a which seems to break upstream https://lab.llvm.org/buildbot/#/builders/109/builds/42253.
2022-07-08 13:48:05 -07:00
Leonard Chan
e115604a59 Revert "[llvm] cmake config groundwork to have ZSTD in LLVM"
This reverts commit adf1ffe95854a245cbc48bbaea55f60b003d5f76 and f07caf20b9d35e45501c9d5d903fa182b3bdb95a
which seem to break upstream https://lab.llvm.org/buildbot/#/builders/109/builds/42253.
2022-07-08 13:46:44 -07:00
Cole Kissane
adf1ffe958 [llvm] cmake config groundwork to have ZSTD in LLVM
- added `FindZSTD.cmake`
- added a CMake option `LLVM_ENABLE_ZSTD` with behavior mirroring that of `LLVM_ENABLE_ZLIB`
- likewise added have_zstd to compiler-rt/test/lit.common.cfg.py, clang-tools-extra/clangd/test/lit.cfg.py, and several lit.site.cfg.py.in files mirroring have_zlib behavior

Reviewed By: leonardchan, MaskRay

Differential Revision: https://reviews.llvm.org/D128465
2022-07-08 12:36:27 -07:00
Cole Kissane
f07caf20b9 [llvm] cmake config groundwork to have ZSTD in LLVM
- added `FindZSTD.cmake`
- added a CMake option `LLVM_ENABLE_ZSTD` with behavior mirroring that of `LLVM_ENABLE_ZLIB`
- likewise added have_zstd to compiler-rt/test/lit.common.cfg.py, clang-tools-extra/clangd/test/lit.cfg.py, and several lit.site.cfg.py.in files mirroring have_zlib behavior

Reviewed By: leonardchan, MaskRay

Differential Revision: https://reviews.llvm.org/D128465
2022-07-08 11:46:52 -07:00