Skip to content

Commit 7f35109

Browse files
authored
Build LLVM compiler-rt by default for toolchain sanitizer support (#716)
* Build compiler-rt by default for sanitizer support when using vcpkg clang * Only build compiler-rt on linux/osx * Fix compiler-rt for llvm-9 on newer glibc versions
1 parent 59f460b commit 7f35109

File tree

6 files changed

+40
-4
lines changed

6 files changed

+40
-4
lines changed

ports/llvm-10/CONTROL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Version: 10.0.1
33
Homepage: https://llvm.org/
44
Description: The LLVM Compiler Infrastructure
55
Supports: !uwp
6-
Build-Depends: llvm-vcpkg-common
6+
Build-Depends: llvm-vcpkg-common, llvm-10[core, compiler-rt] (linux|osx)
77
Default-Features: tools, clang, enable-rtti, enable-z3, enable-eh, enable-assertions, disable-abi-breaking-checks, disable-terminfo, libcxx, libcxxabi, target-aarch64, target-arm, target-nvptx, target-sparc, target-x86
88

99
Feature: tools

ports/llvm-11/CONTROL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Version: 11.0.1
33
Homepage: https://llvm.org/
44
Description: The LLVM Compiler Infrastructure
55
Supports: !uwp
6-
Build-Depends: llvm-vcpkg-common
6+
Build-Depends: llvm-vcpkg-common, llvm-11[core, compiler-rt] (linux|osx)
77
Default-Features: tools, clang, enable-rtti, enable-z3, enable-eh, enable-assertions, disable-abi-breaking-checks, disable-terminfo, libcxx, libcxxabi, target-aarch64, target-arm, target-nvptx, target-sparc, target-x86
88

99
Feature: tools

ports/llvm-12/CONTROL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Version: 12.0.0
33
Homepage: https://llvm.org/
44
Description: The LLVM Compiler Infrastructure
55
Supports: !uwp
6-
Build-Depends: llvm-vcpkg-common
6+
Build-Depends: llvm-vcpkg-common, llvm-12[core, compiler-rt] (linux|osx)
77
Default-Features: tools, clang, enable-rtti, enable-z3, enable-eh, enable-assertions, disable-abi-breaking-checks, disable-terminfo, libcxx, libcxxabi, target-aarch64, target-arm, target-nvptx, target-sparc, target-x86
88

99
Feature: tools
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
2+
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
3+
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
4+
@@ -1126,8 +1126,9 @@
5+
CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
6+
CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
7+
CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
8+
-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
9+
-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
10+
+#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
11+
+/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
12+
+ on many architectures. */
13+
CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
14+
#endif
15+
16+
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
17+
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
18+
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
19+
@@ -214,15 +214,8 @@
20+
unsigned short __seq;
21+
unsigned long long __unused1;
22+
unsigned long long __unused2;
23+
-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
24+
- unsigned int mode;
25+
- unsigned short __seq;
26+
- unsigned short __pad1;
27+
- unsigned long __unused1;
28+
- unsigned long __unused2;
29+
#else
30+
- unsigned short mode;
31+
- unsigned short __pad1;
32+
+ unsigned int mode;
33+
unsigned short __seq;
34+
unsigned short __pad2;
35+
#if defined(__x86_64__) && !defined(_LP64)

ports/llvm-9/CONTROL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Port-Version: 1
44
Homepage: https://llvm.org/
55
Description: The LLVM Compiler Infrastructure
66
Supports: !uwp
7-
Build-Depends: llvm-vcpkg-common
7+
Build-Depends: llvm-vcpkg-common, llvm-9[core, compiler-rt] (linux|osx)
88
Default-Features: tools, clang, enable-rtti, enable-z3, enable-eh, enable-assertions, disable-abi-breaking-checks, disable-terminfo, libcxx, libcxxabi, target-aarch64, target-arm, target-nvptx, target-sparc, target-x86
99

1010
Feature: tools

ports/llvm-9/portfile.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ vcpkg_from_github(
1818
0007-remove-FindZ3.cmake.patch
1919
0008-fix-FindZ3.cmake.patch
2020
0009-clang-sys-include-dir-path.patch
21+
0010-compiler-rt-glibc-2.31.patch
2122
0020-fix-vs2019-v16.6.patch
2223
)
2324

0 commit comments

Comments
 (0)