From fd9959a8d7d325a6571d4d2945ee300a707faf7353e5beaebfcede3aedbfcfe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Fri, 22 Nov 2013 12:39:53 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=303 --- fix-powerpc-headers.patch | 112 -------------------------------------- llvm.spec | 5 +- 2 files changed, 2 insertions(+), 115 deletions(-) delete mode 100644 fix-powerpc-headers.patch diff --git a/fix-powerpc-headers.patch b/fix-powerpc-headers.patch deleted file mode 100644 index 762bfc2..0000000 --- a/fix-powerpc-headers.patch +++ /dev/null @@ -1,112 +0,0 @@ -Index: projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h -=================================================================== ---- projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h (revision 195441) -+++ projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h (revision 195442) -@@ -61,6 +61,14 @@ - const unsigned struct___old_kernel_stat_sz = 32; - const unsigned struct_kernel_stat_sz = 64; - const unsigned struct_kernel_stat64_sz = 104; -+#elif defined(__powerpc__) && !defined(__powerpc64__) -+ const unsigned struct___old_kernel_stat_sz = 32; -+ const unsigned struct_kernel_stat_sz = 72; -+ const unsigned struct_kernel_stat64_sz = 104; -+#elif defined(__powerpc64__) -+ const unsigned struct___old_kernel_stat_sz = 0; -+ const unsigned struct_kernel_stat_sz = 144; -+ const unsigned struct_kernel_stat64_sz = 104; - #endif - const unsigned struct_io_event_sz = 32; - struct __sanitizer_perf_event_attr { -@@ -126,10 +134,15 @@ - int gid; - int cuid; - int cgid; -+#ifdef __powerpc64__ -+ unsigned mode; -+ unsigned __seq; -+#else - unsigned short mode; - unsigned short __pad1; - unsigned short __seq; - unsigned short __pad2; -+#endif - uptr __unused1; - uptr __unused2; - }; -@@ -136,7 +149,9 @@ - - struct __sanitizer_shmid_ds { - __sanitizer_ipc_perm shm_perm; -+ #ifndef __powerpc__ - uptr shm_segsz; -+ #endif - uptr shm_atime; - #ifndef _LP64 - uptr __unused1; -@@ -149,6 +164,9 @@ - #ifndef _LP64 - uptr __unused3; - #endif -+ #ifdef __powerpc__ -+ uptr shm_segsz; -+ #endif - int shm_cpid; - int shm_lpid; - uptr shm_nattch; -@@ -271,8 +289,15 @@ - typedef unsigned short __sanitizer___kernel_gid_t; - typedef long __sanitizer___kernel_off_t; - #endif -+ -+#if defined(__powerpc64__) -+ typedef unsigned int __sanitizer___kernel_old_uid_t; -+ typedef unsigned int __sanitizer___kernel_old_gid_t; -+#else - typedef unsigned short __sanitizer___kernel_old_uid_t; - typedef unsigned short __sanitizer___kernel_old_gid_t; -+#endif -+ - typedef long long __sanitizer___kernel_loff_t; - typedef struct { - unsigned long fds_bits[1024 / (8 * sizeof(long))]; -Index: projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cc -=================================================================== ---- projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cc (revision 195441) -+++ projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cc (revision 195442) -@@ -25,8 +25,25 @@ - // For offsetof -> __builtin_offsetof definition. - #include - -+// With old kernels (and even new kernels on powerpc) asm/stat.h uses types that -+// are not defined anywhere in userspace headers. Fake them. This seems to work -+// fine with newer headers, too. -+#include -+#define ino_t __kernel_ino_t -+#define mode_t __kernel_mode_t -+#define nlink_t __kernel_nlink_t -+#define uid_t __kernel_uid_t -+#define gid_t __kernel_gid_t -+#define off_t __kernel_off_t - // This header seems to contain the definitions of _kernel_ stat* structs. - #include -+#undef ino_t -+#undef mode_t -+#undef nlink_t -+#undef uid_t -+#undef gid_t -+#undef off_t -+ - #include - - #if SANITIZER_ANDROID -@@ -43,7 +60,10 @@ - unsigned struct_statfs64_sz = sizeof(struct statfs64); - } // namespace __sanitizer - -+#if !defined(__powerpc64__) - COMPILER_CHECK(struct___old_kernel_stat_sz == sizeof(struct __old_kernel_stat)); -+#endif -+ - COMPILER_CHECK(struct_kernel_stat_sz == sizeof(struct stat)); - - #if defined(__i386__) diff --git a/llvm.spec b/llvm.spec index 874986c..2df954d 100644 --- a/llvm.spec +++ b/llvm.spec @@ -43,7 +43,6 @@ Patch7: cmake-host-triple.patch # PATCH-FIX-OPENSUSE aarch64-suse-support.patch -- Enable AArch64 suse toolchain support Patch8: aarch64-suse-support.patch Patch9: arm-remove-xfails.diff -Patch10: fix-powerpc-headers.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake @@ -152,7 +151,6 @@ This package contains vim plugins for LLVM like syntax highlighting. %patch7 -p1 %patch8 -p1 %patch9 -%patch10 # We hardcode i586 rm tools/clang/test/Driver/x86_features.c @@ -216,6 +214,7 @@ pushd stage1 %ifarch ppc64 %define host_triple powerpc64-suse-linux sed -i s,'${CMAKE_SYSTEM_PROCESSOR}','"PowerPC"',g ../cmake/modules/AddLLVM.cmake +rm -rf ../projects/compiler-rt %endif %ifarch s390x %define host_triple s390x-suse-linux @@ -434,7 +433,7 @@ rm -rf %{buildroot}/usr/share/llvm/cmake %{_libdir}/bfd-plugins/ %endif %{_libdir}/clang -%ifnarch %arm aarch64 s390 s390x +%ifnarch %arm aarch64 ppc64 s390 s390x %{_libdir}/clang/%{_release_version}/lib/linux/ %endif