rebase of the patches

This commit is contained in:
Sylvestre Ledru 2019-10-01 11:06:42 +02:00
parent 5be22cba05
commit f72c56cd4e

View File

@ -1,7 +1,7 @@
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -83,9 +83,14 @@
extern "C" {
// <sys/umtx.h> must be included after <errno.h> and <sys/types.h> on
@ -44,11 +44,11 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/san
char *base = (char *)map->l_addr;
Elf_Ehdr *ehdr = (Elf_Ehdr *)base;
char *phdrs = base + ehdr->e_phoff;
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -35,10 +35,12 @@
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -36,10 +36,12 @@
#include <syslog.h>
#if SANITIZER_FREEBSD
@ -63,7 +63,7 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/san
#endif
#if SANITIZER_OPENBSD
@@ -528,9 +530,9 @@ void GetThreadStackAndTls(bool main, upt
@@ -525,9 +527,9 @@ void GetThreadStackAndTls(bool main, upt
#endif
}
@ -75,10 +75,10 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/san
#define Elf_Phdr XElf32_Phdr
#define dl_phdr_info xdl_phdr_info
#define dl_iterate_phdr(c, b) xdl_iterate_phdr((c), (b))
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
@@ -15,7 +15,7 @@
#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
!defined(__OpenBSD__) && !defined(__APPLE__) && !defined(_WIN32) && \
@ -118,10 +118,10 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/san
#if __LP64__ || defined(_WIN64)
# define SANITIZER_WORDSIZE 64
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/asan/asan_linux.cpp
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/asan/asan_linux.cpp
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/asan/asan_linux.cpp
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/asan/asan_linux.cpp
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/asan/asan_linux.cpp
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/asan/asan_linux.cpp
@@ -37,7 +37,7 @@
#include <unistd.h>
#include <unwind.h>
@ -152,10 +152,10 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/asan/asan_linux.cpp
#define ucontext_t xucontext_t
#endif
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/ubsan/ubsan_platform.h
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/ubsan/ubsan_platform.h
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/ubsan/ubsan_platform.h
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/ubsan/ubsan_platform.h
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/ubsan/ubsan_platform.h
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/ubsan/ubsan_platform.h
@@ -14,7 +14,7 @@
// Other platforms should be easy to add, and probably work as-is.
@ -165,10 +165,10 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/ubsan/ubsan_platform
(defined(__sun__) && defined(__svr4__)) || \
defined(_WIN32) || defined(__Fuchsia__) || defined(__rtems__)
# define CAN_SANITIZE_UB 1
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S
@@ -192,7 +192,7 @@ ASM_SYMBOL_INTERCEPTOR(setjmp):
// obtain SP, store in %rdi, first argument to `void __tsan_setjmp(uptr sp)`
#if defined(__FreeBSD__) || defined(__NetBSD__)
@ -196,11 +196,11 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/tsan/rtl/tsan_rtl_am
lea 32(%rsp), %rdi
#else
# error "Unknown platform"
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerDefs.h
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/fuzzer/FuzzerDefs.h
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/fuzzer/FuzzerDefs.h
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerDefs.h
@@ -27,6 +27,7 @@
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/fuzzer/FuzzerDefs.h
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/fuzzer/FuzzerDefs.h
@@ -28,6 +28,7 @@
#define LIBFUZZER_LINUX 1
#define LIBFUZZER_NETBSD 0
#define LIBFUZZER_FREEBSD 0
@ -208,7 +208,7 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerDefs.h
#define LIBFUZZER_OPENBSD 0
#define LIBFUZZER_WINDOWS 0
#elif __APPLE__
@@ -53,6 +54,15 @@
@@ -54,6 +55,15 @@
#define LIBFUZZER_FREEBSD 1
#define LIBFUZZER_OPENBSD 0
#define LIBFUZZER_WINDOWS 0
@ -224,7 +224,7 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerDefs.h
#elif __OpenBSD__
#define LIBFUZZER_APPLE 0
#define LIBFUZZER_FUCHSIA 0
@@ -94,7 +104,7 @@
@@ -95,7 +105,7 @@
#define LIBFUZZER_POSIX \
(LIBFUZZER_APPLE || LIBFUZZER_LINUX || LIBFUZZER_NETBSD || \
@ -233,10 +233,10 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerDefs.h
#ifdef __x86_64
# if __has_attribute(target)
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
@@ -139,7 +139,7 @@ size_t GetPeakRSSMb() {
if (getrusage(RUSAGE_SELF, &usage))
return 0;
@ -246,10 +246,10 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerUtilPos
// ru_maxrss is in KiB
return usage.ru_maxrss >> 10;
} else if (LIBFUZZER_APPLE) {
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/fuzzer/FuzzerExtraCounters.cpp
@@ -11,7 +11,7 @@
#include "FuzzerDefs.h"
@ -259,10 +259,10 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerExtraCo
__attribute__((weak)) extern uint8_t __start___libfuzzer_extra_counters;
__attribute__((weak)) extern uint8_t __stop___libfuzzer_extra_counters;
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/fuzzer/FuzzerExtFunctionsWeak.cpp
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
#include "FuzzerDefs.h"
@ -272,10 +272,10 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerExtFunc
#include "FuzzerExtFunctions.h"
#include "FuzzerIO.h"
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp
@@ -9,7 +9,7 @@
//===----------------------------------------------------------------------===//
#include "FuzzerDefs.h"
@ -285,10 +285,10 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/fuzzer/FuzzerUtilLin
#include "FuzzerCommand.h"
#include <stdlib.h>
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h
@@ -20,7 +20,7 @@
// 32-bit mode.
#if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32)
@ -298,10 +298,10 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/san
# include <link.h>
# include <sys/param.h>
# include <ucontext.h>
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp
@@ -37,7 +37,7 @@
// Fix 'kinfo_vmentry' definition on FreeBSD prior v9.2 in 32-bit mode.
#if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32)
@ -311,24 +311,24 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/san
#define kinfo_vmentry xkinfo_vmentry
#endif
#endif
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -19,7 +19,9 @@
#include "sanitizer_internal_defs.h"
#include "sanitizer_platform.h"
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -24,7 +24,9 @@
#include "sanitizer_glibc_version.h"
#endif
+#if !SANITIZER_KFREEBSD
# define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle))
+#endif
#ifndef __GLIBC_PREREQ
#define __GLIBC_PREREQ(x, y) 0
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
namespace __sanitizer {
extern unsigned struct_utsname_sz;
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc
@@ -19,7 +19,7 @@
# define SYSCALL(name) __NR_ ## name
#endif
@ -338,11 +338,11 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/san
# define internal_syscall __syscall
# else
# define internal_syscall syscall
Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
Index: llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
===================================================================
--- llvm-toolchain-snapshot_10~svn367724.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -105,10 +105,14 @@ typedef struct user_fpregs elf_fpregset_
--- llvm-toolchain-snapshot_10~svn373305.orig/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ llvm-toolchain-snapshot_10~svn373305/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -106,10 +106,14 @@ typedef struct user_fpregs elf_fpregset_
#include <wordexp.h>
#endif
@ -358,7 +358,7 @@ Index: llvm-toolchain-snapshot_10~svn367724/compiler-rt/lib/sanitizer_common/san
#include <net/if_ppp.h>
#include <netax25/ax25.h>
#include <netipx/ipx.h>
@@ -145,8 +149,12 @@ typedef struct user_fpregs elf_fpregset_
@@ -146,8 +150,12 @@ typedef struct user_fpregs elf_fpregset_
#include <linux/if_ppp.h>
#endif