Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 641438 | Differences between
and this patch

Collapse All | Expand All

(-)a/sys-libs/compiler-rt/compiler-rt-5.0.1.ebuild (-1 / +8 lines)
Lines 17-23 SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz" Link Here
17
LICENSE="|| ( UoI-NCSA MIT )"
17
LICENSE="|| ( UoI-NCSA MIT )"
18
SLOT="${PV%_*}"
18
SLOT="${PV%_*}"
19
KEYWORDS="amd64 ~arm64 ~x86 ~ppc-macos ~x64-macos ~x86-macos"
19
KEYWORDS="amd64 ~arm64 ~x86 ~ppc-macos ~x64-macos ~x86-macos"
20
IUSE="+clang test"
20
IUSE="+clang pax_kernel test"
21
21
22
LLVM_SLOT=${SLOT%%.*}
22
LLVM_SLOT=${SLOT%%.*}
23
# llvm-4 needed for --cmakedir
23
# llvm-4 needed for --cmakedir
Lines 25-30 DEPEND=" Link Here
25
	>=sys-devel/llvm-4
25
	>=sys-devel/llvm-4
26
	clang? ( sys-devel/clang )
26
	clang? ( sys-devel/clang )
27
	test? (
27
	test? (
28
		pax_kernel? ( sys-apps/elfix )
28
		$(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
29
		$(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
29
		=sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
30
		=sys-devel/clang-${PV%_*}*:${LLVM_SLOT} )
30
	${PYTHON_DEPS}"
31
	${PYTHON_DEPS}"
Lines 51-56 test_compiler() { Link Here
51
		<<<'int main() { return 0; }' &>/dev/null
52
		<<<'int main() { return 0; }' &>/dev/null
52
}
53
}
53
54
55
src_prepare() {
56
	default
57
	# Bug #641438
58
	use pax_kernel && eapply "${FILESDIR}/${P}-PaX-mark-tests-which-need-it.patch"
59
}
60
54
src_configure() {
61
src_configure() {
55
	# pre-set since we need to pass it to cmake
62
	# pre-set since we need to pass it to cmake
56
	BUILD_DIR=${WORKDIR}/${P}_build
63
	BUILD_DIR=${WORKDIR}/${P}_build
(-)a/sys-libs/compiler-rt/files/compiler-rt-5.0.1-PaX-mark-tests-which-need-it.patch (+42 lines)
Line 0 Link Here
1
Subject: [PATCH] PaX mark tests which need it
2
3
The tests
4
5
* test/builtins/Unit/enable_execute_stack_test
6
* test/builtins/Unit/clear_cache_test and
7
8
fail on a PAX hardened kernel due to MPROTECT. Disabling MPROTECT (-m) lets the
9
tests succeed.
10
11
To mark the tests use paxmark.sh which is part of the elfix package.
12
13
This failure is known as Gentoo bug #641438 [0].
14
15
[0] https://bugs.gentoo.org/641438
16
---
17
 test/builtins/Unit/clear_cache_test.c          | 2 +-
18
 test/builtins/Unit/enable_execute_stack_test.c | 2 +-
19
 2 files changed, 2 insertions(+), 2 deletions(-)
20
21
diff --git a/test/builtins/Unit/clear_cache_test.c b/test/builtins/Unit/clear_cache_test.c
22
--- a/test/builtins/Unit/clear_cache_test.c
23
+++ b/test/builtins/Unit/clear_cache_test.c
24
@@ -1,6 +1,6 @@
25
 // REQUIRES: native-run
26
 // UNSUPPORTED: arm, aarch64
27
-// RUN: %clang_builtins %s %librt -o %t && %run %t
28
+// RUN: %clang_builtins %s %librt -o %t && paxmark.sh -m %t && %run %t
29
 //===-- clear_cache_test.c - Test clear_cache -----------------------------===//
30
 //
31
 //                     The LLVM Compiler Infrastructure
32
diff --git a/test/builtins/Unit/enable_execute_stack_test.c b/test/builtins/Unit/enable_execute_stack_test.c
33
--- a/test/builtins/Unit/enable_execute_stack_test.c
34
+++ b/test/builtins/Unit/enable_execute_stack_test.c
35
@@ -1,5 +1,5 @@
36
 // REQUIRES: native-run
37
-// RUN: %clang_builtins %s %librt -o %t && %run %t
38
+// RUN: %clang_builtins %s %librt -o %t && paxmark.sh -m %t && %run %t
39
 //===-- enable_execute_stack_test.c - Test __enable_execute_stack ----------===//
40
 //
41
 //                     The LLVM Compiler Infrastructure
42
(-)a/sys-libs/compiler-rt/metadata.xml (+2 lines)
Lines 7-11 Link Here
7
	<use>
7
	<use>
8
		<flag name='clang'>Force building using installed clang (rather
8
		<flag name='clang'>Force building using installed clang (rather
9
			than the default CC/CXX).</flag>
9
			than the default CC/CXX).</flag>
10
		<flag name='pax_kernel'>Paxmark test-suite executables that
11
			require it.</flag>
10
	</use>
12
	</use>
11
</pkgmetadata>
13
</pkgmetadata>

Return to bug 641438