aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisthios <justwesley@protonmail.com>2021-09-20 15:17:56 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2021-10-18 13:38:04 +0000
commit465f78497140cc574a9e2a6657fd32d6be57985d (patch)
treef8cc76a2e71fb99096c350e9961dc59549ad74c7
parentec8acb1e374c3f2c4eb179bc448f44c740d54af2 (diff)
downloadaports-465f78497140cc574a9e2a6657fd32d6be57985d.tar.gz
aports-465f78497140cc574a9e2a6657fd32d6be57985d.tar.bz2
aports-465f78497140cc574a9e2a6657fd32d6be57985d.tar.xz
main/compiler-rt: upgrade to 12.0.1
-rw-r--r--main/compiler-rt/APKBUILD13
-rw-r--r--main/compiler-rt/disable-sanitizer-common.patch12
-rw-r--r--main/compiler-rt/replace-size_t-std-size-t.patch139
3 files changed, 160 insertions, 4 deletions
diff --git a/main/compiler-rt/APKBUILD b/main/compiler-rt/APKBUILD
index ab8b349e58..bc1c288559 100644
--- a/main/compiler-rt/APKBUILD
+++ b/main/compiler-rt/APKBUILD
@@ -3,7 +3,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=compiler-rt
# Note: Update together with llvm.
-pkgver=11.1.0
+pkgver=12.0.1
pkgrel=1
_llvmver=${pkgver%%.*}
pkgdesc="LLVM compiler-rt runtime libraries"
@@ -23,7 +23,10 @@ checkdepends="gtest-dev llvm-test-utils>=$_llvmver"
subpackages="$pkgname-static"
options="!check" # Doesn't seem to work with linux ld: /lib/ld-musl-x86_64.so.1: cannot load --version: No such file or directory
source="https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/compiler-rt-$pkgver.src.tar.xz
- https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/llvm-$pkgver.src.tar.xz"
+ https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/llvm-$pkgver.src.tar.xz
+ disable-sanitizer-common.patch
+ replace-size_t-std-size-t.patch"
+
builddir="$srcdir/$pkgname-$pkgver.src"
build() {
@@ -72,5 +75,7 @@ package() {
esac
}
-sha512sums="9b0b259cc43d5e4d20200676be153de81b485b3fdf065623ff71c7e1894ec5c8ed9d99c1416f70246ab0f417cbba6d1d4af9f3769e2e6577400681a791346231 compiler-rt-11.1.0.src.tar.xz
-07bf9973384151a18d5cc2892103e5f28a88c632e8e49662fde56d123632f2ed1b3710fa7a87b6b821955d0ec44160ff36f2aa4f233e389e14d628e9bf8dc764 llvm-11.1.0.src.tar.xz"
+sha512sums="708780aa47ef289a9700eb76c17cc1f3bab19b8245174e612b5f684c48448030263a72eeef1021b10bdffa6ace2df489adcbba9e7a790ccbcd5fe72056f63f92 compiler-rt-12.0.1.src.tar.xz
+ff674afb4c8eea699a4756f1bb463f15098a7fa354c733de83c024f8f0cf238cd5f19ae3ec446831c7109235e293e2bf31d8562567ede163c8ec53af7306ba0f llvm-12.0.1.src.tar.xz
+b099dac8ab1da41a3bd12df1ceb2ff6a46e41a82db31f3444fdca1de1e0565131a612cd375e721f894a7da2df1a90a99b53c983b45914d18a8ee6f99a3ec563f disable-sanitizer-common.patch
+78181b4ea227f30c1c06d12059cf0746bd0ed430f5e2e9752eaa4d59bebc7ee5e3a78df167ff0fdf68562609e5f3ee8ab8a10fa76f42c9f0d5a6836853add6e7 replace-size_t-std-size-t.patch"
diff --git a/main/compiler-rt/disable-sanitizer-common.patch b/main/compiler-rt/disable-sanitizer-common.patch
new file mode 100644
index 0000000000..0036c3acc0
--- /dev/null
+++ b/main/compiler-rt/disable-sanitizer-common.patch
@@ -0,0 +1,12 @@
+Sanitizer code appears broken on arm and 32bit x86
+--- a/cmake/config-ix.cmake
++++ b/cmake/config-ix.cmake
+@@ -649,7 +649,7 @@
+ (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD|NetBSD|Fuchsia|SunOS" OR
+ (OS_NAME MATCHES "Windows" AND NOT CYGWIN AND
+ (NOT MINGW OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"))))
+- set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)
++ set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)
+ else()
+ set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)
+ endif()
diff --git a/main/compiler-rt/replace-size_t-std-size-t.patch b/main/compiler-rt/replace-size_t-std-size-t.patch
new file mode 100644
index 0000000000..d18d91fb9f
--- /dev/null
+++ b/main/compiler-rt/replace-size_t-std-size-t.patch
@@ -0,0 +1,139 @@
+--- a/lib/fuzzer/FuzzerInterceptors.cpp
++++ b/lib/fuzzer/FuzzerInterceptors.cpp
+@@ -59,8 +59,8 @@
+ }
+
+ static int internal_strcmp_strncmp(const char *s1, const char *s2, bool strncmp,
+- size_t n) {
+- size_t i = 0;
++ std::size_t n) {
++ std::size_t i = 0;
+ while (true) {
+ if (strncmp) {
+ if (i == n)
+@@ -79,7 +79,7 @@
+ return 0;
+ }
+
+-static int internal_strncmp(const char *s1, const char *s2, size_t n) {
++static int internal_strncmp(const char *s1, const char *s2, std::size_t n) {
+ return internal_strcmp_strncmp(s1, s2, true, n);
+ }
+
+@@ -87,17 +87,17 @@
+ return internal_strcmp_strncmp(s1, s2, false, 0);
+ }
+
+-static int internal_memcmp(const void *s1, const void *s2, size_t n) {
++static int internal_memcmp(const void *s1, const void *s2, std::size_t n) {
+ const uint8_t *t1 = static_cast<const uint8_t *>(s1);
+ const uint8_t *t2 = static_cast<const uint8_t *>(s2);
+- for (size_t i = 0; i < n; ++i, ++t1, ++t2)
++ for (std::size_t i = 0; i < n; ++i, ++t1, ++t2)
+ if (*t1 != *t2)
+ return *t1 < *t2 ? -1 : 1;
+ return 0;
+ }
+
+-static size_t internal_strlen(const char *s) {
+- size_t i = 0;
++static std::size_t internal_strlen(const char *s) {
++ std::size_t i = 0;
+ while (s[i])
+ i++;
+ return i;
+@@ -105,11 +105,11 @@
+
+ static char *internal_strstr(const char *haystack, const char *needle) {
+ // This is O(N^2), but we are not using it in hot places.
+- size_t len1 = internal_strlen(haystack);
+- size_t len2 = internal_strlen(needle);
++ std::size_t len1 = internal_strlen(haystack);
++ std::size_t len2 = internal_strlen(needle);
+ if (len1 < len2)
+ return nullptr;
+- for (size_t pos = 0; pos <= len1 - len2; pos++) {
++ for (std::size_t pos = 0; pos <= len1 - len2; pos++) {
+ if (internal_memcmp(haystack + pos, needle, len2) == 0)
+ return const_cast<char *>(haystack) + pos;
+ }
+@@ -121,11 +121,11 @@
+ // Weak hooks forward-declared to avoid dependency on
+ // <sanitizer/common_interface_defs.h>.
+ void __sanitizer_weak_hook_memcmp(void *called_pc, const void *s1,
+- const void *s2, size_t n, int result);
++ const void *s2, std::size_t n, int result);
+ void __sanitizer_weak_hook_strncmp(void *called_pc, const char *s1,
+- const char *s2, size_t n, int result);
++ const char *s2, std::size_t n, int result);
+ void __sanitizer_weak_hook_strncasecmp(void *called_pc, const char *s1,
+- const char *s2, size_t n, int result);
++ const char *s2, std::size_t n, int result);
+ void __sanitizer_weak_hook_strcmp(void *called_pc, const char *s1,
+ const char *s2, int result);
+ void __sanitizer_weak_hook_strcasecmp(void *called_pc, const char *s1,
+@@ -134,20 +134,20 @@
+ const char *s2, char *result);
+ void __sanitizer_weak_hook_strcasestr(void *called_pc, const char *s1,
+ const char *s2, char *result);
+-void __sanitizer_weak_hook_memmem(void *called_pc, const void *s1, size_t len1,
+- const void *s2, size_t len2, void *result);
++void __sanitizer_weak_hook_memmem(void *called_pc, const void *s1, std::size_t len1,
++ const void *s2, std::size_t len2, void *result);
+
+-DEFINE_REAL(int, bcmp, const void *, const void *, size_t)
+-DEFINE_REAL(int, memcmp, const void *, const void *, size_t)
+-DEFINE_REAL(int, strncmp, const char *, const char *, size_t)
++DEFINE_REAL(int, bcmp, const void *, const void *, std::size_t)
++DEFINE_REAL(int, memcmp, const void *, const void *, std::size_t)
++DEFINE_REAL(int, strncmp, const char *, const char *, std::size_t)
+ DEFINE_REAL(int, strcmp, const char *, const char *)
+-DEFINE_REAL(int, strncasecmp, const char *, const char *, size_t)
++DEFINE_REAL(int, strncasecmp, const char *, const char *, std::size_t)
+ DEFINE_REAL(int, strcasecmp, const char *, const char *)
+ DEFINE_REAL(char *, strstr, const char *, const char *)
+ DEFINE_REAL(char *, strcasestr, const char *, const char *)
+-DEFINE_REAL(void *, memmem, const void *, size_t, const void *, size_t)
++DEFINE_REAL(void *, memmem, const void *, std::size_t, const void *, std::size_t)
+
+-ATTRIBUTE_INTERFACE int bcmp(const char *s1, const char *s2, size_t n) {
++ATTRIBUTE_INTERFACE int bcmp(const char *s1, const char *s2, std::size_t n) {
+ if (!FuzzerInited)
+ return internal_memcmp(s1, s2, n);
+ int result = REAL(bcmp)(s1, s2, n);
+@@ -155,7 +155,7 @@
+ return result;
+ }
+
+-ATTRIBUTE_INTERFACE int memcmp(const void *s1, const void *s2, size_t n) {
++ATTRIBUTE_INTERFACE int memcmp(const void *s1, const void *s2, std::size_t n) {
+ if (!FuzzerInited)
+ return internal_memcmp(s1, s2, n);
+ int result = REAL(memcmp)(s1, s2, n);
+@@ -163,7 +163,7 @@
+ return result;
+ }
+
+-ATTRIBUTE_INTERFACE int strncmp(const char *s1, const char *s2, size_t n) {
++ATTRIBUTE_INTERFACE int strncmp(const char *s1, const char *s2, std::size_t n) {
+ if (!FuzzerInited)
+ return internal_strncmp(s1, s2, n);
+ int result = REAL(strncmp)(s1, s2, n);
+@@ -179,7 +179,7 @@
+ return result;
+ }
+
+-ATTRIBUTE_INTERFACE int strncasecmp(const char *s1, const char *s2, size_t n) {
++ATTRIBUTE_INTERFACE int strncasecmp(const char *s1, const char *s2, std::size_t n) {
+ ensureFuzzerInited();
+ int result = REAL(strncasecmp)(s1, s2, n);
+ __sanitizer_weak_hook_strncasecmp(GET_CALLER_PC(), s1, s2, n, result);
+@@ -209,7 +209,7 @@
+ }
+
+ ATTRIBUTE_INTERFACE
+-void *memmem(const void *s1, size_t len1, const void *s2, size_t len2) {
++void *memmem(const void *s1, std::size_t len1, const void *s2, std::size_t len2) {
+ ensureFuzzerInited();
+ void *result = REAL(memmem)(s1, len1, s2, len2);
+ __sanitizer_weak_hook_memmem(GET_CALLER_PC(), s1, len1, s2, len2, result);