<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gcc.git/libsanitizer/interception, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/'/>
<entry>
<title>*: regenerate autotools</title>
<updated>2025-10-05T16:14:49+00:00</updated>
<author>
<name>Sam James</name>
<email>sam@gentoo.org</email>
</author>
<published>2025-10-05T16:12:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=ac273977adbe769c9d31708a403122e3b46365d8'/>
<id>ac273977adbe769c9d31708a403122e3b46365d8</id>
<content type='text'>
libatomic/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libcc1/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.

libffi/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* man/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libgcobol/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libgfortran/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libgm2/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* libm2cor/Makefile.in: Regenerate.
	* libm2iso/Makefile.in: Regenerate.
	* libm2log/Makefile.in: Regenerate.
	* libm2min/Makefile.in: Regenerate.
	* libm2pim/Makefile.in: Regenerate.

libgomp/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libgrust/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* libformat_parser/Makefile.in: Regenerate.
	* libproc_macro_internal/Makefile.in: Regenerate.

libitm/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libobjc/ChangeLog:

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libquadmath/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libsanitizer/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* asan/Makefile.in: Regenerate.
	* configure: Regenerate.
	* hwasan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.in: Regenerate.

libssp/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++17/Makefile.in: Regenerate.
	* src/c++20/Makefile.in: Regenerate.
	* src/c++23/Makefile.in: Regenerate.
	* src/c++26/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* src/experimental/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* src/libbacktrace/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libvtv/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

lto-plugin/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
libatomic/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libcc1/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.

libffi/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* include/Makefile.in: Regenerate.
	* man/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libgcobol/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libgfortran/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libgm2/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* libm2cor/Makefile.in: Regenerate.
	* libm2iso/Makefile.in: Regenerate.
	* libm2log/Makefile.in: Regenerate.
	* libm2min/Makefile.in: Regenerate.
	* libm2pim/Makefile.in: Regenerate.

libgomp/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libgrust/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* libformat_parser/Makefile.in: Regenerate.
	* libproc_macro_internal/Makefile.in: Regenerate.

libitm/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libobjc/ChangeLog:

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libphobos/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libquadmath/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libsanitizer/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* asan/Makefile.in: Regenerate.
	* configure: Regenerate.
	* hwasan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.in: Regenerate.

libssp/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++17/Makefile.in: Regenerate.
	* src/c++20/Makefile.in: Regenerate.
	* src/c++23/Makefile.in: Regenerate.
	* src/c++26/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* src/experimental/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* src/libbacktrace/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

libvtv/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.

lto-plugin/ChangeLog:

	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add type __sanitizer::ssize (#116957)</title>
<updated>2025-01-06T18:17:09+00:00</updated>
<author>
<name>Stefan Schulze Frielinghaus</name>
<email>stefansf@gcc.gnu.org</email>
</author>
<published>2025-01-06T18:17:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=1bd03564f29dc31e67e67efd93137d50fa7bb8a4'/>
<id>1bd03564f29dc31e67e67efd93137d50fa7bb8a4</id>
<content type='text'>
Since the sanitizer merge in commit r15-5164-gfa321004f3f628 of GCC
which entails LLVM commit 61a6439f35b6de28ff4aff4450d6fca970292fd5, GCCs
bootstrap is broken on s390 -m31. This is due to commit
ec68dc1ca4d967b599f1202855917d5ec9cae52f which introduces stricter type
checking which is why GCC bootstrap fails with

```
In file included from /gcc/src/libsanitizer/interception/interception.h:18,
                 from /gcc/src/libsanitizer/interception/interception_type_test.cpp:14:
/gcc/src/libsanitizer/interception/interception_type_test.cpp:30:61: error: static assertion failed
   30 | COMPILER_CHECK((__sanitizer::is_same&lt;::SSIZE_T, ::ssize_t&gt;::value));
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/gcc/src/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:363:44: note: in definition of macro 'COMPILER_CHECK'
  363 | #define COMPILER_CHECK(pred) static_assert(pred, "")
      |                                            ^~~~
make[8]: *** [Makefile:469: interception_type_test.lo] Error 1
```

The culprit seems to be that we don't check for equality of type sizes
anymore but rather whether the types are indeed the same. On s390 -m31
we have that `sizeof(int)==sizeof(long)` holds which is why previously
the checks succeeded. They fail now because

```
size_t      =&gt; unsigned long
ssize_t     =&gt; long
ptrdiff_t   =&gt; int
::SSIZE_T   =&gt; __sanitizer::sptr =&gt; int
::PTRDIFF_T =&gt; __sanitizer::sptr =&gt; int
```

This is fixed by mapping `SSIZE_T` to `long` in the end.

```
typedef long ssize;
typedef sptr ssize;

```

Cherry picked from LLVM commit ce44640fe29550461120d22b0358e6cac4aed822.

libsanitizer/ChangeLog:

	PR sanitizer/117725
	* interception/interception.h: Cherry picked from LLVM commit
	ce44640fe29550461120d22b0358e6cac4aed822.
	* sanitizer_common/sanitizer_internal_defs.h: Ditto.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since the sanitizer merge in commit r15-5164-gfa321004f3f628 of GCC
which entails LLVM commit 61a6439f35b6de28ff4aff4450d6fca970292fd5, GCCs
bootstrap is broken on s390 -m31. This is due to commit
ec68dc1ca4d967b599f1202855917d5ec9cae52f which introduces stricter type
checking which is why GCC bootstrap fails with

```
In file included from /gcc/src/libsanitizer/interception/interception.h:18,
                 from /gcc/src/libsanitizer/interception/interception_type_test.cpp:14:
/gcc/src/libsanitizer/interception/interception_type_test.cpp:30:61: error: static assertion failed
   30 | COMPILER_CHECK((__sanitizer::is_same&lt;::SSIZE_T, ::ssize_t&gt;::value));
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/gcc/src/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:363:44: note: in definition of macro 'COMPILER_CHECK'
  363 | #define COMPILER_CHECK(pred) static_assert(pred, "")
      |                                            ^~~~
make[8]: *** [Makefile:469: interception_type_test.lo] Error 1
```

The culprit seems to be that we don't check for equality of type sizes
anymore but rather whether the types are indeed the same. On s390 -m31
we have that `sizeof(int)==sizeof(long)` holds which is why previously
the checks succeeded. They fail now because

```
size_t      =&gt; unsigned long
ssize_t     =&gt; long
ptrdiff_t   =&gt; int
::SSIZE_T   =&gt; __sanitizer::sptr =&gt; int
::PTRDIFF_T =&gt; __sanitizer::sptr =&gt; int
```

This is fixed by mapping `SSIZE_T` to `long` in the end.

```
typedef long ssize;
typedef sptr ssize;

```

Cherry picked from LLVM commit ce44640fe29550461120d22b0358e6cac4aed822.

libsanitizer/ChangeLog:

	PR sanitizer/117725
	* interception/interception.h: Cherry picked from LLVM commit
	ce44640fe29550461120d22b0358e6cac4aed822.
	* sanitizer_common/sanitizer_internal_defs.h: Ditto.
</pre>
</div>
</content>
</entry>
<entry>
<title>libsanitizer: Remove -pedantic from AM_CXXFLAGS [PR117732]</title>
<updated>2024-11-25T08:36:41+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2024-11-25T08:36:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=e984ba40aa0c1fa3460e0266deb59b9036ba8454'/>
<id>e984ba40aa0c1fa3460e0266deb59b9036ba8454</id>
<content type='text'>
We aren't the master repository for the sanitizers and clearly upstream
introduces various extensions in the code.
All we care about is whether it builds and works fine with GCC, so
-pedantic flag is of no use to us, only maybe to upstream if they
cared about it (which they clearly don't).

The following patch removes those and fixes some whitespace nits at the same
time.

2024-11-25  Jakub Jelinek  &lt;jakub@redhat.com&gt;

	PR sanitizer/117732
	* asan/Makefile.am (AM_CXXFLAGS): Remove -pedantic.  Formatting fix.
	(asan_files): Formatting fix.
	* hwasan/Makefile.am (AM_CXXFLAGS): Remove -pedantic.  Formatting fix.
	* interception/Makefile.am (AM_CXXFLAGS): Likewise.
	(interception_files): Formatting fix.
	* libbacktrace/Makefile.am: Update copyright years.
	* lsan/Makefile.am (AM_CXXFLAGS): Remove -pedantic.  Formatting fix.
	* sanitizer_common/Makefile.am (AM_CXXFLAGS): Likewise.
	(libsanitizer_common_la_DEPENDENCIES): Formatting fix.
	* tsan/Makefile.am (AM_CXXFLAGS): Remove -pedantic.  Formatting fix.
	* ubsan/Makefile.am (AM_CXXFLAGS): Likewise.
	* asan/Makefile.in: Regenerate.
	* hwasan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.in: Regenerate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We aren't the master repository for the sanitizers and clearly upstream
introduces various extensions in the code.
All we care about is whether it builds and works fine with GCC, so
-pedantic flag is of no use to us, only maybe to upstream if they
cared about it (which they clearly don't).

The following patch removes those and fixes some whitespace nits at the same
time.

2024-11-25  Jakub Jelinek  &lt;jakub@redhat.com&gt;

	PR sanitizer/117732
	* asan/Makefile.am (AM_CXXFLAGS): Remove -pedantic.  Formatting fix.
	(asan_files): Formatting fix.
	* hwasan/Makefile.am (AM_CXXFLAGS): Remove -pedantic.  Formatting fix.
	* interception/Makefile.am (AM_CXXFLAGS): Likewise.
	(interception_files): Formatting fix.
	* libbacktrace/Makefile.am: Update copyright years.
	* lsan/Makefile.am (AM_CXXFLAGS): Remove -pedantic.  Formatting fix.
	* sanitizer_common/Makefile.am (AM_CXXFLAGS): Likewise.
	(libsanitizer_common_la_DEPENDENCIES): Formatting fix.
	* tsan/Makefile.am (AM_CXXFLAGS): Remove -pedantic.  Formatting fix.
	* ubsan/Makefile.am (AM_CXXFLAGS): Likewise.
	* asan/Makefile.in: Regenerate.
	* hwasan/Makefile.in: Regenerate.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.in: Regenerate.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.in: Regenerate.
</pre>
</div>
</content>
</entry>
<entry>
<title>libsanitizer: Move language level from gnu++14 to gnu++17</title>
<updated>2024-11-22T16:52:44+00:00</updated>
<author>
<name>Andrew Pinski</name>
<email>quic_apinski@quicinc.com</email>
</author>
<published>2024-11-22T00:55:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=cdd7171a6b0bc1570659afa4ee8a10fe6b894993'/>
<id>cdd7171a6b0bc1570659afa4ee8a10fe6b894993</id>
<content type='text'>
While compiling libsanitizer for aarch64-linux-gnu, I noticed the new warning:
```
../../../../libsanitizer/asan/asan_interceptors.cpp: In function ‘char* ___interceptor_strcpy(char*, const char*)’:
../../../../libsanitizer/asan/asan_interceptors.cpp:554:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
  554 |   if constexpr (SANITIZER_APPLE) {
      |      ^~~~~~~~~
```
So compile-rt upstream compiles this as gnu++17 (the current defualt for clang), so let's update it
to be similar.

Build and tested on aarch64-linux-gnu.

	PR sanitizer/117731
libsanitizer/ChangeLog:

	* asan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* asan/Makefile.in: Regenerate.
	* hwasan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* hwasan/Makefile.in: Regenerate.
	* interception/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* libbacktrace/Makefile.in (AM_CXXFLAGS): Regenerate.
	* lsan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* ubsan/Makefile.in: Regenerate.

Signed-off-by: Andrew Pinski &lt;quic_apinski@quicinc.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While compiling libsanitizer for aarch64-linux-gnu, I noticed the new warning:
```
../../../../libsanitizer/asan/asan_interceptors.cpp: In function ‘char* ___interceptor_strcpy(char*, const char*)’:
../../../../libsanitizer/asan/asan_interceptors.cpp:554:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
  554 |   if constexpr (SANITIZER_APPLE) {
      |      ^~~~~~~~~
```
So compile-rt upstream compiles this as gnu++17 (the current defualt for clang), so let's update it
to be similar.

Build and tested on aarch64-linux-gnu.

	PR sanitizer/117731
libsanitizer/ChangeLog:

	* asan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* asan/Makefile.in: Regenerate.
	* hwasan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* hwasan/Makefile.in: Regenerate.
	* interception/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* interception/Makefile.in: Regenerate.
	* libbacktrace/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* libbacktrace/Makefile.in (AM_CXXFLAGS): Regenerate.
	* lsan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* lsan/Makefile.in: Regenerate.
	* sanitizer_common/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* sanitizer_common/Makefile.in: Regenerate.
	* tsan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17.
	* ubsan/Makefile.in: Regenerate.

Signed-off-by: Andrew Pinski &lt;quic_apinski@quicinc.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libsanitizer: merge from upstream (61a6439f35b6de28)</title>
<updated>2024-11-12T13:56:06+00:00</updated>
<author>
<name>Kito Cheng</name>
<email>kito.cheng@sifive.com</email>
</author>
<published>2024-11-01T07:33:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=fa321004f3f6288d3ee2eefa6b02177131882dca'/>
<id>fa321004f3f6288d3ee2eefa6b02177131882dca</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libsanitizer: On aarch64 use hint #34 in prologue of libsanitizer functions</title>
<updated>2024-09-05T10:22:19+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2024-09-05T10:20:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=2379cbb94b2668227c237c94c82e3c49fe39fd0f'/>
<id>2379cbb94b2668227c237c94c82e3c49fe39fd0f</id>
<content type='text'>
When gcc is built with -mbranch-protection=standard, running sanitized
programs doesn't work properly on bti enabled kernels.

This has been fixed upstream with
https://github.com/llvm/llvm-project/pull/84061

The following patch cherry picks that from upstream.

For trunk we should eventually do a full merge from upstream, but I'm hoping
they will first fix up the _BitInt libubsan support mess.

2024-09-05  Jakub Jelinek  &lt;jakub@redhat.com&gt;

	* sanitizer_common/sanitizer_asm.h: Cherry-pick llvm-project revision
	1c792d24e0a228ad49cc004a1c26bbd7cd87f030.
	* interception/interception.h: Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When gcc is built with -mbranch-protection=standard, running sanitized
programs doesn't work properly on bti enabled kernels.

This has been fixed upstream with
https://github.com/llvm/llvm-project/pull/84061

The following patch cherry picks that from upstream.

For trunk we should eventually do a full merge from upstream, but I'm hoping
they will first fix up the _BitInt libubsan support mess.

2024-09-05  Jakub Jelinek  &lt;jakub@redhat.com&gt;

	* sanitizer_common/sanitizer_asm.h: Cherry-pick llvm-project revision
	1c792d24e0a228ad49cc004a1c26bbd7cd87f030.
	* interception/interception.h: Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Sanitizer/MIPS: Use $t9 for preemptible function call</title>
<updated>2024-01-17T09:03:08+00:00</updated>
<author>
<name>YunQiang Su</name>
<email>yunqiang.su@cipunited.com</email>
</author>
<published>2024-01-17T07:11:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=557dbbac8e6a344d44fedff75e16008fa8a5ffb7'/>
<id>557dbbac8e6a344d44fedff75e16008fa8a5ffb7</id>
<content type='text'>
Currently, almost all of the shared libraries of MIPS, rely on $t9
to get the address of current function, instead of PCREL instructions,
even on MIPSr6. So we have to set $t9 properly.

To get the address of preemptible function, we need the help of GOT.
MIPS/O32 has .cpload, which can help to generate 3 instructions to get GOT.
For __mips64, we can get GOT by:

lui $t8, %hi(%neg(%gp_rel(SANITIZER_STRINGIFY(TRAMPOLINE(func)))))
daddu $t8, $t8, $t9
daddiu $t8, $t8, %hi(%neg(%gp_rel(SANITIZER_STRINGIFY(TRAMPOLINE(func)))))

And then get the address of __interceptor_func, and jump to it

ld $t9, %got_disp(_interceptor" SANITIZER_STRINGIFY(func) ")($t8)
jr $t9

Upstream-Commit: 0a64367a72f1634321f5051221f05f2f364bd882

libsanitizer

	* interception/interception.h (substitution_##func_name):
	Use macro C_ASM_TAIL_CALL.
	* sanitizer_common/sanitizer_asm.h: Define C_ASM_TAIL_CALL
	for MIPS with help of t9.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, almost all of the shared libraries of MIPS, rely on $t9
to get the address of current function, instead of PCREL instructions,
even on MIPSr6. So we have to set $t9 properly.

To get the address of preemptible function, we need the help of GOT.
MIPS/O32 has .cpload, which can help to generate 3 instructions to get GOT.
For __mips64, we can get GOT by:

lui $t8, %hi(%neg(%gp_rel(SANITIZER_STRINGIFY(TRAMPOLINE(func)))))
daddu $t8, $t8, $t9
daddiu $t8, $t8, %hi(%neg(%gp_rel(SANITIZER_STRINGIFY(TRAMPOLINE(func)))))

And then get the address of __interceptor_func, and jump to it

ld $t9, %got_disp(_interceptor" SANITIZER_STRINGIFY(func) ")($t8)
jr $t9

Upstream-Commit: 0a64367a72f1634321f5051221f05f2f364bd882

libsanitizer

	* interception/interception.h (substitution_##func_name):
	Use macro C_ASM_TAIL_CALL.
	* sanitizer_common/sanitizer_asm.h: Define C_ASM_TAIL_CALL
	for MIPS with help of t9.
</pre>
</div>
</content>
</entry>
<entry>
<title>libsanitizer: Check assembler support for symbol assignment [PR112563]</title>
<updated>2023-11-28T13:54:34+00:00</updated>
<author>
<name>Rainer Orth</name>
<email>ro@CeBiTec.Uni-Bielefeld.DE</email>
</author>
<published>2023-11-28T13:54:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=088d3cbc5f906444a7dee98bc9a6f4b724ddfc21'/>
<id>088d3cbc5f906444a7dee98bc9a6f4b724ddfc21</id>
<content type='text'>
The recent libsanitizer import broke the build on Solaris/SPARC with the
native as:

/usr/ccs/bin/as: ".libs/sanitizer_errno.s", line 4247: error: symbol
"__sanitizer_internal_memset" is used but not defined
/usr/ccs/bin/as: ".libs/sanitizer_errno.s", line 4247: error: symbol
"__sanitizer_internal_memcpy" is used but not defined
/usr/ccs/bin/as: ".libs/sanitizer_errno.s", line 4247: error: symbol
"__sanitizer_internal_memmove" is used but not defined

Since none of the alternatives considered in the PR worked out, this
patch checks if the assembler does support symbol assignment, disabling
the code otherwise.  This returns the code to the way it was up to LLVM 16.

Bootstrapped without regressions on sparc-sun-solaris2.11 (as and gas) and
i386-pc-solaris2.11 (as and gas).

2023-11-23  Rainer Orth  &lt;ro@CeBiTec.Uni-Bielefeld.DE&gt;

	libsanitizer:
	PR sanitizer/112563
	* configure.ac (libsanitizer_cv_as_sym_assign): Check for
	assembler symbol assignment support.
	* configure: Regenerate.
	* asan/Makefile.am (DEFS): Add @AS_SYM_ASSIGN_DEFS@.
	* Makefile.in, asan/Makefile.in, hwasan/Makefile.in,
	interception/Makefile.in, libbacktrace/Makefile.in,
	lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in,
	ubsan/Makefile.in: Regenerate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The recent libsanitizer import broke the build on Solaris/SPARC with the
native as:

/usr/ccs/bin/as: ".libs/sanitizer_errno.s", line 4247: error: symbol
"__sanitizer_internal_memset" is used but not defined
/usr/ccs/bin/as: ".libs/sanitizer_errno.s", line 4247: error: symbol
"__sanitizer_internal_memcpy" is used but not defined
/usr/ccs/bin/as: ".libs/sanitizer_errno.s", line 4247: error: symbol
"__sanitizer_internal_memmove" is used but not defined

Since none of the alternatives considered in the PR worked out, this
patch checks if the assembler does support symbol assignment, disabling
the code otherwise.  This returns the code to the way it was up to LLVM 16.

Bootstrapped without regressions on sparc-sun-solaris2.11 (as and gas) and
i386-pc-solaris2.11 (as and gas).

2023-11-23  Rainer Orth  &lt;ro@CeBiTec.Uni-Bielefeld.DE&gt;

	libsanitizer:
	PR sanitizer/112563
	* configure.ac (libsanitizer_cv_as_sym_assign): Check for
	assembler symbol assignment support.
	* configure: Regenerate.
	* asan/Makefile.am (DEFS): Add @AS_SYM_ASSIGN_DEFS@.
	* Makefile.in, asan/Makefile.in, hwasan/Makefile.in,
	interception/Makefile.in, libbacktrace/Makefile.in,
	lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in,
	ubsan/Makefile.in: Regenerate.
</pre>
</div>
</content>
</entry>
<entry>
<title>sanitizer: Fix build on SPARC/Solaris with Solaris as [PR112562]</title>
<updated>2023-11-21T20:01:48+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2023-11-21T20:01:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=c7c1ee1cfdea228f79ba9d495b407f3689efc608'/>
<id>c7c1ee1cfdea228f79ba9d495b407f3689efc608</id>
<content type='text'>
Solaris as apparently doesn't accept %function and requires @function
instead.

This cherry-picks upstream commit.

2023-11-21  Jakub Jelinek  &lt;jakub@redhat.com&gt;

	PR sanitizer/112562
	* sanitizer_common/sanitizer_asm.h: Cherry-pick llvm-project revision
	a855a16a02e76a0f4192c038bb64f3773947a2f7.
	* interception/interception.h: Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Solaris as apparently doesn't accept %function and requires @function
instead.

This cherry-picks upstream commit.

2023-11-21  Jakub Jelinek  &lt;jakub@redhat.com&gt;

	PR sanitizer/112562
	* sanitizer_common/sanitizer_asm.h: Cherry-pick llvm-project revision
	a855a16a02e76a0f4192c038bb64f3773947a2f7.
	* interception/interception.h: Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>libsanitizer: merge from upstream (c425db2eb558c263)</title>
<updated>2023-11-15T11:45:58+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2023-11-15T11:45:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=28219f7f99a80519d1c6ab5e5dc83b4c7f8d7251'/>
<id>28219f7f99a80519d1c6ab5e5dc83b4c7f8d7251</id>
<content type='text'>
The following patch is result of libsanitizer/merge.sh
from c425db2eb558c263 (yesterday evening).

Bootstrapped/regtested on x86_64-linux and i686-linux (together with
the follow-up 3 patches I'm about to post).

BTW, seems upstream has added riscv64 support for I think lsan/tsan,
so if anyone is willing to try it there, it would be a matter of
copying e.g. the s390*-*-linux* libsanitizer/configure.tgt entry
to riscv64-*-linux* with the obvious s/s390x/riscv64/ change in it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following patch is result of libsanitizer/merge.sh
from c425db2eb558c263 (yesterday evening).

Bootstrapped/regtested on x86_64-linux and i686-linux (together with
the follow-up 3 patches I'm about to post).

BTW, seems upstream has added riscv64 support for I think lsan/tsan,
so if anyone is willing to try it there, it would be a matter of
copying e.g. the s390*-*-linux* libsanitizer/configure.tgt entry
to riscv64-*-linux* with the obvious s/s390x/riscv64/ change in it.
</pre>
</div>
</content>
</entry>
</feed>
