about summary refs log tree commit diff homepage
path: root/scripts/build/patches/llvm40.patch
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2020-01-23 15:28:56 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-02-13 17:39:21 +0000
commit2e8d6aed747a988871b6836012301708950a74ef (patch)
tree35ac617795950d9d23672fdec50a6d78dba31d3e /scripts/build/patches/llvm40.patch
parentdbda156217c532a7e1a65e8c216e593a64c0b8fc (diff)
downloadklee-2e8d6aed747a988871b6836012301708950a74ef.tar.gz
Use git repository to build LLVM
LLVM changed from svn to github. Use the github mirror to have faster build times.
Patches were updated to follow the new structure.

Patches also support building underr Ubuntu 18.04
Diffstat (limited to 'scripts/build/patches/llvm40.patch')
-rw-r--r--scripts/build/patches/llvm40.patch78
1 files changed, 51 insertions, 27 deletions
diff --git a/scripts/build/patches/llvm40.patch b/scripts/build/patches/llvm40.patch
index 0f39a499..8e8481dd 100644
--- a/scripts/build/patches/llvm40.patch
+++ b/scripts/build/patches/llvm40.patch
@@ -1,6 +1,17 @@
---- projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
-+++ projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
-@@ -607,8 +607,7 @@ uptr internal_prctl(int option, uptr arg
+--- a/compiler-rt/lib/esan/esan_sideline_linux.cpp
++++ b/compiler-rt/lib/esan/esan_sideline_linux.cpp
+@@ -70,7 +70,7 @@ int SidelineThread::runSideline(void *Arg) {
+
+   // Set up a signal handler on an alternate stack for safety.
+   InternalScopedBuffer<char> StackMap(SigAltStackSize);
+-  struct sigaltstack SigAltStack;
++  stack_t SigAltStack;
+   SigAltStack.ss_sp = StackMap.data();
+   SigAltStack.ss_size = SigAltStackSize;
+   SigAltStack.ss_flags = 0;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
+@@ -607,8 +607,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
  }
  #endif
 
@@ -10,8 +21,8 @@
    return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
  }
 
---- projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
-+++ projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
 @@ -21,7 +21,6 @@
  #include "sanitizer_platform_limits_posix.h"
 
@@ -30,9 +41,9 @@
  uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
      __sanitizer_sigset_t *oldset);
 
---- projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-+++ projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-@@ -275,7 +275,7 @@ static int TracerThread(void* argument)
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+@@ -275,7 +275,7 @@ static int TracerThread(void* argument) {
 
    // Alternate stack for signal handling.
    InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
@@ -41,8 +52,8 @@
    internal_memset(&handler_stack, 0, sizeof(handler_stack));
    handler_stack.ss_sp = handler_stack_memory.data();
    handler_stack.ss_size = kHandlerStackSize;
---- projects/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc
-+++ projects/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc
+--- a/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc
++++ b/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc
 @@ -289,7 +289,7 @@ void InitializePlatform() {
  int ExtractResolvFDs(void *state, int *fds, int nfd) {
  #if SANITIZER_LINUX && !SANITIZER_ANDROID
@@ -52,8 +63,8 @@
    for (int i = 0; i < MAXNS && cnt < nfd; i++) {
      if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
        fds[cnt++] = statp->_u._ext.nssocks[i];
---- projects/libcxx/include/__locale
-+++ projects/libcxx/include/__locale
+--- a/libcxx/include/__locale
++++ b/libcxx/include/__locale
 @@ -34,7 +34,7 @@
  # include <support/solaris/xlocale.h>
  #elif defined(_NEWLIB_VERSION)
@@ -63,25 +74,38 @@
      || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
  # include <xlocale.h>
  #elif defined(_LIBCPP_HAS_MUSL_LIBC)
---- projects/compiler-rt/lib/esan/esan_sideline_linux.cpp
-+++ projects/compiler-rt/lib/esan/esan_sideline_linux.cpp
-@@ -70,7 +70,7 @@ int SidelineThread::runSideline(void *Ar
-
-   // Set up a signal handler on an alternate stack for safety.
-   InternalScopedBuffer<char> StackMap(SigAltStackSize);
--  struct sigaltstack SigAltStack;
-+  stack_t SigAltStack;
-   SigAltStack.ss_sp = StackMap.data();
-   SigAltStack.ss_size = SigAltStackSize;
-   SigAltStack.ss_flags = 0;
---- include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
-+++ include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
+--- a/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
++++ b/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
 @@ -687,7 +687,7 @@ private:
- 
+
    uint32_t getTrampolineSize() const { return RemoteTrampolineSize; }
- 
+
 -  Expected<std::vector<char>> readMem(char *Dst, JITTargetAddress Src,
 +  Expected<std::vector<unsigned char>> readMem(char *Dst, JITTargetAddress Src,
                                        uint64_t Size) {
      // Check for an 'out-of-band' error, e.g. from an MM destructor.
      if (ExistingError)
+--- a/llvm/tools/llvm-shlib/CMakeLists.txt
++++ b/llvm/tools/llvm-shlib/CMakeLists.txt
+@@ -35,8 +35,9 @@ if(LLVM_DYLIB_EXPORTED_SYMBOL_FILE)
+ endif()
+
+ add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
+-
++if(LIB_NAMES)
+ list(REMOVE_DUPLICATES LIB_NAMES)
++endif()
+ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR MINGW) # FIXME: It should be "GNU ld for elf"
+   # GNU ld doesn't resolve symbols in the version script.
+   set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
+--- a/libcxx/include/__locale
++++ b/libcxx/include/__locale
+@@ -34,7 +34,7 @@
+ # include <support/solaris/xlocale.h>
+ #elif defined(_NEWLIB_VERSION)
+ # include <support/newlib/xlocale.h>
+-#elif (defined(__GLIBC__) || defined(__APPLE__)      || defined(__FreeBSD__) \
++#elif (defined(__APPLE__)      || defined(__FreeBSD__) \
+     || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
+ # include <xlocale.h>
+ #elif defined(_LIBCPP_HAS_MUSL_LIBC)
\ No newline at end of file