[PATCH 1/1] UBUNTU: SAUCE: powerpc: fix compile error when ptrace.h is included from userspace

Andy Whitcroft apw at canonical.com
Fri May 21 13:33:24 UTC 2010

The commit below introduced some new userspace structures to ptrace.h
this necessarily required the inclusion of linux/types.h for the kernel
and stdlib.h for userspace:

  commit 3162d92dfb79a0b5fc03380b8819fa5f870ebf1e
  Author: Dave Kleikamp <shaggy at linux.vnet.ibm.com>
  Date:   Mon Feb 8 11:51:05 2010 +0000

    powerpc: Extended ptrace interface

However although linux/types.h is assembly safe, stdlib.h is not.  So that
when the unifdef processed versions are included in assembly files such
as occurs in eglibc, non-assembly type definitions are exposed leading
to build errors.

Looking at the original commit all of the added structures are correctly
protected by __ASSEMBLY__ wrappers, therefor the headers are actually only
required in that context.  Move the headers inside the first __ASSEMBLY__

BugLink: http://bugs.launchpad.net/bugs/583733
Signed-off-by: Andy Whitcroft <apw at canonical.com>
 arch/powerpc/include/asm/ptrace.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index 9e2d84c..0ed710e 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -24,14 +24,14 @@
  * 2 of the License, or (at your option) any later version.
+#ifndef __ASSEMBLY__
 #ifdef __KERNEL__
 #include <linux/types.h>
 #include <stdint.h>
-#ifndef __ASSEMBLY__
 struct pt_regs {
 	unsigned long gpr[32];
 	unsigned long nip;

More information about the kernel-team mailing list