[sanitizer] fix the ppc32 build
Jakub Jelinek
jakub at redhat.com
Fri Jan 10 02:02:08 PST 2014
On Thu, Jan 09, 2014 at 03:11:16PM -0800, Chandler Carruth wrote:
> I've mailed out a patch to the LLVM developer's policy which should clarify
> this. The only thing that would help is for the authors of these three
> patches (and the fourth patch I found later) to just email a copy of the
> patch to llvm-commits, or if any of you have commit access to directly
> commit the patch.
Ok, I'm doing this now for the ppc32 sanitizer_common fix, originally posted
in http://gcc.gnu.org/ml/gcc-patches/2013-12/msg00209.html with all the
explanations there.
--- lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -142,23 +142,32 @@ namespace __sanitizer {
int gid;
int cuid;
int cgid;
-#ifdef __powerpc64__
+#ifdef __powerpc__
unsigned mode;
unsigned __seq;
+ u64 __unused1;
+ u64 __unused2;
#else
unsigned short mode;
unsigned short __pad1;
unsigned short __seq;
unsigned short __pad2;
+#if defined(__x86_64__) && !defined(_LP64)
+ u64 __unused1;
+ u64 __unused2;
+#else
+ unsigned long __unused1;
+ unsigned long __unused2;
+#endif
#endif
- uptr __unused1;
- uptr __unused2;
};
struct __sanitizer_shmid_ds {
__sanitizer_ipc_perm shm_perm;
#ifndef __powerpc__
uptr shm_segsz;
+ #elif !defined(__powerpc64__)
+ uptr __unused0;
#endif
uptr shm_atime;
#ifndef _LP64
@@ -290,17 +299,20 @@ namespace __sanitizer {
typedef long __sanitizer_clock_t;
#if SANITIZER_LINUX
-#if defined(_LP64) || defined(__x86_64__)
+#if defined(_LP64) || defined(__x86_64__) || defined(__powerpc__)
typedef unsigned __sanitizer___kernel_uid_t;
typedef unsigned __sanitizer___kernel_gid_t;
- typedef long long __sanitizer___kernel_off_t;
#else
typedef unsigned short __sanitizer___kernel_uid_t;
typedef unsigned short __sanitizer___kernel_gid_t;
+#endif
+#if defined(__x86_64__) && !defined(_LP64)
+ typedef long long __sanitizer___kernel_off_t;
+#else
typedef long __sanitizer___kernel_off_t;
#endif
-#if defined(__powerpc64__)
+#if defined(__powerpc__)
typedef unsigned int __sanitizer___kernel_old_uid_t;
typedef unsigned int __sanitizer___kernel_old_gid_t;
#else
Jakub
More information about the llvm-commits
mailing list