Commit Graph

6299 Commits

Author SHA1 Message Date
Thurston Dang
70af40ba74 [hwasan] Fix forward '[hwasan] Flush stderr/stdout in tests (#114083)'
3754fc1e9a broke the build because subsequent checks depend on the line numbers

https://lab.llvm.org/buildbot/#/builders/174/builds/7534/steps/6/logs/FAIL__HWAddressSanitizer-x86_64__use-after-free_c
2024-10-29 20:14:14 +00:00
Thurston Dang
e205929399 [asan] Flush stderr in test (#114084)
This is the ASan equivalent of
https://github.com/llvm/llvm-project/pull/114083.

The x86_64_lam_qemu buildbots started failing

(https://lab.llvm.org/buildbot/#/builders/139/builds/5462/steps/2/logs/stdio).
Based on the logs, it appears the ASan check is correct but it did not
match the stderr/stdout output. This patch attempts to fix the issue by
flushing stderr as appropriate.
2024-10-29 12:40:54 -07:00
Thurston Dang
3754fc1e9a [hwasan] Flush stderr/stdout in tests (#114083)
The x86_64_lam_qemu buildbots started failing
(https://lab.llvm.org/buildbot/#/builders/139/builds/5462/steps/2/logs/stdio).
Based on the logs, it appears the HWASan check is correct but it did not
match the stderr/stdout output. This patch attempts to fix the issue by
flushing stderr/stdout as appropriate.
2024-10-29 12:38:56 -07:00
Sebastian Kreutzer
a388df7127 [XRay] Remove reliance on default PIC behavior in DSO tests (#113892)
Compiling with `-fxray-shared` requires position-independent code
(introduced in #113548).
Some tests do not explicitly specify this, thus falling back to the
compiler default.
If, for example, Clang is compiled with
`-DCLANG_DEFAULT_PIE_ON_LINUX=OFF`, these checks fail.

This patch addresses this issue in two tests:
- Removing a check in `xray-shared.cpp` that only tests default PIC
behavior
- Adding `-fPIC` explicitly in `clang-xray-shared.cpp`
2024-10-29 09:40:53 -05:00
Nikolas Klauser
3ac75ee8ec Revert "[runtimes] Allow building against an installed LLVM tree" (#113920)
Reverts llvm/llvm-project#86209

This patch breaks running tests locally, which is extremely disruptive
to libc++ development.
2024-10-28 16:25:58 +01:00
Martin Storsjö
ef9629c64a Revert "Add extendhfxf2 into compiler rt (#111099)"
This reverts commit 5f7bad07b9.

These tests fail to build in multiple configurations, see
https://github.com/llvm/llvm-project/pull/111099.
2024-10-26 12:34:45 +03:00
B I Mohammed Abbas
5f7bad07b9 Add extendhfxf2 into compiler rt (#111099)
Retry pr #109090 with updated extendhfxf2 test
2024-10-25 20:05:23 -04:00
Sebastian Kreutzer
e738a5d8e3 Reapply " [XRay] Add support for instrumentation of DSOs on x86_64 (#90959)" (#113548)
This fixes remaining issues in my previous PR #90959.

Changes:
- Removed dependency on LLVM header in `xray_interface.cpp`
- Fixed XRay patching for some targets due to missing changes in
architecture-specific patching functions
- Addressed some remaining compiler warnings that I missed in the
previous patch
- Formatting

I have tested these changes on `x86_64` (natively), as well as
`ppc64le`, `aarch64` and `arm32` (cross-compiled and emulated using
qemu).

**Original description:**

This PR introduces shared library (DSO) support for XRay based on a
revised version of the implementation outlined in [this
RFC](https://discourse.llvm.org/t/rfc-upstreaming-dso-instrumentation-support-for-xray/73000).
The feature enables the patching and handling of events from DSOs,
supporting both libraries linked at startup or explicitly loaded, e.g.
via `dlopen`.
This patch adds the following:
- The `-fxray-shared` flag to enable the feature (turned off by default)
- A small runtime library that is linked into every instrumented DSO,
providing position-independent trampolines and code to register with the
main XRay runtime
- Changes to the XRay runtime to support management and patching of
multiple objects

These changes are fully backward compatible, i.e. running without
instrumented DSOs will produce identical traces (in terms of recorded
function IDs) to the previous implementation.

Due to my limited ability to test on other architectures, this feature
is only implemented and tested with x86_64. Extending support to other
architectures is fairly straightforward, requiring only a
position-independent implementation of the architecture-specific
trampoline implementation (see
`compiler-rt/lib/xray/xray_trampoline_x86_64.S` for reference).

This patch does not include any functionality to resolve function IDs
from DSOs for the provided logging/tracing modes. These modes still work
and will record calls from DSOs, but symbol resolution for these
functions in not available. Getting this to work properly requires
recording information about the loaded DSOs and should IMO be discussed
in a separate RFC, as there are mulitple feasible approaches.

---------

Co-authored-by: Sebastian Kreutzer <sebastian.kreutzer@tu-darmstadt.de>
2024-10-25 10:15:25 +02:00
Alexander Richardson
b1be21394e [runtimes] Allow building against an installed LLVM tree
I am currently trying to test the LLVM runtimes (including compiler-rt)
against an installed LLVM tree rather than a build tree (since that is
no longer available). Currently, the runtimes build of compiler-rt assumes
that LLVM_BINARY_DIR is writable since it uses configure_file() to write
there during the CMake configure stage. Instead, generate this file inside
CMAKE_CURRENT_BINARY_DIR, which will match LLVM_BINARY_DIR when invoked
from llvm/runtimes/CMakeLists.txt.

I also needed to make a minor change to the hwasan tests: hwasan_symbolize
was previously found in the LLVM_BINARY_DIR, but since it is generated as
part of the compiler-rt build it is now inside the CMake build directory
instead. I fixed this by passing the output directory to lit as
config.compiler_rt_bindir and using llvm_config.add_tool_substitutions().

For testing that we no longer write to the LLVM install directory as
part of testing or configuration, I created a read-only bind mount and
configured the runtimes builds as follows:
```
$ sudo mount --bind --read-only ~/llvm-install /tmp/upstream-llvm-readonly
$ cmake -DCMAKE_BUILD_TYPE=Debug \
  -DCMAKE_C_COMPILER=/tmp/upstream-llvm-readonly/bin/clang \
  -DCMAKE_CXX_COMPILER=/tmp/upstream-llvm-readonly/bin/clang++ \
  -DLLVM_INCLUDE_TESTS=TRUE -DLLVM_ENABLE_ASSERTIONS=TRUE \
  -DCOMPILER_RT_INCLUDE_TESTS=TRUE -DCOMPILER_RT_DEBUG=OFF \
  -DLLVM_ENABLE_RUNTIMES=compiler-rt \
  -DLLVM_BINARY_DIR=/tmp/upstream-llvm-readonly \
  -G Ninja -S ~/upstream-llvm-project/runtimes \
  -B ~/upstream-llvm-project/runtimes/cmake-build-debug-llvm-git
```

Reviewed By: ldionne

Pull Request: https://github.com/llvm/llvm-project/pull/86209
2024-10-24 17:35:07 -07: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
Eisuke Kawashima
0af6c304e4 [NFC][compiler-rt] fix(compiler-rt/**.py): fix comparison to None (#94015)
from PEP8
(https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
is not, never the equality operators.
2024-10-24 07:32:10 -07:00
Martin Storsjö
2002533802 [compiler-rt] [test] Mark a couple files as requiring LF newlines
Some of the profile test files fail if they have CRLF newlines;
add a .gitattributes file that forces them to be checked out
with LF newlines, regarless of the user Git configuration.
2024-10-23 22:43:50 +03:00
David Spickett
cb46662fde [compiler-rt][profile] Disable oneline-merging-windows.c on Windows on Arm
This test has been failing since https://lab.llvm.org/buildbot/#/builders/161/builds/2899,
but no change in that build caused it.

I think this has always failed but https://github.com/llvm/llvm-zorg/pull/252
only recently enabled in on the bot.
2024-10-23 16:07:25 +00:00
Martin Storsjö
c2717a89b8 [compiler-rt] [test] Remove an unintended grep parameter
This parameter seems unintentional here; we're trying to grep
the input on stdin, from the earlier stage in the pipeline.

Since a recent update on Github Actions runners, the previous
form (grepping a file, while piping in data on stdin) would fail
running the test, with the test runner Python script throwing
an exception when evaluating it:

      File "D:\a\llvm-mingw\llvm-mingw\llvm-project\llvm\utils\lit\lit\TestRunner.py", line 935, in _executeShCmd
        out = procs[i].stdout.read()
              ^^^^^^^^^^^^^^^^^^^^^^
      File "C:\hostedtoolcache\windows\Python\3.12.7\x64\Lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: a bytes-like object is required, not 'NoneType'
2024-10-20 22:56:41 +03:00
Vitaly Buka
9a4661cf31 [nfc][ubsan] Fix case of UNSUPPORTED: 2024-10-18 12:39:24 -07:00
Vitaly Buka
203b972289 [ubsan] Disable test on Darwin
Broken after #111497
2024-10-18 12:38:07 -07:00
Vitaly Buka
53e85d44ad [nfc][ubsan] Reorder RUNs and preconditions in test 2024-10-18 12:35:59 -07:00
Vitaly Buka
bbccc521c6 [lsan] Disable test with barriers on Darwin (#112810) 2024-10-17 19:23:08 -07:00
Chris Apple
8f8d5f005a [rtsan] Add statistics for suppression count (#112718) 2024-10-17 10:02:08 -07:00
Qiongsi Wu
f9d0789064 [PGO] Initialize GCOV Writeout and Reset Functions in the Runtime on AIX (#108570)
This PR registers the writeout and reset functions for `gcov` for all
modules in the PGO runtime, instead of registering them
using global constructors in each module. The change is made for AIX
only, but the same mechanism works on Linux on Power.

When registering such functions using global constructors in each module
without `-ffunction-sections`, the AIX linker cannot garbage collect
unused undefined symbols, because such symbols are grouped in the same
section as the `__sinit` symbol. Keeping such undefined symbols causes
link errors (see test case
https://github.com/llvm/llvm-project/pull/108570/files#diff-500a7e1ba871e1b6b61b523700d5e30987900002add306e1b5e4972cf6d5a4f1R1
for this scenario). This PR implements the initialization in the
runtime, hence avoiding introducing `__sinit` into each module.

The implementation adds a new global variable `__llvm_covinit_functions`
to each module. This new global variable contains the function pointers
to the `Writeout` and `Reset` functions. `__llvm_covinit_functions`'s
section is the named section `__llvm_covinit`. The linker will aggregate
all the `__llvm_covinit` sections from each module
to form one single named section in the final binary. The pair of
functions
```
const __llvm_gcov_init_func_struct *__llvm_profile_begin_covinit();
const __llvm_gcov_init_func_struct *__llvm_profile_end_covinit();
```
are implemented to return the start and end address of this named
section in the final binary, and they are used in function
```
__llvm_profile_gcov_initialize()
```
(which is a constructor function in the runtime) so the runtime knows
the addresses of all the `Writeout` and `Reset` functions from all the
modules.

One noticeable implementation detail relevant to AIX is that to preserve
the `__llvm_covinit` from the linker's garbage collection, a `.ref`
pseudo instruction is inserted into them, referring to the section that
contains the `__llvm_gcov_ctr` variables, which are used in the
instrumented code. The `__llvm_gcov_ctr` variables did not belong to
named sections before, but this PR added them to the
`__llvm_gcov_ctr_section` named section, so we can add a `.ref` pseudo
instruction that refers to them in the `__llvm_covinit` section.
2024-10-17 09:32:10 -04:00
Hans Wennborg
9d5ceccbd9 Speculatively un-XFAIL TestCases/Misc/Posix/ubsan_options.cpp on Darwin
After https://github.com/llvm/llvm-project/pull/111497 the test started
unexpectedly passing (https://crbug.com/373891811), probably because it
does actually work but wasn't run when it lived in the Misc/Linux/
directory.
2024-10-17 10:00:00 +02:00
Chris Apple
1efa6625ef [rtsan] Introduce function-name-matches suppression (#112108)
Introduces a new type of suppression:

1. function-name-matches - allows users to disable `malloc`, `free`,
`pthread_mutex_lock` or similar. This could be helpful if a user thinks
these are real-time safe on their OS. Also allows disabling of any
function marked [[blocking]].

This is useful as a **more performant "early outs" compared to the
`call-stack-contains` suppression**. `call-stack-contains` is inherently
VERY costly, needing to inspect every frame of every stack for a
matching string. This new suppression has an early out before we unwind
the stack.
2024-10-16 16:38:14 -07:00
Wael Yehia
92ad0397f4 [AIX][PGO] Enable some profile-rt tests now that -fprofile-instr-generate works on AIX 2024-10-16 15:33:56 +00:00
Lang Hames
7937fe1a17 [ORC][llvm-jitlink] Add support for forced loading of archive members.
This patch adds support for forced loading of archive members, similar to the
behavior of the -all_load and -ObjC options in ld64. To enable this, the
StaticLibraryDefinitionGenerator class constructors are extended with a
VisitMember callback that is called on each member file in the archive at
generator construction time. This callback can be used to unconditionally add
the member file to a JITDylib at that point.

To test this the llvm-jitlink utility is extended with -all_load (all platforms)
and -ObjC (darwin only) options. Since we can't refer to symbols in the test
objects directly (these would always cause the member to be linked in, even
without the new flags) we instead test side-effects of force loading: execution
of constructors and registration of Objective-C metadata.

rdar://134446111
2024-10-16 15:21:51 +11:00
Tacet
c76045d9bf [compiler-rt][ASan] Add function copying annotations (#91702)
This PR adds a `__sanitizer_copy_contiguous_container_annotations`
function, which copies annotations from one memory area to another. New
area is annotated in the same way as the old region at the beginning
(within limitations of ASan).

Overlapping case: The function supports overlapping containers, however
no assumptions should be made outside of no false positives in new
buffer area. (It doesn't modify old container annotations where it's not
necessary, false negatives may happen in edge granules of the new
container area.) I don't expect this function to be used with
overlapping buffers, but it's designed to work with them and not result
in incorrect ASan errors (false positives).

If buffers have granularity-aligned distance between them (`old_beg %
granularity == new_beg % granularity`), copying algorithm works faster.
If the distance is not granularity-aligned, annotations are copied byte
after byte.

```cpp
void __sanitizer_copy_contiguous_container_annotations(
    const void *old_storage_beg_p, const void *old_storage_end_p,
    const void *new_storage_beg_p, const void *new_storage_end_p) {
```

This function aims to help with short string annotations and similar
container annotations. Right now we change trait types of
`std::basic_string` when compiling with ASan and this function purpose
is reverting that change as soon as possible.


87f3407856/libcxx/include/string (L738-L751)

The goal is to not change `__trivially_relocatable` when compiling with
ASan. If this function is accepted and upstreamed, the next step is
creating a function like `__memcpy_with_asan` moving memory with ASan.
And then using this function instead of `__builtin__memcpy` while moving
trivially relocatable objects.


11a6799740/libcxx/include/__memory/uninitialized_algorithms.h (L644-L646)

---

I'm thinking if there is a good way to address fact that in a container
the new buffer is usually bigger than the previous one. We may add two
more arguments to the functions to address it (the beginning and the end
of the whole buffer.

Another potential change is removing `new_storage_end_p` as it's
redundant, because we require the same size.

Potential future work is creating a function `__asan_unsafe_memmove`,
which will be basically memmove, but with turned off instrumentation
(therefore it will allow copy data from poisoned area).

---------

Co-authored-by: Vitaly Buka <vitalybuka@google.com>
2024-10-15 13:26:39 +02: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
Rainer Orth
e290152181 [ubsan][test] Enable Misc/Linux tests on all Posix systems (#111497)
When investigating PR #101634, it turned out that
`UBSan-Standalone-sparc :: TestCases/Misc/Linux/diag-stacktrace.cpp`
isn't Linux-specific at all. In fact, none of the
`ubsan/TestCases/Misc/Linux` tests are.

Therefore this patch moves them to `Misc/Posix` instead.

Tested on `sparc64-unknown-linux-gnu`, `sparcv9-sun-solaris2.11`,
`x86_64-pc-linux-gnu`, and `amd64-pc-solaris2.11`.
2024-10-15 09:49:57 +02:00
David CARLIER
b8ee0aac2a [compiler-rt] DumpAllRegisters implementation for windows arm64. (#112254) 2024-10-14 23:13:37 +01:00
Paul Kirth
c4131cb56c [Fuchsia][cmake] Avoid referencing cxx_shared in compiler-rt (#112257)
After https://github.com/llvm/llvm-project/pull/80007 Fuchsia builds are
now always building cxx_shared for arm64 and x64 Linux. Ultimately, this
is because the LIBCXX_ENABLE_SHARED is not used in compiler-rt to select
the correct libc++ target, and because cxx_shared is now always defined,
it is selected as a dependency when building runtimes tests.

---------

Co-authored-by: Petr Hosek <phosek@google.com>
2024-10-14 14:41:19 -07:00
NAKAMURA Takumi
851817b494 fuzzer/strncmp.test: Increase iteration to 20M.
I saw cases that this finised before finding `BINGO`, possibly
insufficient number of iteration. In my case, 11,067,133 satisfied.

So, increase the number for now. This change may increase the duration
of this in failing (`BINGO` not found) case.
2024-10-14 18:34:36 +09:00
David CARLIER
e866e6b8bb [compiler-rt] Implements DumpAllRegisters for windows intel archs. (#108688) 2024-10-12 21:10:47 +01:00
Chris Apple
4468d58080 [rtsan] Support basic call stack suppressions (#111608)
This adds basic support for suppressions, which is a first class feature
of the other sanitizers.
2024-10-12 11:13:36 -07:00
Vitaly Buka
fa81868fe6 [lsan] Log thread history (#111949)
Only with high verbosity and leak reports, or thread logging requested.
2024-10-11 18:09:37 -07:00
Vitaly Buka
e1cff8bf81 [lsan] Add debug option to "deflake" leaks (#112037)
There are hard to debug leaks which look like
false.

In general, repeating leak checking should not
affect set of leaks significantly, especial
`at_exit` leak checking.

But if we see significant discrepancy, it may give
us a clue for investigation.
2024-10-11 16:57:19 -07:00
Mikhail Goncharov
90627a5a19 Revert "[XRay] Add support for instrumentation of DSOs on x86_64 (#90959)"
This reverts commit a4402039bf and 4451f9f812
2024-10-11 14:01:58 +02:00
Sebastian Kreutzer
a4402039bf [XRay] Add support for instrumentation of DSOs on x86_64 (#90959)
This PR introduces shared library (DSO) support for XRay based on a
revised version of the implementation outlined in [this
RFC](https://discourse.llvm.org/t/rfc-upstreaming-dso-instrumentation-support-for-xray/73000).
The feature enables the patching and handling of events from DSOs,
supporting both libraries linked at startup or explicitly loaded, e.g.
via `dlopen`.
This patch adds the following:
- The `-fxray-shared` flag to enable the feature (turned off by default)
- A small runtime library that is linked into every instrumented DSO,
providing position-independent trampolines and code to register with the
main XRay runtime
- Changes to the XRay runtime to support management and patching of
multiple objects

These changes are fully backward compatible, i.e. running without
instrumented DSOs will produce identical traces (in terms of recorded
function IDs) to the previous implementation.

Due to my limited ability to test on other architectures, this feature
is only implemented and tested with x86_64. Extending support to other
architectures is fairly straightforward, requiring only a
position-independent implementation of the architecture-specific
trampoline implementation (see
`compiler-rt/lib/xray/xray_trampoline_x86_64.S` for reference).

This patch does not include any functionality to resolve function IDs
from DSOs for the provided logging/tracing modes. These modes still work
and will record calls from DSOs, but symbol resolution for these
functions in not available. Getting this to work properly requires
recording information about the loaded DSOs and should IMO be discussed
in a separate RFC, as there are mulitple feasible approaches.

@petrhosek @jplehr
2024-10-11 11:23:34 +02:00
Wael Yehia
16ef893e9f [test] env -u is not supported on AIX, use unset instead 2024-10-10 21:35:10 +00:00
Wael Yehia
dc09f96441 [test] remove profile file at the start of profile/instrprof-write-file-atexit-explicitly.c 2024-10-09 17:54:24 +00:00
David CARLIER
d0b9c2c564 [compiler-rt] Remove SHA2 interceptions for NetBSD/FreeBSD. (#110246)
To Fix #110215

Interceptors introduced with 18a7ebda99
2024-10-09 05:47:00 +01:00
David CARLIER
a8eb12cdc9 [compiler-rt] Reapply freadlink interception for macOs. (#110917)
Fixed test, needed explicit O_SYMLINK on symbolic link opening.
2024-10-08 23:50:39 +01:00
Chris Apple
9e06e772a1 [rtsan] Add stats summary even when halt_on_error=true (#110165) 2024-10-07 14:26:09 -07:00
Chris Apple
6ace680a5c [rtsan][compiler-rt] Get rid of [[blocking]] stub in tests (#111392) 2024-10-07 13:20:58 -07:00
Hans Wennborg
c6b12bc829 Revert "[compiler-rt] intercept macOs's freadlink call. (#83679)"
The lit test has been failing on green dragon since it landed,
e.g. https://green.lab.llvm.org/job/llvm.org/job/clang-stage1-RA/2276/testReport/

This reverts commit a6ea0b0d29 and
follow-up commits ce72c76e9b,
a280275cff, and
d705bd25eb.
2024-10-02 15:21:25 +02:00
David CARLIER
ce72c76e9b [compiler-rt] XFAIL freadlink on darwin x86_64. (#110745)
GH-110372
2024-10-01 22:43:58 +01:00
Vitaly Buka
c7d4d39b9b [asan] Disable test on iOS
Fails on Darwin (probably iOS) bots after #104730.
2024-10-01 14:17:25 -07:00
lntue
007780f31e Revert "Add missing extendhfxf2 in compiler rt" (#110662)
Reverts llvm/llvm-project#109090
2024-10-01 09:02:24 -04:00
B I Mohammed Abbas
a57a83fc15 Add missing extendhfxf2 in compiler rt (#109090)
Issue: #105181
extendhfxf2 calls extendhfXfy to convert _Float16 to double, then type
casts this converted value to long double.
__uint128_t may not be available on all architectures. Thus I din't use
extendhfXfy to widen precision to 128 bits.
2024-10-01 08:42:08 -04:00
Wael Yehia
45e1a38a10 [PGO] use -fprofile-update=atomic instead of mllvm option in ContinuousSyncMode/set-file-object.c
because on some platforms (e.g. AIX) the compiler adds -latomic to the link step in 32-bit.
2024-10-01 01:14:34 +00:00
Rainer Orth
587eaefe87 [sanitizer_common] Handle ptrace on Linux/sparc64 (#109310)
When ASan testing is enabled on SPARC as per PR #107405, the
```
  AddressSanitizer-sparc-linux :: TestCases/Linux/ptrace.cpp
```
`FAIL`s on Linux/sparc64. This happens because the `ptrace` interceptor
has no support for that target at all.

This patch adds the missing parts and accounts for a couple of issues
specific to this target:
- In some cases, SPARC just needs to be included in the list of
supported targets.
- Besides, the types used by the `PTRACE_GETREGS` and `PTRACE_GETFPREGS`
requests need to be filled in.
- `ptrace` has a weird quirk on this target: for a couple of requests,
the meaning of the `data` and `addr` args is reversed. All of the
`Linux/ptrace.cpp` test and the interceptor, pre-syscall and
post-syscall hooks need to account for that swap in their checks.

Tested on `sparc64-unknown-linux-gnu` and `x86_64-pc-linux-gnu`.
2024-09-30 13:41:20 +02:00
Wael Yehia
f0083c6af7 [AIX][PGO] Enable PGO continuous mode support on AIX (#110196) 2024-09-27 22:34:05 +00:00