Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 398182 Details for
Bug 542030
sys-devel/llvm-3.5.0-r99 Failed Patch: llvm-3.5-musl-support.patch on hardened/musl
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
llvm-3.5-musl-path-fix.patch
llvm-3.5-musl-path-fix.patch (text/plain), 16.82 KB, created by
Cato Auestad
on 2015-03-05 17:57:37 UTC
(
hide
)
Description:
llvm-3.5-musl-path-fix.patch
Filename:
MIME Type:
Creator:
Cato Auestad
Created:
2015-03-05 17:57:37 UTC
Size:
16.82 KB
patch
obsolete
>diff --git a/files/llvm-3.5-musl-compiler-rt.patch b/files/llvm-3.5-musl-compiler-rt.patch >index b1646b8..374ec68 100644 >--- a/files/llvm-3.5-musl-compiler-rt.patch >+++ b/files/llvm-3.5-musl-compiler-rt.patch >@@ -1,58 +1,58 @@ >-diff -ur a/llvm-3.5.0.src/projects/compiler-rt/lib/Makefile.mk b/llvm-3.5.0.src/projects/compiler-rt/lib/Makefile.mk >---- a/llvm-3.5.0.src/projects/compiler-rt/lib/Makefile.mk 2014-02-14 10:20:33.000000000 -0100 >-+++ b/llvm-3.5.0.src/projects/compiler-rt/lib/Makefile.mk 2015-01-07 13:56:00.362944069 -0100 >-@@ -10,13 +10,13 @@ >- SubDirs := >- >- # Add submodules. >--SubDirs += asan >-+#SubDirs += asan >- SubDirs += builtins >--SubDirs += dfsan >-+#SubDirs += dfsan >- SubDirs += interception >--SubDirs += lsan >--SubDirs += msan >-+#SubDirs += lsan >-+#SubDirs += msan >- SubDirs += profile >--SubDirs += sanitizer_common >--SubDirs += tsan >--SubDirs += ubsan >-+#SubDirs += sanitizer_common >-+#SubDirs += tsan >-+#SubDirs += ubsan >-diff -ur a/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.cc b/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.cc >---- a/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.cc 2014-02-24 09:37:41.000000000 -0100 >-+++ b/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.cc 2015-01-07 13:56:56.609240893 -0100 >-@@ -24,12 +24,6 @@ >- return real == wrapper; >- } >- >--#if !defined(__ANDROID__) // android does not have dlvsym >--void *GetFuncAddrVer(const char *func_name, const char *ver) { >-- return dlvsym(RTLD_NEXT, func_name, ver); >--} >--#endif // !defined(__ANDROID__) >-- >- } // namespace __interception >- >- >-diff -ur a/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.h b/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.h >---- a/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.h 2014-02-24 09:37:41.000000000 -0100 >-+++ b/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.h 2015-01-07 13:56:41.617428317 -0100 >-@@ -34,14 +34,8 @@ >- (::__interception::uptr) & (func), \ >- (::__interception::uptr) & WRAP(func)) >- >--#if !defined(__ANDROID__) // android does not have dlvsym >--# define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ >-- ::__interception::real_##func = (func##_f)(unsigned long) \ >-- ::__interception::GetFuncAddrVer(#func, symver) >--#else >- # define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ >- INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) >--#endif // !defined(__ANDROID__) >- >- #endif // INTERCEPTION_LINUX_H >- #endif // __linux__ || __FreeBSD__ >+diff -ur a/llvm-3.5.0.src/projects/compiler-rt/lib/Makefile.mk b/llvm-3.5.0.src/projects/compiler-rt/lib/Makefile.mk >+--- a/projects/compiler-rt/lib/Makefile.mk 2014-02-14 10:20:33.000000000 -0100 >++++ b/projects/compiler-rt/lib/Makefile.mk 2015-01-07 13:56:00.362944069 -0100 >+@@ -10,13 +10,13 @@ >+ SubDirs := >+ >+ # Add submodules. >+-SubDirs += asan >++#SubDirs += asan >+ SubDirs += builtins >+-SubDirs += dfsan >++#SubDirs += dfsan >+ SubDirs += interception >+-SubDirs += lsan >+-SubDirs += msan >++#SubDirs += lsan >++#SubDirs += msan >+ SubDirs += profile >+-SubDirs += sanitizer_common >+-SubDirs += tsan >+-SubDirs += ubsan >++#SubDirs += sanitizer_common >++#SubDirs += tsan >++#SubDirs += ubsan >+diff -ur a/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.cc b/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.cc >+--- a/projects/compiler-rt/lib/interception/interception_linux.cc 2014-02-24 09:37:41.000000000 -0100 >++++ b/projects/compiler-rt/lib/interception/interception_linux.cc 2015-01-07 13:56:56.609240893 -0100 >+@@ -24,12 +24,6 @@ >+ return real == wrapper; >+ } >+ >+-#if !defined(__ANDROID__) // android does not have dlvsym >+-void *GetFuncAddrVer(const char *func_name, const char *ver) { >+- return dlvsym(RTLD_NEXT, func_name, ver); >+-} >+-#endif // !defined(__ANDROID__) >+- >+ } // namespace __interception >+ >+ >+diff -ur a/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.h b/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.h >+--- a/projects/compiler-rt/lib/interception/interception_linux.h 2014-02-24 09:37:41.000000000 -0100 >++++ b/projects/compiler-rt/lib/interception/interception_linux.h 2015-01-07 13:56:41.617428317 -0100 >+@@ -34,14 +34,8 @@ >+ (::__interception::uptr) & (func), \ >+ (::__interception::uptr) & WRAP(func)) >+ >+-#if !defined(__ANDROID__) // android does not have dlvsym >+-# define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ >+- ::__interception::real_##func = (func##_f)(unsigned long) \ >+- ::__interception::GetFuncAddrVer(#func, symver) >+-#else >+ # define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \ >+ INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func) >+-#endif // !defined(__ANDROID__) >+ >+ #endif // INTERCEPTION_LINUX_H >+ #endif // __linux__ || __FreeBSD__ > >diff --git a/files/llvm-3.5-musl-support.patch b/files/llvm-3.5-musl-support.patch >index be92809..347d3b7 100644 >--- a/files/llvm-3.5-musl-support.patch >+++ b/files/llvm-3.5-musl-support.patch >@@ -1,124 +1,67 @@ >-adapted from llvm-alpine-linux.patch from Alpine >- >-diff -ru llvm-3.5.0.src.orig/include/llvm/ADT/Triple.h llvm-3.5.0.src/include/llvm/ADT/Triple.h >---- llvm-3.5.0.src.orig/include/llvm/ADT/Triple.h 2014-07-18 17:28:19.000000000 -0300 >-+++ llvm-3.5.0.src/include/llvm/ADT/Triple.h 2014-11-12 14:44:41.738448045 -0200 >-@@ -149,6 +149,10 @@ >- EABIHF, >- Android, >- >-+ Musl, >-+ MuslEABI, >-+ MuslEABIHF, >-+ >- MSVC, >- Itanium, >- Cygnus, >-Only in llvm-3.5.0.src/include/llvm/ADT: Triple.h.orig >-diff -ru llvm-3.5.0.src.orig/lib/Support/Triple.cpp llvm-3.5.0.src/lib/Support/Triple.cpp >---- llvm-3.5.0.src.orig/lib/Support/Triple.cpp 2014-07-18 17:28:19.000000000 -0300 >-+++ llvm-3.5.0.src/lib/Support/Triple.cpp 2014-11-12 14:47:06.565122146 -0200 >-@@ -168,6 +168,9 @@ >- case CODE16: return "code16"; >- case EABI: return "eabi"; >- case EABIHF: return "eabihf"; >-+ case Musl: return "musl"; >-+ case MuslEABI: return "musleabi"; >-+ case MuslEABIHF: return "musleabihf"; >- case Android: return "android"; >- case MSVC: return "msvc"; >- case Itanium: return "itanium"; >-@@ -344,6 +347,9 @@ >- .StartsWith("gnux32", Triple::GNUX32) >- .StartsWith("code16", Triple::CODE16) >- .StartsWith("gnu", Triple::GNU) >-+ .StartsWith("musl", Triple::Musl) >-+ .StartsWith("musleabi", Triple::MuslEABI) >-+ .StartsWith("musleabihf", Triple::MuslEABIHF) >- .StartsWith("android", Triple::Android) >- .StartsWith("msvc", Triple::MSVC) >- .StartsWith("itanium", Triple::Itanium) >-Only in llvm-3.5.0.src/lib/Support: Triple.cpp.orig >-diff -ru llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.cpp llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.cpp >---- llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.cpp 2014-07-16 23:13:31.000000000 -0300 >-+++ llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.cpp 2014-11-12 14:50:40.025133104 -0200 >-@@ -273,6 +273,8 @@ >- case Triple::EABIHF: >- case Triple::GNUEABI: >- case Triple::GNUEABIHF: >-+ case Triple::MuslEABI: >-+ case Triple::MuslEABIHF: >- TargetABI = ARM_ABI_AAPCS; >- break; >- default: >-diff -ru llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.h llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.h >---- llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.h 2014-07-16 23:13:31.000000000 -0300 >-+++ llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.h 2014-11-12 14:53:36.571808822 -0200 >-@@ -372,8 +372,10 @@ >- bool isTargetEHABICompatible() const { >- return (TargetTriple.getEnvironment() == Triple::EABI || >- TargetTriple.getEnvironment() == Triple::GNUEABI || >-+ TargetTriple.getEnvironment() == Triple::MuslEABI || >- TargetTriple.getEnvironment() == Triple::EABIHF || >- TargetTriple.getEnvironment() == Triple::GNUEABIHF || >-+ TargetTriple.getEnvironment() == Triple::MuslEABIHF || >- TargetTriple.getEnvironment() == Triple::Android) && >- !isTargetDarwin() && !isTargetWindows(); >- } >-diff -ru llvm-3.5.0.src.orig/tools/clang/lib/Driver/Tools.cpp llvm-3.5.0.src/tools/clang/lib/Driver/Tools.cpp >---- llvm-3.5.0.src.orig/tools/clang/lib/Driver/Tools.cpp 2014-08-07 07:51:51.000000000 -0300 >-+++ llvm-3.5.0.src/tools/clang/lib/Driver/Tools.cpp 2014-11-12 15:11:31.901864030 -0200 >-@@ -7182,8 +7182,14 @@ >- return "/system/bin/linker64"; >- else >- return "/system/bin/linker"; >-- } else if (ToolChain.getArch() == llvm::Triple::x86 || >-- ToolChain.getArch() == llvm::Triple::sparc) >-+ } else if (ToolChain.getArch() == llvm::Triple::x86) { >-+ switch (ToolChain.getTriple().getEnvironment()) { >-+ case llvm::Triple::Musl: >-+ return "/lib/ld-musl-i386.so.1"; >-+ default: >-+ return "/lib/ld-linux.so.2"; >-+ } >-+ } else if (ToolChain.getArch() == llvm::Triple::sparc) >- return "/lib/ld-linux.so.2"; >- else if (ToolChain.getArch() == llvm::Triple::aarch64 || >- ToolChain.getArch() == llvm::Triple::arm64) >-@@ -7193,10 +7199,17 @@ >- return "/lib/ld-linux-aarch64_be.so.1"; >- else if (ToolChain.getArch() == llvm::Triple::arm || >- ToolChain.getArch() == llvm::Triple::thumb) { >-- if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF) >-+ switch (ToolChain.getTriple().getEnvironment()) { >-+ case llvm::Triple::Musl: >-+ case llvm::Triple::MuslEABI: >-+ return "/lib/ld-musl-arm.so.3"; >-+ case llvm::Triple::MuslEABIHF: >-+ return "/lib/ld-musl-armhf.so.3"; >-+ case llvm::Triple::GNUEABIHF: >- return "/lib/ld-linux-armhf.so.3"; >-- else >-+ default: >- return "/lib/ld-linux.so.3"; >-+ } >- } else if (ToolChain.getArch() == llvm::Triple::armeb || >- ToolChain.getArch() == llvm::Triple::thumbeb) { >- if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF) >-@@ -7227,8 +7240,14 @@ >- else if (ToolChain.getArch() == llvm::Triple::x86_64 && >- ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUX32) >- return "/libx32/ld-linux-x32.so.2"; >-- else >-- return "/lib64/ld-linux-x86-64.so.2"; >-+ else { >-+ switch (ToolChain.getTriple().getEnvironment()) { >-+ case llvm::Triple::Musl: >-+ return "/lib/ld-musl-x86_64.so.1"; >-+ default: >-+ return "/lib64/ld-linux-x86-64.so.2"; >-+ } >-+ } >- } >- >- static void AddRunTimeLibs(const ToolChain &TC, const Driver &D, >+adapted from llvm-alpine-linux.patch from Alpine >+ >+diff -ru llvm-3.5.0.src.orig/include/llvm/ADT/Triple.h llvm-3.5.0.src/include/llvm/ADT/Triple.h >+--- include/llvm/ADT/Triple.h 2014-07-18 17:28:19.000000000 -0300 >++++ include/llvm/ADT/Triple.h 2014-11-12 14:44:41.738448045 -0200 >+@@ -149,6 +149,10 @@ >+ EABIHF, >+ Android, >+ >++ Musl, >++ MuslEABI, >++ MuslEABIHF, >++ >+ MSVC, >+ Itanium, >+ Cygnus, >+Only in llvm-3.5.0.src/include/llvm/ADT: Triple.h.orig >+diff -ru llvm-3.5.0.src.orig/lib/Support/Triple.cpp llvm-3.5.0.src/lib/Support/Triple.cpp >+--- lib/Support/Triple.cpp 2014-07-18 17:28:19.000000000 -0300 >++++ lib/Support/Triple.cpp 2014-11-12 14:47:06.565122146 -0200 >+@@ -168,6 +168,9 @@ >+ case CODE16: return "code16"; >+ case EABI: return "eabi"; >+ case EABIHF: return "eabihf"; >++ case Musl: return "musl"; >++ case MuslEABI: return "musleabi"; >++ case MuslEABIHF: return "musleabihf"; >+ case Android: return "android"; >+ case MSVC: return "msvc"; >+ case Itanium: return "itanium"; >+@@ -344,6 +347,9 @@ >+ .StartsWith("gnux32", Triple::GNUX32) >+ .StartsWith("code16", Triple::CODE16) >+ .StartsWith("gnu", Triple::GNU) >++ .StartsWith("musl", Triple::Musl) >++ .StartsWith("musleabi", Triple::MuslEABI) >++ .StartsWith("musleabihf", Triple::MuslEABIHF) >+ .StartsWith("android", Triple::Android) >+ .StartsWith("msvc", Triple::MSVC) >+ .StartsWith("itanium", Triple::Itanium) >+Only in llvm-3.5.0.src/lib/Support: Triple.cpp.orig >+diff -ru llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.cpp llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.cpp >+--- lib/Target/ARM/ARMSubtarget.cpp 2014-07-16 23:13:31.000000000 -0300 >++++ lib/Target/ARM/ARMSubtarget.cpp 2014-11-12 14:50:40.025133104 -0200 >+@@ -273,6 +273,8 @@ >+ case Triple::EABIHF: >+ case Triple::GNUEABI: >+ case Triple::GNUEABIHF: >++ case Triple::MuslEABI: >++ case Triple::MuslEABIHF: >+ TargetABI = ARM_ABI_AAPCS; >+ break; >+ default: >+diff -ru llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.h llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.h >+--- lib/Target/ARM/ARMSubtarget.h 2014-07-16 23:13:31.000000000 -0300 >++++ lib/Target/ARM/ARMSubtarget.h 2014-11-12 14:53:36.571808822 -0200 >+@@ -372,8 +372,10 @@ >+ bool isTargetEHABICompatible() const { >+ return (TargetTriple.getEnvironment() == Triple::EABI || >+ TargetTriple.getEnvironment() == Triple::GNUEABI || >++ TargetTriple.getEnvironment() == Triple::MuslEABI || >+ TargetTriple.getEnvironment() == Triple::EABIHF || >+ TargetTriple.getEnvironment() == Triple::GNUEABIHF || >++ TargetTriple.getEnvironment() == Triple::MuslEABIHF || >+ TargetTriple.getEnvironment() == Triple::Android) && >+ !isTargetDarwin() && !isTargetWindows(); >+ } > >diff --git a/llvm-3.5.0-r99.ebuild b/llvm-3.5.0-r99.ebuild >index 9db3f59..22c7f6b 100644 >--- a/llvm-3.5.0-r99.ebuild >+++ b/llvm-3.5.0-r99.ebuild >@@ -149,12 +149,13 @@ src_prepare() { > > epatch "${FILESDIR}"/${PN}-3.5-musl-fixes.patch > epatch "${FILESDIR}"/${PN}-3.5-musl-support.patch >- epatch "${FILESDIR}"/${PN}-3.5-musl-compiler-rt.patch > > epatch "${FILESDIR}"/${P}-fix_LLVMExports_cmake.patch > > if use clang; then > # Automatically select active system GCC's libraries, bugs #406163 and #417913 >+ epatch "${FILESDIR}"/${PN}-3.5-musl-compiler-rt.patch >+ epatch "${FILESDIR}"/${PN}-3.5-musl-clang-support.patch > epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch > > epatch "${FILESDIR}"/clang-3.5-gentoo-install.patch > >diff --git a/files/llvm-3.5-musl-clang-support.patch b/files/llvm-3.5-musl-clang-support.patch >new file mode 100644 >index 0000000..e77836c >--- /dev/null >+++ b/files/llvm-3.5-musl-clang-support.patch >@@ -0,0 +1,59 @@ >+adapted from llvm-alpine-linux.patch from Alpine >+ >+diff -ru llvm-3.5.0.src.orig/tools/clang/lib/Driver/Tools.cpp llvm-3.5.0.src/tools/clang/lib/Driver/Tools.cpp >+--- tools/clang/lib/Driver/Tools.cpp 2014-08-07 07:51:51.000000000 -0300 >++++ tools/clang/lib/Driver/Tools.cpp 2014-11-12 15:11:31.901864030 -0200 >+@@ -7182,8 +7182,14 @@ >+ return "/system/bin/linker64"; >+ else >+ return "/system/bin/linker"; >+- } else if (ToolChain.getArch() == llvm::Triple::x86 || >+- ToolChain.getArch() == llvm::Triple::sparc) >++ } else if (ToolChain.getArch() == llvm::Triple::x86) { >++ switch (ToolChain.getTriple().getEnvironment()) { >++ case llvm::Triple::Musl: >++ return "/lib/ld-musl-i386.so.1"; >++ default: >++ return "/lib/ld-linux.so.2"; >++ } >++ } else if (ToolChain.getArch() == llvm::Triple::sparc) >+ return "/lib/ld-linux.so.2"; >+ else if (ToolChain.getArch() == llvm::Triple::aarch64 || >+ ToolChain.getArch() == llvm::Triple::arm64) >+@@ -7193,10 +7199,17 @@ >+ return "/lib/ld-linux-aarch64_be.so.1"; >+ else if (ToolChain.getArch() == llvm::Triple::arm || >+ ToolChain.getArch() == llvm::Triple::thumb) { >+- if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF) >++ switch (ToolChain.getTriple().getEnvironment()) { >++ case llvm::Triple::Musl: >++ case llvm::Triple::MuslEABI: >++ return "/lib/ld-musl-arm.so.3"; >++ case llvm::Triple::MuslEABIHF: >++ return "/lib/ld-musl-armhf.so.3"; >++ case llvm::Triple::GNUEABIHF: >+ return "/lib/ld-linux-armhf.so.3"; >+- else >++ default: >+ return "/lib/ld-linux.so.3"; >++ } >+ } else if (ToolChain.getArch() == llvm::Triple::armeb || >+ ToolChain.getArch() == llvm::Triple::thumbeb) { >+ if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF) >+@@ -7227,8 +7240,14 @@ >+ else if (ToolChain.getArch() == llvm::Triple::x86_64 && >+ ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUX32) >+ return "/libx32/ld-linux-x32.so.2"; >+- else >+- return "/lib64/ld-linux-x86-64.so.2"; >++ else { >++ switch (ToolChain.getTriple().getEnvironment()) { >++ case llvm::Triple::Musl: >++ return "/lib/ld-musl-x86_64.so.1"; >++ default: >++ return "/lib64/ld-linux-x86-64.so.2"; >++ } >++ } >+ } >+ >+ static void AddRunTimeLibs(const ToolChain &TC, const Driver &D,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 542030
:
397966
|
397968
|
397970
|
397972
|
397974
| 398182