Merged from revision b638b63b99d66786cb37336292604a2ae3490cfd.
The patch successfully bootstraps on x86_64-linux-gnu and
ppc64le-linux-gnu. I also tested ppc64-linux-gnu that exposed:
https://reviews.llvm.org/D80864 (which is fixed on master).
Abidiff looks happy and I made UBSAN and ASAN bootstrap on
x86_64-linux-gnu.
I'm planning to do merge from master twice a year, once now and
next time short before stage1 closes.
I am going to install the patches as merge from master is obvious
and I haven't made anything special.
libsanitizer/ChangeLog:
* MERGE: Merge from master.
Simple documentation update based on usage of GIT by both
LLVM and GCC.
libsanitizer/ChangeLog:
* HOWTO_MERGE: Do not mention not existing argument.
* README.gcc: Update LLVM repository location.
After switching to GIT, we should use it in libsanitizer
merge script. I'll do merge from master as soon as
PR95311 gets fixed.
I'm going to install the patch.
libsanitizer/ChangeLog:
* LOCAL_PATCHES: Use git hash instead of SVN id.
* merge.sh: Use git instead of VCS. Update paths
relative to upstream git repository.
In the last import the sanitizer_platform_limits_freebsd.cpp got
forgotten. Fix this.
libsanitizer/sanitizer_common:
* Makefile.am: Add sanitizer_platform_limits_freebsd.cpp.
* Makefile.in: Regenerate.
The current imported libsanitizer code produces kernel panics for
Darwin 11 (macOS 10.7) and is unsupported for earlier versions already.
It is not clear if the current sources are even intended to be supported
on Darwin 11, so this patch causes the default to be build without
sanitizers for Darwin <= 11.
2020-03-01 Iain Sandoe <iain@sandoe.co.uk>
PR sanitizer/93731
* configure.tgt (x86_64-*-darwin*, i?86-*-darwin*): Enable by
default only for Darwin versions greater than 12 (macOS 10.8).
2019-11-07 Martin Liska <mliska@suse.cz>
* merge.sh: Update to use llvm-project git repository.
* all source files: Merge from upstream
82588e05cc32bb30807e480abd4e689b0dee132a.
From-SVN: r277909
2019-11-05 Martin Liska <mliska@suse.cz>
* ubsan/ubsan_flags.cpp (InitializeFlags): Trunk decided to print
summary for all sanitizers, but we want to have UBSAN without it.
From-SVN: r277837
Glibc has recently introduced changed to the mode field in ipc_perm
in commit 2f959dfe849e0646e27403f2e4091536496ac0f0. For Arm this
means that the mode field no longer has the same size.
This causes an assert failure against libsanitizer's internal copy
of ipc_perm. Since this change can't be easily detected I am adding
arm to the list of targets that are excluded from this check. libsanitizer
doesn't use this field (and others, it in fact uses only 1 field) so this check
can be ignored.
Padding bits were used by glibc when the field was changed so sizeof and offsets
of the remaining fields should be the same.
libsanitizer/ChangeLog:
PR sanitizer/92154
* sanitizer_common/sanitizer_platform_limits_posix.cpp (defined):
Cherry-pick compiler-rt revision r375220.
From-SVN: r277291
In FDPIC mode, we set -fPIE unless the user provides -fno-PIE, -fpie,
-fPIC or -fpic: indeed FDPIC code is PIC, but we want to generate code
for executables rather than shared libraries by default.
We also make sure to use the --fdpic assembler option, and select the
appropriate linker emulation.
At link time, we also default to -pie, unless we are generating a
shared library or a relocatable file (-r). Note that static link is
not supported as it requires specifying the dynamic linker because the
executable still has to relocate itself at startup.
We also force 'now' binding since lazy binding is not supported.
We should also apply the same behavior for -Wl,-Ur as for -r, but I
couldn't find how to describe that in the specs fragment.
2019-09-10 Christophe Lyon <christophe.lyon@st.com>
Mickaël Guêné <mickael.guene@st.com>
gcc/
* config.gcc: Handle arm*-*-uclinuxfdpiceabi.
* config/arm/bpabi.h (TARGET_FDPIC_ASM_SPEC): New.
(SUBTARGET_EXTRA_ASM_SPEC): Use TARGET_FDPIC_ASM_SPEC.
* config/arm/linux-eabi.h (FDPIC_CC1_SPEC): New.
(CC1_SPEC): Use FDPIC_CC1_SPEC.
(MUSL_DYNAMIC_LINKER): Add -fdpic suffix when needed.
* config/arm/uclinuxfdpiceabi.h: New file.
libsanitizer/
* configure.tgt (arm*-*-*fdpiceabi): Sanitizers are
unsupported in this configuration.
Co-Authored-By: Mickaël Guêné <mickael.guene@st.com>
From-SVN: r275565
If a target does not support libbacktrace, it might still the include
for $(top_srcdir).
Regenerate the built files using automake-1.15.1
libsanitizer/
2019-08-15 Iain Sandoe <iain@sandoe.co.uk>
PR bootstrap/91455
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* asan/Makefile.in: Likewise.
* configure: Likewise.
* interception/Makefile.in: Likewise.
* libbacktrace/Makefile.in: Likewise.
* lsan/Makefile.in: Likewise.
* sanitizer_common/Makefile.am: Include top_srcdir unconditionally.
* sanitizer_common/Makefile.in: Regenerated.
* tsan/Makefile.in: Likewise.
* ubsan/Makefile.in: Likewise.
From-SVN: r274538
For some Darwin versions the absence of the rethrow_primary_exception
symbol causes almost all sanitizer tests to fail.
The symbol is not present in libstdc++ and, therefore is is correct to
remove the reference to it for all platforms. We do this by adding a
new guard "ASAN_HAS_CXA_RETHROW_PRIMARY_EXCEPTION".
libsanitizer/
2019-06-18 Iain Sandoe <iain@sandoe.co.uk>
PR libsanitizer/87880
* asan/asan_interceptors.h:
(ASAN_INTERCEPT___CXA_RETHROW_PRIMARY_EXCEPTION): New.
* asan/Makefile.am (DEFS): Add
ASAN_HAS_CXA_RETHROW_PRIMARY_EXCEPTION, defined to 0.
* asan/Makefile.in: Regenerated.
* asan/libtool-version: Bump version.
From-SVN: r272406
The assembler code needs to say it uses AltiVec instructions.
libsanitizer/
PR target/90639
* tsan/tsan_rtl_ppc64.S: Add ".machine altivec".
From-SVN: r271668
PR sanitizer/80953
Merge from LLVM revision 355979
* asan/asan_globals.c (GetGlobalsForAddress): Use internal_memcpy to
copy Global objects for SPARC with GCC.
From-SVN: r269640
PR sanitizer/80953
Merge from LLVM revision 355978
* sanitizer_common/sanitizer_allocator_primary32.h
(class SizeClassAllocator32): Assert that kSpaceSize is power of 2 if
SANITIZER_SIGN_EXTENDED_ADDRESSES is set.
(PointerIsMine): Deal with SANITIZER_SIGN_EXTENDED_ADDRESSES.
(ComputeRegionId): Likewise.
* sanitizer_common/sanitizer_linux.cc (GetMaxVirtualAddress): Return
appropriate value for SPARC 64-bit.
* sanitizer_common/sanitizer_platform.h (SANITIZER_MMAP_RANGE_SIZE):
Define for SPARC.
(SANITIZER_SIGN_EXTENDED_ADDRESSES): Define to 1 for SPARC 64-bit.
From-SVN: r269639
PR sanitizer/80953
Merge from LLVM revision 355965
* sanitizer_common/sanitizer_linux.cc (GetWriteFlag): Implement for
SPARC/Linux.
(GetPcSpBp): Likewise.
* sanitizer_common/sanitizer_stacktrace.cc (GetNextInstructionPc):
Adjust for SPARC.
* sanitizer_common/sanitizer_stacktrace.h (SANITIZER_CAN_FAST_UNWIND):
Define to 1 for SPARC.
* sanitizer_common/sanitizer_stacktrace_sparc.cc: Rewrite.
* sanitizer_common/sanitizer_unwind_linux_libcdep.cc (SlowUnwindStack):
Adjust the PC address for SPARC with GCC.
From-SVN: r269638
2018-11-09 Martin Liska <mliska@suse.cz>
PR sanitizer/87892
* sanitizer_common/sanitizer_linux_libcdep.cc (defined): Return
1 when CPU_COUNT macro is not defined.
From-SVN: r265950
Cherry pick powerpc64 sanitizer fix from upstream llvm.
See https://reviews.llvm.org/rL346030 and
https://reviews.llvm.org/D52900.
2018-11-08 Bill Seurer <seurer@linux.vnet.ibm.com>
* libsanitizer/sanitizer_common/sanitizer_linux.cc (CheckASLR):
Disable ASLR for powerpc64 when using sanitizers.
From-SVN: r265941
This re-applies r258525, and this time adds it to LOCAL_PATCHES.
libsanitizer/
* LOCAL_PATCHES: Add r258525.
* sanitizer_common/sanitizer_stacktrace.cc
(BufferedStackTrace::FastUnwindStack): Use the correct frame offset
for PowerPC SYSV ABI.
From-SVN: r265817
This patch updates GCC to use autoconf 2.69 and automake 1.15.1.
(That's not the latest automake version, but it's the one used by
binutils-gdb, with which consistency is desirable, and in any case
seems a useful incremental update that should make a future update to
1.16.1 easier.)
The changes are generally similar to the binutils-gdb ones, and are
copied from there where shared files and directories are involved
(there are some further changes to such shared directories, however,
which I'd expect to apply to binutils-gdb once this patch is in GCC).
Largely, obsolete AC_PREREQ calls are removed, while many
AC_LANG_SOURCE calls are added to avoid warnings from aclocal and
autoconf. Multilib support is no longer included in core automake,
meaning that multilib.am needs copying from automake's contrib
directory into the GCC source tree. Autoconf 2.69 has Go support, so
local copies of that support are removed. I hope the D support will
soon be submitted to upstream autoconf so the local copy of that can
be removed in a future update. Changes to how automake generates
runtest calls mean quotes are removed from RUNTEST definitions in five
lib*/testsuite/Makefile.am files (libatomic, libgomp, libitm,
libphobos, libvtv; some others have RUNTEST definitions without
quotes, which are still OK); libgo and libphobos also get
-Wno-override added to AM_INIT_AUTOMAKE so those overrides of RUNTEST
do not generate automake warnings.
Note that the regeneration did not include regeneration of
fixincludes/config.h.in (attempting such regeneration resulted in all
the USED_FOR_TARGET conditionals disappearing; and I don't see
anything in the fixincludes/ directory that would result in such
conditionals being generated, unlike in the gcc/ directory). Also
note that libvtv/testsuite/other-tests/Makefile.in was not
regenerated; that directory is not listed as a subdirectory for which
Makefile.in gets regenerated by calling "automake" in libvtv/, so I'm
not sure how it's meant to be regenerated.
While I mostly fixed warnings should running aclocal / automake /
autoconf, there were various such warnings from automake in the
libgfortran, libgo, libgomp, liboffloadmic, libsanitizer, libphobos
directories that I did not fix, preferring to leave those to the
relevant subsystem maintainers. Specifically, most of those warnings
were of the following form (example from libgfortran):
Makefile.am:48: warning: source file 'caf/single.c' is in a subdirectory,
Makefile.am:48: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled. For now, the corresponding output
automake: object file(s) will be placed in the top-level directory. However,
automake: this behaviour will change in future Automake versions: they
will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.
I think it's best for the relevant maintainers to add subdir-objects
and do any other associated Makefile.am changes needed. In some cases
the paths in the warnings involved ../; I don't know if that adds any
extra complications to the use of subdir-objects.
I've tested this with native, cross and Canadian cross builds. The
risk of any OS-specific issues should I hope be rather lower than if a
libtool upgrade were included (we *should* do such an upgrade at some
point, but it's more complicated - it involves identifying all our
local libtool changes to see if any aren't included in the upstream
version we update to, and reverting an upstream libtool patch that's
inappropriate for use in GCC); I think it would be better to get this
update into GCC so that people can test in different configurations
and we can fix any issues found, rather than to try to get more and
more testing done before it goes in.
top level:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* multilib.am: New file. From automake.
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* libtool.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
* ar-lib: New file.
* test-driver: New file.
* configure: Re-generate.
config:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* math.m4, tls.m4: Use AC_LANG_SOURCE.
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.
fixincludes:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* aclocal.m4, configure: Regenerate.
gcc:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. Use single
line for second argument of AC_DEFINE_UNQUOTED.
* doc/install.texi (Tools/packages necessary for modifying GCC):
Update to autoconf 2.69 and automake 1.15.1.
* aclocal.m4, config.in, configure: Regenerate.
gnattools:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* configure: Regenerate.
gotools:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* config/go.m4: Remove file.
* Makefile.am (ACLOCAL_AMFLAGS): Do not use -I ./config.
* configure.ac: Remove AC_PREREQ. Do not include config/go.m4.
* Makefile.in, aclocal.m4, configure: Regenerate.
intl:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
* configure: Re-generate.
* config.h.in: Re-generate.
* aclocal.m4: Re-generate.
libada:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* configure: Regenerate.
libatomic:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* acinclude.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libbacktrace:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
libcc1:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure: Regenerate.
libcpp:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* aclocal.m4, config.in, configure: Regenerate.
libdecnumber:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* aclocal.m4.
libffi:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Add info-in-builddir.
(CLEANFILES): Remove doc/libffi.info.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure, fficonfig.h.in,
include/Makefile.in, man/Makefile.in, testsuite/Makefile.in:
Regenerate.
libgcc:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* configure: Regenerate.
libgfortran:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
libgo [logically part of this change but omitted from the commit]:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* config/go.m4: Remove file.
* config/libtool.m4: Use AC_LANG_SOURCE.
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE. Use
-Wno-override in AM_INIT_AUTOMAKE call.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libgomp:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am
(AUTOMAKE_OPTIONS): Add info-in-builddir.
(CLEANFILES): Remove libgomp.info.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libhsail-rt:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure: Regenerate.
libiberty:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Remove AC_PREREQ.
* configure: Re-generate.
* config.in: Re-generate.
libitm:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Add info-in-builddir.
(CLEANFILES): Remove libitm.info.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
libobjc:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ.
* aclocal.m4, config.h.in, configure: Regenerate.
liboffloadmic:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* plugin/Makefile.am: Include multilib.am.
* plugin/configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure, plugin/Makefile.in,
plugin/aclocal.m4, plugin/configure: Regenerate.
libphobos:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ. Use -Wno-override in
AM_INIT_AUTOMAKE call.
* m4/autoconf.m4: Add extra argument to AC_LANG_DEFINE call.
* m4/druntime/os.m4: Use AC_LANG_SOURCE.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, libdruntime/Makefile.in,
src/Makefile.in, testsuite/Makefile.in: Regenerate.
libquadmath:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Remove 1.8. Add info-in-builddir.
(all-local): Define outside conditional code.
(CLEANFILES): Remove libquadmath.info.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
libsanitizer:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* Makefile.in, aclocal.m4, asan/Makefile.in, configure,
interception/Makefile.in, libbacktrace/Makefile.in,
lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in,
ubsan/Makefile.in: Regenerate.
libssp:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
(AUTOMAKE_OPTIONS): Remove 1.9.5.
* configure.ac: Remove AC_PREREQ. Quote argument to
AC_RUN_IFELSE.
* Makefile.in, aclocal.m4, configure: Regenerate.
libstdc++-v3:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* Makefile.in, aclocal.m4, configure, doc/Makefile.in,
include/Makefile.in, libsupc++/Makefile.in, po/Makefile.in,
python/Makefile.in, src/Makefile.in, src/c++11/Makefile.in,
src/c++17/Makefile.in, src/c++98/Makefile.in,
src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate.
libvtv:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
* configure.ac: Remove AC_PREREQ.
* testsuite/Makefile.am (RUNTEST): Remove quotes.
* Makefile.in, aclocal.m4, configure, testsuite/Makefile.in:
Regenerate.
lto-plugin:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
* Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
zlib:
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856
* Makefile.am: Include multilib.am.
Merge from binutils-gdb:
2018-06-19 Simon Marchi <simon.marchi@ericsson.com>
* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add foreign.
* Makefile.in: Re-generate.
* aclocal.m4: Re-generate.
* configure: Re-generate.
From-SVN: r265695
2018-10-31 Martin Liska <mliska@suse.cz>
* config.h.in: Regenerate.
* configure: Likewise.
* sanitizer_common/Makefile.am: Include new files, remove old
files.
* sanitizer_common/Makefile.in: Regenerate.
* ubsan/Makefile.am: Include new files, remove old
files.
* ubsan/Makefile.in: Likewise.
* asan/Makefile.am: Include new files.
* asan/Makefile.in: Regenerate.
From-SVN: r265666
[PowerPC][tsan] Update tsan to handle changed memory layouts in newer kernels
In more recent Linux kernels with 47 bit VMAs the layout of virtual memory
for powerpc64 changed causing the thread sanitizer to not work properly. This
patch adds support for 47 bit VMA kernels for powerpc64.
Tested on several 4.x and 3.x kernel releases.
Regtested/bootstrapped on ppc64le-linux with kernel 4.14; applying to
trunk/8.3.
2018-08-01 Marek Polacek <polacek@redhat.com>
PR sanitizer/86759
* tsan/tsan_platform.h: Cherry-pick compiler-rt revision 318044.
* tsan/tsan_platform_linux.cc: Cherry-pick compiler-rt revision
319180.
From-SVN: r263229
Cherry-pick compiler-rt revision 337603:
When shadow stack from Intel CET is enabled, the first instruction of all
indirect branch targets must be a special instruction, ENDBR.
lib/asan/asan_interceptors.cc has
...
int res = REAL(swapcontext)(oucp, ucp);
...
REAL(swapcontext) is a function pointer to swapcontext in libc. Since
swapcontext may return via indirect branch on x86 when shadow stack is
enabled, as in this case,
int res = REAL(swapcontext)(oucp, ucp);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This function may be
returned via an indirect branch.
Here compiler must insert ENDBR after call, like
call *bar(%rip)
endbr64
I opened an LLVM bug:
https://bugs.llvm.org/show_bug.cgi?id=38207
to add the indirect_return attribute so that it can be used to inform
compiler to insert ENDBR after REAL(swapcontext) call. We mark
REAL(swapcontext) with the indirect_return attribute if it is available.
This fixed:
https://bugs.llvm.org/show_bug.cgi?id=38249
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D49608
PR target/86560
* asan/asan_interceptors.cc (swapcontext) Cherry-pick
compiler-rt revision 337603.
* sanitizer_common/sanitizer_internal_defs.h (__has_attribute):
Likewise.
From-SVN: r263009
Cherry-pick compiler-rt revision 333213:
<sys/ustat.h> has been removed from glibc 2.28 by:
commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Sun Mar 18 11:28:59 2018 +0800
Deprecate ustat syscall interface
This patch uses pre-computed size of struct ustat for Linux.
PR sanitizer/85835
* sanitizer_common/sanitizer_platform_limits_posix.cc: Don't
include <sys/ustat.h> for Linux.
(SIZEOF_STRUCT_USTAT): New.
(struct_ustat_sz): Use SIZEOF_STRUCT_USTAT for Linux.
From-SVN: r260684
If someone has access to a 64-bit mips-linux system to test
this (with the obvious edit), that'd be really nice. Until
then, best to not introduce possible build failures.
* configure.tgt <mips*-*-linux*>: Enable build, excluding
mips*64*-*-linux*.
From-SVN: r259665
As mentioned in <http://gcc.gnu.org/ml/gcc/2018-03/msg00133.html>
the bogus adjustment to 160 from 144 (which is reverted here),
is a single-token commit in upstream r301307, an attempt to
correct a failed build due to an upstream change to compile the
runtime with D_FILE_OFFSET_BITS=64. The correct fix is here:
just use the right include. Yes, user-struct-stat64-as-stat is
actually 160 for MIPS o32 and I hear user-struct-stat is also
160 for n32. There are additional fields appended for
user-struct-stat! I guess for MIPS it's as bad as it gets for
mixing up kernel and user struct stat. The context of the patch
doesn't show that in the #else there's the correct include, the
one for <asm/stat.h> to get the kernel-struct-stat. If you
can't compile it, IMHO the kernel headers are just too old; 3.2
is fine for example.
* sanitizer_common/sanitizer_platform_limits_linux.cc: Do not
take the shortcut to #include <sys/stat.h> for MIPS instead of
the kernel <asm/stat.h>. Explain why sys/stat.h is misleading
or wrong to get the kernel struct stat.
* sanitizer_common/sanitizer_platform_limits_posix.h [__mips__]:
Correct the value for 32-bit non-android struct_kernel_stat_sz.
From-SVN: r259664
This appears to be present in compiler-rt upstream, but as part
of more intrusive changes. For gcc, the lack of this results in
a fatal warning (-Werror) at build-time.
* sanitizer_common/sanitizer_atomic_clang_other.h [_MIPS_SIM
&& _MIPS_SIM == _ABIO32] (lock): Add initializer for .pad member.
From-SVN: r259663
* config/cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace
--enable-cet=default with --enable-cet=auto.
* doc/install.texi: Document --disable-cet being the default and
--enable-cet=auto.
* configure: Regenerated.
From-SVN: r259487
PR jit/85384
* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.
* configure.ac (gcc-driver-name.h): Honor --with-gcc-major-version
by using gcc_base_ver to generate a gcc_driver_version, and use
it when generating GCC_DRIVER_NAME.
* configure: Regenerate.
* configure: Regenerate.
From-SVN: r259462
PR sanitizer/84761
* sanitizer_common/sanitizer_linux_libcdep.cc (__GLIBC_PREREQ):
Define if not defined.
(DL_INTERNAL_FUNCTION): Don't define.
(InitTlsSize): For __i386__ if not compiled against glibc 2.27+
determine at runtime whether to use regparm(3), stdcall calling
convention for older glibcs or normal calling convention for
newer glibcs for call to _dl_get_tls_static_info.
From-SVN: r258663
This fixes more than half of our testcase failures on BE.
libsanitizer/
* sanitizer_common/sanitizer_stacktrace.cc
(BufferedStackTrace::FastUnwindStack): Use the correct frame offset
for PowerPC SYSV ABI.
From-SVN: r258525
ENDBR32 and RDSSPD are multi-byte NOPs on x86-64 processors and
newer x86 processors, starting Pentium Pro. They are UD on older
32-bit processors. Detect this at configure time and adjust the
default value for enable_cet. GCC will enable CET in 32-bit run-time
libraries in any case if --enable-cet is used to configure GCC.
PR target/84148
* config/cet.m4: Check if target support multi-byte NOPS (SSE).
* libatomic/configure: Regenerate.
* libbacktrace/configure: Likewise.
* libgcc/configure: Likewise.
* libgfortran/configure: Likewise.
* libgomp/configure: Likewise.
* libitm/configure: Likewise.
* libmpx/configure: Likewise.
* libobjc/configure: Likewise.
* libquadmath/configure: Likewise.
* libsanitizer/configure: Likewise.
* libssp/configure: Likewise.
* libstdc++-v3/configure: Likewise.
* libvtv/configure: Likewise.
From-SVN: r257809
Since size of "void *" is 4 bytes for x32, check if __x86_64__ is defined
by $CC, instead of
if test x$ac_cv_sizeof_void_p = x8; then
to decide wether sanitizer_linux_x86_64.lo should be used.
PR sanitizer/82379
* configure.tgt (SANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS): Set
to sanitizer_linux_x86_64.lo if __x86_64__ is defined by $CC.
From-SVN: r253441