Commit Graph

468 Commits (master)

Author SHA1 Message Date
GCC Administrator d70f155b07 Daily bump. 2024-02-17 00:17:08 +00:00
Rainer Orth 7c6071a66f libsanitizer: Intercept __makecontext_v2 on Solaris/SPARC [PR113785]
c-c++-common/asan/swapcontext-test-1.c FAILs on Solaris/SPARC:

FAIL: c-c++-common/asan/swapcontext-test-1.c   -O0  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -O1  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -O2  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -O2 -flto  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c -O2 -flto -flto-partition=none
execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -O3 -g  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -Os  execution test

As detailed in PR sanitizer/113785, this happens because an ABI change
in Solaris 10/SPARC caused the external symbol for makecontext to be
changed to __makecontext_v2, which isn't intercepted.

The following patch, submitted upstream at
https://github.com/llvm/llvm-project/pull/81588, fixes that.

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11.

2024-02-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libsanitizer:
	PR sanitizer/113785
	* asan/asan_interceptors.cpp: Cherry-pick llvm-project revision
	8c2033719a843a1880427a5e8caa5563248bce78.
2024-02-16 14:06:24 +01:00
GCC Administrator 3e4c4c5edf Daily bump. 2024-02-07 00:18:31 +00:00
chenguoqi 66eebab468 LoongArch: libsanitizer: Enable Lsan and Tsan for loongarch64.
libsanitizer/ChangeLog:

	* configure.tgt: Enable tsan and lsan for loongarch64.
	* tsan/Makefile.am (EXTRA_libtsan_la_SOURCES): Add
	tsan_rtl_loongarch64.S.
	* tsan/Makefile.in: Regenerate.
2024-02-06 09:38:13 +08:00
Tamar Christina a73421bcf3 libsanitizer: Sync fixes for asan interceptors from upstream
This cherry-picks and squashes the differences between commits

d3e5c20ab846303874a2a25e5877c72271fc798b..76e1e45922e6709392fb82aac44bebe3dbc2ea63
from LLVM upstream from compiler-rt/lib/hwasan/ to GCC on the changes relevant
for GCC.

This is required to fix the linked PR.

As mentioned in the PR the last sync brought in a bug from upstream[1] where
operations became non-recoverable and as such the tests in AArch64 started
failing.  This cherry picks the fix and there are minor updates needed to GCC
after this to fix the cases.

[1] https://github.com/llvm/llvm-project/pull/74000

PR sanitizer/112644
Cherry-pick llvm-project revision
672b71cc1003533460a82f06b7d24fbdc02ffd58,
5fcf3bbb1acfe226572474636714ede86fffcce8,
3bded112d02632209bd55fb28c6c5c234c23dec3 and
76e1e45922e6709392fb82aac44bebe3dbc2ea63.
2024-01-31 14:49:21 +00:00
GCC Administrator c2544854ca Daily bump. 2024-01-20 00:18:14 +00:00
Daniel Cederman 3670fb86bc libsanitizer: Replace memcpy with internal version in sanitizer_common
When GCC is configured with --enable-target-optspace the compiler generates
a memcpy call in the Symbolizer constructor in sanitizer_symbolizer.cpp
when compiling for SPARC V8. Add HAVE_AS_SYM_ASSIGN to replace it with a
call to __sanitizer_internal_memcpy.

libsanitizer/ChangeLog:

	* sanitizer_common/Makefile.am (DEFS): Add @AS_SYM_ASSIGN_DEFS@.
	* sanitizer_common/Makefile.in: Regenerate.
2024-01-19 10:40:10 +01:00
GCC Administrator 2c213ac9fa Daily bump. 2024-01-18 00:18:14 +00:00
YunQiang Su 557dbbac8e Sanitizer/MIPS: Use $t9 for preemptible function call
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.
2024-01-17 17:03:08 +08:00
GCC Administrator 45c807b794 Daily bump. 2024-01-03 00:17:41 +00:00
Andreas Schwab ae11ee8f85 libsanitizer: Enable LSan and TSan for riscv64
libsanitizer:
	* configure.tgt (riscv64-*-linux*): Enable LSan and TSan.
2024-01-02 18:52:30 +01:00
GCC Administrator 6c85b8a987 Daily bump. 2023-11-29 00:17:27 +00:00
Rainer Orth 8f8db55539 libsanitizer: Update LOCAL_PATCHES
2023-11-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libsanitizer:
	* LOCAL_PATCHES: Update.
2023-11-28 15:00:31 +01:00
Rainer Orth 33b6ce99b5 libsanitizer: Only use assembler symbol assignment if supported [PR112563]
This patch only enables symbol assignment if the configure test determined
it's supported.

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

2023-11-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libsanitizer:
	PR sanitizer/112563
	* sanitizer_common/sanitizer_redefine_builtins.h: Check
	HAVE_AS_SYM_ASSIGN.
2023-11-28 14:55:52 +01:00
Rainer Orth 088d3cbc5f libsanitizer: Check assembler support for symbol assignment [PR112563]
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  <ro@CeBiTec.Uni-Bielefeld.DE>

	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.
2023-11-28 14:54:34 +01:00
GCC Administrator 92c480a423 Daily bump. 2023-11-22 00:17:52 +00:00
Jakub Jelinek c7c1ee1cfd sanitizer: Fix build on SPARC/Solaris with Solaris as [PR112562]
Solaris as apparently doesn't accept %function and requires @function
instead.

This cherry-picks upstream commit.

2023-11-21  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/112562
	* sanitizer_common/sanitizer_asm.h: Cherry-pick llvm-project revision
	a855a16a02e76a0f4192c038bb64f3773947a2f7.
	* interception/interception.h: Likewise.
2023-11-21 21:01:48 +01:00
GCC Administrator 9d58d2d8ba Daily bump. 2023-11-19 00:17:38 +00:00
Francois-Xavier Coudert c2553dd389 libsanitizer: fix build on darwin
Upstream report of the issue at
https://github.com/llvm/llvm-project/issues/72639

libsanitizer/ChangeLog:

	* asan/asan_mac.cpp: Protect Apple blocks behind the
	MISSING_BLOCKS_SUPPORT macro.
2023-11-18 09:49:27 +01:00
GCC Administrator 17cc2e57f4 Daily bump. 2023-11-16 00:17:42 +00:00
Jakub Jelinek b648bc5c6e libsanitizer: update LOCAL_PATCHES
2023-11-15  Jakub Jelinek  <jakub@redhat.com>

	* LOCAL_PATCHES: Update revisions.
2023-11-15 12:53:53 +01:00
Jakub Jelinek 95710d75ec libsanitizer: Readd __ubsan_handle_function_type_mismatch_v1{,_abort}
So that we don't have to bump libubsan.so.1 SONAME, the following patch
reverts part of the changes which removed two handlers.  While we don't
actually use them from GCC, we shouldn't remove supported entrypoints
unless SONAME is changed (removal of __interceptor_* or ___interceptor_*
is fine).  This is the only removal, other libraries just added some
symbols.

2023-11-15  Jakub Jelinek  <jakub@redhat.com>

	* ubsan/ubsan_handlers_cxx.h (FunctionTypeMismatchData): Forward
	declare.
	(__ubsan_handle_function_type_mismatch_v1,
	__ubsan_handle_function_type_mismatch_v1_abort): Declare.
	* ubsan/ubsan_handlers_cxx.cpp (handleFunctionTypeMismatch,
	__ubsan_handle_function_type_mismatch_v1,
	__ubsan_handle_function_type_mismatch_v1_abort): New functions readded
	for backwards compatibility from older ubsan.
	* ubsan/ubsan_interface.inc (__ubsan_handle_function_type_mismatch_v1,
	__ubsan_handle_function_type_mismatch_v1_abort): Readd.
2023-11-15 12:49:10 +01:00
Jakub Jelinek aaf0f12175 libsanitizer: Apply local patches
This patch just reapplies local patches (will be noted in LOCAL_PATCHES).
2023-11-15 12:46:56 +01:00
Jakub Jelinek 28219f7f99 libsanitizer: merge from upstream (c425db2eb558c263)
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.
2023-11-15 12:45:58 +01:00
GCC Administrator 3b6327461d Daily bump. 2023-10-23 00:16:43 +00:00
Iain Sandoe 6a6d3817af Config,Darwin: Allow for configuring Darwin to use embedded runpath.
Recent Darwin versions place contraints on the use of run paths
specified in environment variables.  This breaks some assumptions
in the GCC build.

This change allows the user to configure a Darwin build to use
'@rpath/libraryname.dylib' in library names and then to add an
embedded runpath to executables (and libraries with dependents).

The embedded runpath is added by default unless the user adds
'-nodefaultrpaths' to the link line.

For an installed compiler, it means that any executable built with
that compiler will reference the runtimes installed with the
compiler (equivalent to hard-coding the library path into the name
of the library).

During build-time configurations  any "-B" entries will be added to
the runpath thus the newly-built libraries will be found by exes.

Since the install name is set in libtool, that decision needs to be
available here (but might also cause dependent ones in Makefiles,
so we need to export a conditional).

This facility is not available for Darwin 8 or earlier, however the
existing environment variable runpath does work there.

We default this on for systems where the external DYLD_LIBRARY_PATH
does not work and off for Darwin 8 or earlier.  For systems that can
use either method, if the value is unset, we use the default (which
is currently DYLD_LIBRARY_PATH).

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Do not add default runpaths to GCC exes
	when we are building -static-libstdc++/-static-libgcc (the
	default).
	* libtool.m4: Add 'enable-darwin-at-runpath'.  Act  on the
	enable flag to alter Darwin libraries to use @rpath names.

gcc/ChangeLog:

	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.
	* config/darwin.h: Handle Darwin rpaths.
	* config/darwin.opt: Handle Darwin rpaths.
	* Makefile.in:  Handle Darwin rpaths.

gcc/ada/ChangeLog:

	* gcc-interface/Makefile.in: Handle Darwin rpaths.

gcc/jit/ChangeLog:
	* Make-lang.in: Handle Darwin rpaths.

libatomic/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libbacktrace/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

libgcc/ChangeLog:

	* config/t-slibgcc-darwin: Generate libgcc_s
	with an @rpath name.
	* config.host: Handle Darwin rpaths.

libgfortran/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths

libgm2/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.
	* libm2cor/Makefile.am: Handle Darwin rpaths.
	* libm2cor/Makefile.in: Regenerate.
	* libm2iso/Makefile.am: Handle Darwin rpaths.
	* libm2iso/Makefile.in: Regenerate.
	* libm2log/Makefile.am: Handle Darwin rpaths.
	* libm2log/Makefile.in: Regenerate.
	* libm2min/Makefile.am: Handle Darwin rpaths.
	* libm2min/Makefile.in: Regenerate.
	* libm2pim/Makefile.am: Handle Darwin rpaths.
	* libm2pim/Makefile.in: Regenerate.

libgomp/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths

libitm/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libobjc/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libphobos/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.
	* libdruntime/Makefile.am: Handle Darwin rpaths.
	* libdruntime/Makefile.in: Regenerate.
	* src/Makefile.am: Handle Darwin rpaths.
	* src/Makefile.in: Regenerate.

libquadmath/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libsanitizer/ChangeLog:

	* asan/Makefile.am: Handle Darwin rpaths.
	* asan/Makefile.in: Regenerate.
	* configure: Regenerate.
	* hwasan/Makefile.am: Handle Darwin rpaths.
	* hwasan/Makefile.in: Regenerate.
	* lsan/Makefile.am: Handle Darwin rpaths.
	* lsan/Makefile.in: Regenerate.
	* tsan/Makefile.am: Handle Darwin rpaths.
	* tsan/Makefile.in: Regenerate.
	* ubsan/Makefile.am: Handle Darwin rpaths.
	* ubsan/Makefile.in: Regenerate.

libssp/ChangeLog:

	* Makefile.am: Handle Darwin rpaths.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.
	* src/Makefile.am: Handle Darwin rpaths.
	* src/Makefile.in: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

lto-plugin/ChangeLog:
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.

zlib/ChangeLog:
	* configure: Regenerate.
	* configure.ac: Handle Darwin rpaths.
2023-10-22 19:30:02 +01:00
GCC Administrator 4b92dba78d Daily bump. 2023-08-08 00:17:37 +00:00
Nick Alcock dc17ceb305
libtool.m4: augment symcode for Solaris 11
This reports common symbols like GNU nm, via a type code of 'C'.

ChangeLog:

	* libtool.m4 (lt_cv_sys_global_symbol_pipe): Augment symcode for
	Solaris 11.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:41 +02:00
Alexander von Gluck IV ead5103cc6
Add support for the haiku operating system
These are the os support patches we have been grooming and maintaining
for quite a few years over on git.haiku-os.org.  All of these
architectures are working and most have been stable for quite some time.

ChangeLog:

	* configure: Regenerate.
	* configure.ac: Add Haiku to list of ELF OSes
	* libtool.m4: Update sys_lib_dlsearch_path_spec on Haiku.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:40 +02:00
Nick Alcock f330710912
libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case
My previous nm patch handled all cases but one -- if the user set NM in
the environment to a path which contained an option, libtool's nm
detection tries to run nm against a copy of nm with the options in it:
e.g. if NM was set to "nm --blargle", and nm was found in /usr/bin, the
test would try to run "/usr/bin/nm --blargle /usr/bin/nm --blargle".
This is unlikely to be desirable: in this case we should run
"/usr/bin/nm --blargle /usr/bin/nm".

Furthermore, as part of this nm has to detect when the passed-in $NM
contains a path, and in that case avoid doing a path search itself.
This too was thrown off if an option contained something that looked
like a path, e.g. NM="nm -B../prev-gcc"; libtool then tries to run
"nm -B../prev-gcc nm" which rarely works well (and indeed it looks
to see whether that nm exists, finds it doesn't, and wrongly concludes
that nm -p or whatever does not work).

Fix all of these by clipping all options (defined as everything
including and after the first " -") before deciding whether nm
contains a path (but not using the clipped value for anything else),
and then removing all options from the path-modified nm before
looking to see whether that nm existed.

NM=my-nm now does a path search and runs e.g.
  /usr/bin/my-nm -B /usr/bin/my-nm

NM=/usr/bin/my-nm now avoids a path search and runs e.g.
  /usr/bin/my-nm -B /usr/bin/my-nm

NM="my-nm -p../wombat" now does a path search and runs e.g.
  /usr/bin/my-nm -p../wombat -B /usr/bin/my-nm

NM="../prev-binutils/new-nm -B../prev-gcc" now avoids a path search:
  ../prev-binutils/my-nm -B../prev-gcc -B ../prev-binutils/my-nm

This seems to be all combinations, including those used by GCC bootstrap
(which, before this commit, fails to bootstrap when configured
--with-build-config=bootstrap-lto, because the lto plugin is now using
--export-symbols-regex, which requires libtool to find a working nm,
while also using -B../prev-gcc to point at the lto plugin associated
with the GCC just built.)

Regenerate all affected configure scripts.

ChangeLog:

	* libtool.m4 (LT_PATH_NM): Handle user-specified NM with
	options, including options containing paths.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:39 +02:00
Nick Alcock ab42297456
libtool.m4: fix nm BSD flag detection
Libtool needs to get BSD-format (or MS-format) output out of the system
nm, so that it can scan generated object files for symbol names for
-export-symbols-regex support.  Some nms need specific flags to turn on
BSD-formatted output, so libtool checks for this in its AC_PATH_NM.
Unfortunately the code to do this has a pair of interlocking flaws:

 - it runs the test by doing an nm of /dev/null.  Some platforms
   reasonably refuse to do an nm on a device file, but before now this
   has only been worked around by assuming that the error message has a
   specific textual form emitted by Tru64 nm, and that getting this
   error means this is Tru64 nm and that nm -B would work to produce
   BSD-format output, even though the test never actually got anything
   but an error message out of nm -B.  This is fixable by nm'ing *nm
   itself* (since we necessarily have a path to it).

 - the test is entirely skipped if NM is set in the environment, on the
   grounds that the user has overridden the test: but the user cannot
   reasonably be expected to know that libtool wants not only nm but
   also flags forcing BSD-format output.  Worse yet, one such "user" is
   the top-level Cygnus configure script, which neither tests for
   nor specifies any BSD-format flags.  So platforms needing BSD-format
   flags always fail to set them when run in a Cygnus tree, breaking
   -export-symbols-regex on such platforms.  Libtool also needs to
   augment $LD on some platforms, but this is done unconditionally,
   augmenting whatever the user specified: the nm check should do the
   same.

   One wrinkle: if the user has overridden $NM, a path might have been
   provided: so we use the user-specified path if there was one, and
   otherwise do the path search as usual.  (If the nm specified doesn't
   work, this might lead to a few extra pointless path searches -- but
   the test is going to fail anyway, so that's not a problem.)

(Tested with NM unset, and set to nm, /usr/bin/nm, my-nm where my-nm is a
symlink to /usr/bin/nm on the PATH, and /not-on-the-path/my-nm where
*that* is a symlink to /usr/bin/nm.)

ChangeLog:

	* libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
	NM, if there is one.  Run nm on itself, not on /dev/null, to avoid
	errors from nms that refuse to work on non-regular files.  Remove
	other workarounds for this problem.  Strip out blank lines from the
	nm output.

fixincludes/ChangeLog:

	* configure: Regenerate.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:39 +02:00
H.J. Lu 9c7797a8c2
GCC: Check if AR works with --plugin and rc
AR from older binutils doesn't work with --plugin and rc:

[hjl@gnu-cfl-2 bin]$ touch foo.c
[hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
[hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
./ar: no operation specified
[hjl@gnu-cfl-2 bin]$ ./ar --version
GNU ar (Linux/GNU Binutils) 2.29.51.0.1.20180112
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
[hjl@gnu-cfl-2 bin]$

Check if AR works with --plugin and rc before passing --plugin to AR and
RANLIB.

ChangeLog:

	* configure: Regenerated.
	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Check if AR works with
	--plugin and rc before enabling --plugin.

config/ChangeLog:

	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with
	--plugin and rc before enabling --plugin.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libiberty/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:37 +02:00
H.J. Lu 126f707efb
Sync with binutils: GCC: Pass --plugin to AR and RANLIB
Sync with binutils for building binutils with LTO:

50ad1254d50 GCC: Pass --plugin to AR and RANLIB

Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
build.

ChangeLog:

	* Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@
	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
	* configure.ac: Include config/gcc-plugin.m4.
	AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION.
	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and
	RANLIB if possible.
	* Makefile.in: Regenerated.
	* configure: Likewise.

config/ChangeLog:

	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.

libiberty/ChangeLog:

	* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
	(configure_deps): Depend on ../config/gcc-plugin.m4.
	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
	RANLIB_PLUGIN_OPTION.
	* aclocal.m4: Regenerated.
	* configure: Likewise.

zlib/ChangeLog:

	* configure: Regenerated.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:36 +02:00
Rainer Orth a2527a33a7 libsanitizer: Fix SPARC stacktraces
As detailed in LLVM Issue #57624
(https://github.com/llvm/llvm-project/issues/57624), a patch to
sanitizer_internal_defs.h broke SPARC stacktraces in the sanitizers.
The issue has now been fixed upstream (https://reviews.llvm.org/D156504)
and I'd like to cherry-pick that patch.

Bootstrapped without regressions on sparc-sun-solaris2.11.

2023-07-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libsanitizer:
	* sanitizer_common/sanitizer_stacktrace_sparc.cpp,
	sanitizer_common/sanitizer_unwind_linux_libcdep.cpp: Cherry-pick
	llvm-project revision 679c076ae446af81eba81ce9b94203a273d4b88a.
2023-08-07 11:29:02 +02:00
GCC Administrator 4d68c7f7b5 Daily bump. 2023-05-01 00:16:44 +00:00
Martin Liska 54765c875a libsanitizer: link hwasan against lsan library
Similarly to libasan.so, libhwasan.so also utilizes some
of the symbols from lsan library.

	PR sanitizer/109674

libsanitizer/ChangeLog:

	* hwasan/Makefile.am: Depend on liblsan.
	* hwasan/Makefile.in: Re-generate.
2023-04-30 21:31:49 +02:00
Martin Liska d2ab430a16 libsanitizer: update LOCAL_PATCHES revision
libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Update revision.
2023-04-30 09:56:46 +02:00
Martin Liska 401f46e630 libsanitizer: Apply local patches 2023-04-30 09:38:32 +02:00
Martin Liska d96e14ceb9 libsanitizer: merge from upstream (87e6e490e79384a5) 2023-04-30 09:38:14 +02:00
GCC Administrator 4a3dbcbdb3 Daily bump. 2023-04-27 00:16:44 +00:00
Martin Liska bd0791e899 libsanitizer: change LOCAL_PATCHES revision
libsanitizer/ChangeLog:

	* LOCAL_PATCHES: Change revision.
2023-04-26 15:52:21 +02:00
Martin Liska 21d3567068 libsanitizer: Apply local patches 2023-04-26 15:51:57 +02:00
Martin Liska d53b3d94aa libsanitizer: merge from upstream (3185e47b5a8444e9fd). 2023-04-26 15:51:56 +02:00
GCC Administrator d5cd3eada4 Daily bump. 2023-04-19 00:17:36 +00:00
Iain Sandoe e722a1f42b libsanitizer, darwin: Unsupport Darwin >= 22 for now.
The mechanism for location dyld has altered from Darwin22 since dyld is now
in the shared cache.  The implemented mechanism for walking the cache uses
Apple Blocks which GCC does not yet support, and the fallback to the original
mechanism does not work there.

Until a suitable work-around can be found, unsupport Darwin22+.

	Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

libsanitizer/ChangeLog:

	* configure.tgt: Unsupport Darwin22+ until a mechanism can be found
	to locate dyld in the shared cache.
2023-04-18 07:27:48 +01:00
Martin Liska cab2636174 libsanitizer: cherry-pick commit 8f5962b1ccb5fcd4d4544121d43efb860ac3cc6d from upstream
ASAN: keep support for Global::location

We as GCC still emit __asan_global_source_location for global variables
and we would like to use it in the future. On other hand, we don't
support llvm-symbolizer and the default libbacktraace symbolizer
does not support location info.
2023-02-24 09:14:40 +01:00
GCC Administrator 317525b03e Daily bump. 2023-02-01 00:18:50 +00:00
H.J. Lu a9fbc6687f libsanitizer: cherry-pick commit 742bcbf685bc from upstream
cherry-pick:

742bcbf685bc compiler-rt/lib: Add .Linterceptor_sigsetjmp

	PR sanitizer/108106
	* hwasan/hwasan_setjmp_x86_64.S (__interceptor_setjmp): Jump
	to .Linterceptor_sigsetjmp instead of __interceptor_sigsetjmp.
	(__interceptor_sigsetjmp): Add a local alias,
	.Linterceptor_sigsetjmp.
2023-01-31 14:56:59 -08:00
Martin Liska 3e40511959 libsanitizer: Regenerate configure
libsanitizer/ChangeLog:

	* configure: Regenerate.
2023-01-31 10:35:33 +01:00
YunQiang Su e08835fd3a libsanitizer/mips: always build with largefile support
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 is always used for mips
when build libsanitizer in LLVM. Thus
   FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216);
instead of
   FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216);
in sanitizer_platform_limits_posix.h.

To keep sync with LLVM and to make the code simple, we use the
largefile options always.

libsanitizer/
	* configure.ac: set -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
	always for mips*.
	* configure: Regenerate.
2023-01-31 10:00:44 +08:00