sys-devel/llvm: Readd WX stack fix to 3.9.0
authorMichał Górny <mgorny@gentoo.org>
Sat, 3 Sep 2016 14:46:49 +0000 (16:46 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sat, 3 Sep 2016 17:35:30 +0000 (19:35 +0200)
sys-devel/llvm/llvm-3.9.0.ebuild

index ed79ebb12ee101fb52bd914b650468731f2127ac..3752c6d98e946466e64ac9e28cae2e583da2e7da 100644 (file)
@@ -202,6 +202,15 @@ src_prepare() {
 
                # Fix git-clang-format shebang, bug #562688
                python_fix_shebang tools/clang/tools/clang-format/git-clang-format
+
+               pushd projects/compiler-rt >/dev/null || die
+
+               # Fix WX sections, bug #421527
+               find lib/builtins -type f -name '*.S' -exec sed \
+                       -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
+                       -i {} + || die
+
+               popd >/dev/null || die
        fi
 
        if use lldb; then