sparc: use asm-generic version of types.h
PATCH 4/5 sparc: use asm-generic version of types.h
This fixes build errors in samples/
We failed to include the header file that define __u16 because __sparc__ was not defined.
This check is not required - and removing this made us compatible with the generic types.h version. So use that.
--- arch/sparc/include/asm/Kbuild | 1 + arch/sparc/include/uapi/asm/Kbuild | 1 - arch/sparc/include/uapi/asm/types.h | 17 ----------------- 3 files changed, 1 insertions(+), 18 deletions(-) delete mode 100644 arch/sparc/include/uapi/asm/types.h
arch/sparc/include/asm/Kbuild +1 -0
@@ -13,4 +13,5 @@ generic-y += local.h generic-y += module.h generic-y += serial.h generic-y += trace_clock.h +generic-y += types.h generic-y += word-at-a-time.h
arch/sparc/include/uapi/asm/Kbuild +0 -1
@@ -44,7 +44,6 @@ header-y += swab.h header-y += termbits.h header-y += termios.h header-y += traps.h -header-y += types.h header-y += uctx.h header-y += unistd.h header-y += utrap.h
arch/sparc/include/uapi/asm/types.h deleted +0 -17
@@ -1,17 +0,0 @@ -#ifndef _SPARC_TYPES_H -#define _SPARC_TYPES_H -/* -* This file is never included by application software unless -* explicitly requested (e.g., via linux/types.h) in which case the -* application is Linux specific so (user-) name space pollution is -* not a major issue. However, for interoperability, libraries still -* need to be careful to avoid a name clashes. -*/ - -#if defined(__sparc__) - -#include <asm-generic/int-ll64.h> - -#endif /* defined(__sparc__) */ - -#endif /* defined(_SPARC_TYPES_H) */
Signature · 1 line
1.6.0.6
David Miller
maintainerFrom: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 22:44:25 +0100
Quoted 2 lines
We failed to include the header file that define
__u16because__sparc__was not defined.
Is this another problem with your cross compiler?
__sparc__ should always be defined, it's a CPP pre-define.
Quoted 9 lines · David Miller
From: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 22:44:25 +0100Quoted 2 lines
We failed to include the header file that define
__u16because__sparc__was not defined.Is this another problem with your cross compiler?
__sparc__should always be defined, it's a CPP pre-define.
Maybe..
But Fengguang Wu see the same issue in his 0-day
testing.
But maybe we have both gcc issues.
Sam
David Miller
maintainerFrom: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 23:07:33 +0100
Quoted 9 lines · David Miller
Quoted 8 lines
From: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 22:44:25 +0100Quoted 2 lines
We failed to include the header file that define
__u16because__sparc__was not defined.Is this another problem with your cross compiler?
Quoted 7 lines
Quoted 1 line
__sparc__should always be defined, it's a CPP pre-define.Maybe..
But Fengguang Wu see the same issue in his 0-day
testing.
But maybe we have both gcc issues.
I'm not fundamentally against these changes, if there would be a good reason for them.
But it seems to me that these cross compilers are terminally broken, you cannot seriously even expect them to be able to compiler userland successfully at all because __linux__ and __sparc__ must be CPP predefined for userspace to compiler properly.
Quoted 20 lines · David Miller
From: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 23:07:33 +0100Quoted 9 lines · David Miller
Quoted 8 lines
From: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 22:44:25 +0100Quoted 2 lines
We failed to include the header file that define
__u16because__sparc__was not defined.Is this another problem with your cross compiler?
Quoted 7 lines
Quoted 1 line
__sparc__should always be defined, it's a CPP pre-define.Maybe..
But Fengguang Wu see the same issue in his 0-day
testing.
But maybe we have both gcc issues.
Quoted 7 lines
I'm not fundamentally against these changes, if there would be a good reason for them.
But it seems to me that these cross compilers are terminally broken, you cannot seriously even expect them to be able to compiler userland successfully at all because
__linux__and__sparc__must be CPP predefined for userspace to compiler properly.
I confused myself yesterday concerning this patch/fix...
The build error in samples/hiddraw happens because the said code is built using the host gcc - and not my cross-compiled gcc. This is the intention - when readign the Makefile.
So this is not a broken cross gcc.
I think they have mixed it up and what they really wanted was to build a regular user binary for the selected architecture.
I will followup on this in another thread.
In sparc headers we use the following pattern:
#if defined(__sparc__) && defined(__arch64__)
sparc64 specific stuff
#else
sparc32 specific stuff
#endifIn types.h this pattern was not followed and here
we only checked for __sparc__ for no good reason.
It was a left-over from long time ago.
I checked other architectures - and most of them
do not have any such checks. And all the recently
merged versions uses the asm-generic version
So independent on the build error reported by Fengguang Wu and independent on my broken cross gcc this patch is fine.
Sam
David Miller
maintainerFrom: Sam Ravnborg <[email protected]>
Date: Sun, 31 Mar 2013 09:48:46 +0200
Quoted 1 line
In sparc headers we use the following pattern:
...
Quoted 10 lines
In
types.hthis pattern was not followed and here we only checked for__sparc__for no good reason. It was a left-over from long time ago.I checked other architectures - and most of them do not have any such checks. And all the recently merged versions uses the asm-generic version
So independent on the build error reported by Fengguang Wu and independent on my broken cross gcc this patch is fine.
Please resubmit this patch with the more accurate description you've provided above. Thanks!