Do not crash when AsanThread::GetStackVariableShadowStart does not find
a variable for a pointer on a shadow stack.
Cherry-pick from ad2be02a833e56f7fe280797280b219eb3312621.
Differential Revision: https://reviews.llvm.org/D89552
The latest upstream merge for libsanitizer introduces code that makes
use of some macro values that are not available in SDKs for versions
of Darwin <= 15 (macOS 10.11).
Add definitions for these where they are not present.
libsanitizer/ChangeLog:
* sanitizer_common/sanitizer_mac.h: Ensure that TARGET_OS_
macros are defined where the macOS SDK does not contain
them.
(TARGET_OS_OSX, TARGET_OS_IOS, TARGET_OS_TV, TARGET_OS_WATCH):
Define where needed.
The latest Solaris 11.4/x86 update uncovered a libsanitizer bug that
caused one test to FAIL for 32-bit:
+FAIL: c-c++-common/asan/null-deref-1.c -O0 output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O1 output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O2 output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O2 -flto -flto-partition=none
output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -O3 -g output pattern test
+FAIL: c-c++-common/asan/null-deref-1.c -Os output pattern test
I've identified the problem and the fix has just landed in upstream
llvm-project:
https://reviews.llvm.org/D83664
Tested on i386-pc-solaris2.11 and x86_64-pc-linux.gnu.
libsanitizer:
* sanitizer_common/sanitizer_linux.cpp: Cherry-pick llvm-project
revision f0e9b76c3500496f8f3ea7abe6f4bf801e3b41e7.
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