about summary refs log tree commit diff homepage
path: root/scripts
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2020-01-23 15:29:24 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-02-13 17:39:21 +0000
commit1eddf2d847d609df991859625571e2abf96fe580 (patch)
treef77c234412c990a56d815558621428d8fd7082ad /scripts
parent2e8d6aed747a988871b6836012301708950a74ef (diff)
downloadklee-1eddf2d847d609df991859625571e2abf96fe580.tar.gz
Add patch support for libcxx
Building older LLVM/libcxx versions under Ubuntu 18.04 requirer patches
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/p-libcxx.inc8
-rw-r--r--scripts/build/patches/libcxx38.patch11
-rw-r--r--scripts/build/patches/libcxx39.patch11
-rw-r--r--scripts/build/patches/libcxx40.patch11
4 files changed, 40 insertions, 1 deletions
diff --git a/scripts/build/p-libcxx.inc b/scripts/build/p-libcxx.inc
index 41ca4cc4..f803080a 100644
--- a/scripts/build/p-libcxx.inc
+++ b/scripts/build/p-libcxx.inc
@@ -17,7 +17,13 @@ download_libcxx() {
 
 
   git clone --single-branch --branch "${version}" --depth 1 "https://github.com/llvm/llvm-project.git" "${LIBCXX_SRC}"
-  
+
+  # Apply existing patches if needed
+  if [ -f "${DIR}/patches/libcxx${LLVM_VERSION_SHORT}.patch" ]; then
+     cd "${LIBCXX_SRC}" || (echo "Directory does not exist"; exit 1)
+     patch -p1 --follow-symlinks -i "${DIR}/patches/libcxx${LLVM_VERSION_SHORT}.patch" || return 1
+  fi
+
   # Prepare LLVM subprojects for older LLVM versions
   cd "${LIBCXX_SRC}/llvm/projects"
   ln -s ../../libcxx .
diff --git a/scripts/build/patches/libcxx38.patch b/scripts/build/patches/libcxx38.patch
new file mode 100644
index 00000000..382db544
--- /dev/null
+++ b/scripts/build/patches/libcxx38.patch
@@ -0,0 +1,11 @@
+--- 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)
diff --git a/scripts/build/patches/libcxx39.patch b/scripts/build/patches/libcxx39.patch
new file mode 100644
index 00000000..382db544
--- /dev/null
+++ b/scripts/build/patches/libcxx39.patch
@@ -0,0 +1,11 @@
+--- 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)
diff --git a/scripts/build/patches/libcxx40.patch b/scripts/build/patches/libcxx40.patch
new file mode 100644
index 00000000..382db544
--- /dev/null
+++ b/scripts/build/patches/libcxx40.patch
@@ -0,0 +1,11 @@
+--- 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)