about summary refs log tree commit diff homepage
path: root/scripts/build
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2019-03-20 22:01:00 +0100
committerMartinNowack <martin.nowack@gmail.com>2019-03-21 12:46:01 +0000
commit9767a37f9e8a743fa81629510346cb0a5a3a7900 (patch)
treebc49e16925582e41ee51cacc35c4f7bcafd8860f /scripts/build
parenteee440835b857a7cb68b72f4af4d22eaf19e1d76 (diff)
downloadklee-9767a37f9e8a743fa81629510346cb0a5a3a7900.tar.gz
drop support for LLVM <= 3.7
Diffstat (limited to 'scripts/build')
-rw-r--r--scripts/build/p-clang-linux-ubuntu-16.04.inc4
-rw-r--r--scripts/build/p-llvm-linux-ubuntu-16.04.inc7
-rw-r--r--scripts/build/p-llvm.inc170
-rw-r--r--scripts/build/patches/llvm35.patch14
-rw-r--r--scripts/build/patches/llvm36.patch39
-rw-r--r--scripts/build/v-libcxx.inc8
-rw-r--r--scripts/build/v-uclibc.inc9
7 files changed, 58 insertions, 193 deletions
diff --git a/scripts/build/p-clang-linux-ubuntu-16.04.inc b/scripts/build/p-clang-linux-ubuntu-16.04.inc
index 5e140f5d..0fb30e52 100644
--- a/scripts/build/p-clang-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-clang-linux-ubuntu-16.04.inc
@@ -2,10 +2,6 @@ install_binary_artifact_clang() {
   local LLVM_VERSION_MAJOR="${LLVM_VERSION/.*/}"
   local LLVM_VERSION_MINOR="${LLVM_VERSION/*./}"
 
-  # Check versions: no support for LLVM < 3.5
-  [[ "${LLVM_VERSION_MAJOR}" -eq 3 ]] && [[ "${LLVM_VERSION_MINOR}" -lt 5 ]] && return 1
-
-
   local version=""
   [[ "${LLVM_VERSION_MAJOR}" -le 6 ]] && version="-${LLVM_VERSION}"
   [[ "${LLVM_VERSION_MAJOR}" -ge 7 ]] && version="-${LLVM_VERSION_MAJOR}"
diff --git a/scripts/build/p-llvm-linux-ubuntu-16.04.inc b/scripts/build/p-llvm-linux-ubuntu-16.04.inc
index 6bfc3105..bab32d45 100644
--- a/scripts/build/p-llvm-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-llvm-linux-ubuntu-16.04.inc
@@ -44,11 +44,6 @@ install_binary_artifact_llvm() {
 
   # Enable/Disable optimized does not matter
   
-  # Check versions: no support for LLVM < 3.8
-  if [[ "${LLVM_VERSION_MAJOR}" -eq 3 ]]; then
-    [[ "${LLVM_VERSION_MINOR}" -lt 8 ]] && return 1
-  fi
-  
   # Add certificate
   apt update -y
   dependencies=(
@@ -95,4 +90,4 @@ is_installed_llvm() {
     # Check requested mode with mode of the found item  
     [[ $(to_bool "${REQUIRES_RTTI}") -eq $(to_bool "${rtti}") ]] || return 1
     [[ $(to_bool "${DISABLE_ASSERTIONS}") -ne $(to_bool "${assertion}") ]] || return 1
-}
\ No newline at end of file
+}
diff --git a/scripts/build/p-llvm.inc b/scripts/build/p-llvm.inc
index 4e0740a2..43be3399 100644
--- a/scripts/build/p-llvm.inc
+++ b/scripts/build/p-llvm.inc
@@ -46,12 +46,7 @@ setup_build_variables_llvm() {
     LLVM_BUILD="${LLVM_SRC_BASE}-build${LLVM_SUFFIX}"
     LLVM_INSTALL="${LLVM_SRC_BASE}-install${LLVM_SUFFIX}"
     LLVM_BIN="${LLVM_INSTALL}/bin"
-    if [[ ${LLVM_VERSION_SHORT} -le 37 ]]; then
-      LLVM_BUILDMODE="$BuildMode"
-      LLVM_BUILD_BIN="${LLVM_BUILD}/${LLVM_BUILDMODE}/bin"
-    else
-      LLVM_BUILD_BIN="${LLVM_BUILD}/bin"
-    fi
+    LLVM_BUILD_BIN="${LLVM_BUILD}/bin"
 
     LLVM_CONFIG="${LLVM_BIN}/llvm-config"
     BITCODE_CC="${LLVM_BIN}/clang"
@@ -104,13 +99,10 @@ download_llvm() {
   svn co "http://llvm.org/svn/llvm-project/cfe/branches/release_${LLVM_VERSION_SHORT}" clang
   cd "${LLVM_SRC_BASE}/projects" || (echo "Directory does not exist"; exit 1)
   svn co "http://llvm.org/svn/llvm-project/compiler-rt/branches/release_${LLVM_VERSION_SHORT}" compiler-rt
-
-  if [[ ${LLVM_VERSION_SHORT} -gt 37 ]]; then
-    cd "${LLVM_SRC_BASE}/projects" || (echo "Directory does not exist"; exit 1)
-    svn co "http://llvm.org/svn/llvm-project/libcxx/branches/release_${LLVM_VERSION_SHORT}" libcxx
-    cd "${LLVM_SRC_BASE}/projects" || (echo "Directory does not exist"; exit 1)
-    svn co "http://llvm.org/svn/llvm-project/libcxxabi/branches/release_${LLVM_VERSION_SHORT}" libcxxabi
-  fi
+  cd "${LLVM_SRC_BASE}/projects" || (echo "Directory does not exist"; exit 1)
+  svn co "http://llvm.org/svn/llvm-project/libcxx/branches/release_${LLVM_VERSION_SHORT}" libcxx
+  cd "${LLVM_SRC_BASE}/projects" || (echo "Directory does not exist"; exit 1)
+  svn co "http://llvm.org/svn/llvm-project/libcxxabi/branches/release_${LLVM_VERSION_SHORT}" libcxxabi
 
   # Apply existing patches if needed
   if [ -f "${DIR}/patches/llvm${LLVM_VERSION_SHORT}.patch" ]; then
@@ -129,10 +121,6 @@ build_llvm() {
 
     # For memory sanitizer, we have a multi-stage build process
     if [[ "${SANITIZER_BUILD}" == "memory" ]]; then
-       if [[ ${LLVM_VERSION_SHORT} -le 37 ]]; then
-         echo "Memory sanitizer builds for <= LLVM 3.7 are not supported"
-         exit 1
-       fi
        # Build uninstrumented compiler
        mkdir -p "${SANITIZER_LLVM_UNINSTRUMENTED}"
        cd "${SANITIZER_LLVM_UNINSTRUMENTED}"
@@ -181,114 +169,66 @@ build_llvm() {
 
 
   # Configure LLVM
-  if [[ ${LLVM_VERSION_SHORT} -le 37 ]]; then
-    local CONFIG=("--enable-jit" "--prefix=${LLVM_INSTALL}")
-    if [[ "${enable_optimized}" == "1" ]]; then
-      CONFIG+=(--enable-optimized)
-    else
-      CONFIG+=(--disable-optimized)
-    fi
-
-    if [[ "${disable_assertions}" == "1" ]]; then
-      CONFIG+=(--disable-assertions)
-    else
-      CONFIG+=(--enable-assertions)
-    fi
-
-    if [[ "${enable_debug}" == "1" ]]; then
-      CONFIG+=(--enable-debug-runtime --enable-debug-symbols)
-    else
-      CONFIG+=(--disable-debug-symbols)
-    fi
-
-    local variables=()
-    if [[ -n "${CC:-}" ]]; then
-        variables+=("CC=${CC}")
-    fi
-
-    if [[ -n "${CXX:-}" ]]; then
-        variables+=("CXX=${CXX}")
-    fi
-
-    if [[ -n "${LDFLAGS:-}" ]]; then
-        variables+=("LDFLAGS=${LLVM_LDFLAGS}")
-    fi
-
-    if [[ -n "${LLVM_CFLAGS:-}" ]]; then
-        variables+=("CFLAGS=${LLVM_CFLAGS}")
-    fi
-
-    if [[ -n "${LLVM_CXXFLAGS:-}" ]]; then
-        variables+=("CXXFLAGS=${LLVM_CXXFLAGS}")
-    fi
-
-    if [[ -n "${LLVM_LDFLAGS:-}" ]]; then
-        variables+=("LDFLAGS=${LLVM_LDFLAGS}")
-    fi
-    ${variables[@]+"${variables[@]}"} "${LLVM_SRC_BASE}/configure" "${CONFIG[@]}"
+  CONFIG=(
+     "-DCMAKE_INSTALL_PREFIX=${LLVM_INSTALL}"
+     "-LLVM_BUILD_LLVM_DYLIB=TRUE"
+  )
+  # cmake build
+  if [[ "${enable_optimized}" == "1" && "${enable_debug}" != "1" ]]; then
+    CONFIG+=("-DCMAKE_BUILD_TYPE=Release")
+  fi
+  if [[ "${enable_optimized}" == "1" && "${enable_debug}" == "1" ]]; then
+    CONFIG+=("-DCMAKE_BUILD_TYPE=RelWithDebInfo")
+  fi
+  if [[ "${enable_optimized}" != "1" && "${enable_debug}" == "1" ]]; then
+    CONFIG+=("-DCMAKE_BUILD_TYPE=Debug")
+  fi
 
+  if [[ "${disable_assertions}" == "1" ]]; then
+    CONFIG+=("-DLLVM_ENABLE_ASSERTIONS=Off")
   else
-    CONFIG=(
-        "-DCMAKE_INSTALL_PREFIX=${LLVM_INSTALL}"
-        "-LLVM_BUILD_LLVM_DYLIB=TRUE"
-    )
-    # cmake build
-    if [[ "${enable_optimized}" == "1" && "${enable_debug}" != "1" ]]; then
-      CONFIG+=("-DCMAKE_BUILD_TYPE=Release")
-    fi
-    if [[ "${enable_optimized}" == "1" && "${enable_debug}" == "1" ]]; then
-      CONFIG+=("-DCMAKE_BUILD_TYPE=RelWithDebInfo")
-    fi
-    if [[ "${enable_optimized}" != "1" && "${enable_debug}" == "1" ]]; then
-      CONFIG+=("-DCMAKE_BUILD_TYPE=Debug")
-    fi
-
-    if [[ "${disable_assertions}" == "1" ]]; then
-      CONFIG+=("-DLLVM_ENABLE_ASSERTIONS=Off")
-    else
-      CONFIG+=("-DLLVM_ENABLE_ASSERTIONS=On")
-    fi
+    CONFIG+=("-DLLVM_ENABLE_ASSERTIONS=On")
+  fi
 
-    if [[ -n "${LLVM_CFLAGS:-}" ]]; then
-      CONFIG+=("-DCMAKE_C_FLAGS=\"$LLVM_CFLAGS\"")
-    fi
+  if [[ -n "${LLVM_CFLAGS:-}" ]]; then
+    CONFIG+=("-DCMAKE_C_FLAGS=\"$LLVM_CFLAGS\"")
+  fi
 
-    if [[ -n "${LLVM_CXXFLAGS:-}" ]]; then
-      CONFIG+=("-DCMAKE_CXX_FLAGS=\"$LLVM_CXXFLAGS\"")
-    fi
+  if [[ -n "${LLVM_CXXFLAGS:-}" ]]; then
+    CONFIG+=("-DCMAKE_CXX_FLAGS=\"$LLVM_CXXFLAGS\"")
+  fi
 
-    if [[ "${requires_rtti}" -eq 1 ]]; then
-      CONFIG+=("-DLLVM_ENABLE_RTTI=TRUE")
-    fi
+  if [[ "${requires_rtti}" -eq 1 ]]; then
+    CONFIG+=("-DLLVM_ENABLE_RTTI=TRUE")
+  fi
 
-    # Remove unneeded targets
-    CONFIG+=(
-       -DLLVM_INCLUDE_EXAMPLES=OFF
-#       -DLLVM_INCLUDE_TESTS=OFF
-#       -DCLANG_INCLUDE_TESTS=OFF
-       -DLLVM_INCLUDE_BENCHMARKS=OFF
-       -DBUILD_SHARED_LIBS=ON
-    )
+  # Remove unneeded targets
+  CONFIG+=(
+     -DLLVM_INCLUDE_EXAMPLES=OFF
+#     -DLLVM_INCLUDE_TESTS=OFF
+#     -DCLANG_INCLUDE_TESTS=OFF
+     -DLLVM_INCLUDE_BENCHMARKS=OFF
+     -DBUILD_SHARED_LIBS=ON
+  )
 
-    local variables=("")
+  local variables=("")
 
-    if [[ -n "${CC:-}" ]]; then
-        variables+=("CC=${CC}")
-    fi
+  if [[ -n "${CC:-}" ]]; then
+    variables+=("CC=${CC}")
+  fi
 
-    if [[ -n "${CXX:-}" ]]; then
-        variables+=("CXX=${CXX}")
-    fi
+  if [[ -n "${CXX:-}" ]]; then
+    variables+=("CXX=${CXX}")
+  fi
 
-    if [[ -n "${LDFLAGS:-}" ]]; then
-        variables+=("LDFLAGS=${LLVM_LDFLAGS}")
-    fi
+  if [[ -n "${LDFLAGS:-}" ]]; then
+    variables+=("LDFLAGS=${LLVM_LDFLAGS}")
+  fi
 
-    if [[ -n "${variables[*]}" ]]; then
-      "${variables[*]}" cmake "${CONFIG[@]}" "${LLVM_SRC_BASE}"
-    else
-      cmake "${CONFIG[@]}" "${LLVM_SRC_BASE}"
-    fi
+  if [[ -n "${variables[*]}" ]]; then
+    "${variables[*]}" cmake "${CONFIG[@]}" "${LLVM_SRC_BASE}"
+  else
+    cmake "${CONFIG[@]}" "${LLVM_SRC_BASE}"
   fi
 
   # Linking LLVM can require a lot of memory.
@@ -363,4 +303,4 @@ get_build_artifacts_llvm() {
     [[ "${sanitizer}" == "memory" ]] && echo "${SANITIZER_LLVM_UNINSTRUMENTED}"
     [[ "${sanitizer}" == "memory" ]] && echo "${SANITIZER_LLVM_LIBCXX}"
   )
-}
\ No newline at end of file
+}
diff --git a/scripts/build/patches/llvm35.patch b/scripts/build/patches/llvm35.patch
deleted file mode 100644
index 47744b91..00000000
--- a/scripts/build/patches/llvm35.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-*** include/llvm/ADT/IntrusiveRefCntPtr.h       2014-07-06 00:20:59.000000000 +0200
---- include/llvm/ADT/IntrusiveRefCntPtr_new.h   2016-06-21 10:04:15.610143165 +0200
-***************
-*** 154,159 ****
---- 154,162 ----
-      }
-
-      template <class X>
-+     friend class IntrusiveRefCntPtr;
-+
-+     template <class X>
-      IntrusiveRefCntPtr(IntrusiveRefCntPtr<X>&& S) : Obj(S.get()) {
-        S.Obj = 0;
-      }
diff --git a/scripts/build/patches/llvm36.patch b/scripts/build/patches/llvm36.patch
deleted file mode 100644
index b5b84b09..00000000
--- a/scripts/build/patches/llvm36.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff --git include/llvm/IR/ValueMap.h include/llvm/IR/ValueMap.h
-index f2ea405f..a1ab2a50 100644
---- include/llvm/IR/ValueMap.h
-+++ include/llvm/IR/ValueMap.h
-@@ -104 +104 @@ public:
--  bool hasMD() const { return MDMap; }
-+  bool hasMD() const { return bool(MDMap); }
-diff --git projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
-index 0e776b90..5088f2d0 100644
---- projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
-+++ projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
-@@ -588,2 +588 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
--uptr internal_sigaltstack(const struct sigaltstack *ss,
--                         struct sigaltstack *oss) {
-+uptr internal_sigaltstack(const void *ss, void *oss) {
-diff --git projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.h projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
-index 3013c25f..d7d4db89 100644
---- projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
-+++ projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
-@@ -23 +22,0 @@ struct link_map;  // Opaque type returned by dlopen().
--struct sigaltstack;
-@@ -32,2 +31 @@ uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
--uptr internal_sigaltstack(const struct sigaltstack* ss,
--                          struct sigaltstack* oss);
-+uptr internal_sigaltstack(const void* ss, void* oss);
-diff --git projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-index d20b5248..33894054 100644
---- projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-+++ projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-@@ -239 +239 @@ static int TracerThread(void* argument) {
--  struct sigaltstack handler_stack;
-+  stack_t handler_stack;
-diff --git projects/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc projects/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc
-index 4dcfa558..8ce75be1 100644
---- projects/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc
-+++ projects/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc
-@@ -358 +358 @@ int ExtractResolvFDs(void *state, int *fds, int nfd) {
--  __res_state *statp = (__res_state*)state;
-+  struct __res_state *statp = (struct __res_state*)state;
diff --git a/scripts/build/v-libcxx.inc b/scripts/build/v-libcxx.inc
index 669bb536..147b4db4 100644
--- a/scripts/build/v-libcxx.inc
+++ b/scripts/build/v-libcxx.inc
@@ -3,15 +3,9 @@ required_variables_libcxx=(
 )
 
 required_variables_check_libcxx() {
-  local LLVM_VERSION_MAJOR="${LLVM_VERSION/.*/}"
-  local LLVM_VERSION_MINOR="${LLVM_VERSION/*./}"
-  # Check versions: no support for LLVM < 3.8
-#  if [[ "${LLVM_VERSION_MAJOR}" -eq 3 ]]; then
-#    [[ "${LLVM_VERSION_MINOR}" -lt 8 ]] && { echo "Version <= 3.7 not supported"; return 1; }
-#  fi
   return 0
 }
 
 artifact_dependency_libcxx(){
   echo "clang"
-}
\ No newline at end of file
+}
diff --git a/scripts/build/v-uclibc.inc b/scripts/build/v-uclibc.inc
index e7a2f720..7cdedfcd 100644
--- a/scripts/build/v-uclibc.inc
+++ b/scripts/build/v-uclibc.inc
@@ -6,12 +6,5 @@ required_variables_uclibc=(
 artifact_dependency_uclibc(){
   # Add llvm if needed; otherwise only use clang package
 # TODO this is quite distribution specific; should be handled in a more general case
-  local LLVM_VERSION_MAJOR="${LLVM_VERSION/.*/}"
-  local LLVM_VERSION_MINOR="${LLVM_VERSION/*./}"
-  # Check versions: no support for LLVM < 3.5
-  if [[ "${LLVM_VERSION_MAJOR}" -eq 3 ]]; then
-    [[ "${LLVM_VERSION_MINOR}" -lt 5 ]] && echo "llvm"
-  fi
-
   echo "clang"
-}
\ No newline at end of file
+}