[OpenBIOS] [PATCH] Fix PowerPC build

Blue Swirl blauwirbel at gmail.com
Sat Feb 19 17:43:43 CET 2011


On Sat, Feb 19, 2011 at 5:50 PM, Aurelien Jarno <aurelien at aurel32.net> wrote:
> On Sat, Feb 19, 2011 at 02:35:59PM +0200, Blue Swirl wrote:
>> On Sat, Feb 19, 2011 at 2:13 PM, Andreas Färber <andreas.faerber at web.de> wrote:
>> > Am 19.02.2011 um 12:43 schrieb Aurelien Jarno:
>> >
>> >> Given openbios overrides <asm/types.h> with its own version, it should
>> >> provides at least the same types for the included kernel headers. This
>> >> fixes the following build failure:
>> >>
>> >> | HOSTCC host/kernel/bootstrap.o
>> >> | In file included from /usr/include/asm/ptrace.h:28,
>> >> |                  from /usr/include/asm/sigcontext.h:12,
>> >> |                  from /usr/include/bits/sigcontext.h:29,
>> >> |                  from /usr/include/signal.h:340,
>> >> |                  from ../kernel/bootstrap.c:14:
>> >> | /usr/include/linux/types.h:27: error: expected '=', ',', ';', 'asm' or
>> >> '__attribute__' before '__le16'
>> >> | /usr/include/linux/types.h:28: error: expected '=', ',', ';', 'asm' or
>> >> '__attribute__' before '__be16'
>> >> | /usr/include/linux/types.h:29: error: expected '=', ',', ';', 'asm' or
>> >> '__attribute__' before '__le32'
>> >> | /usr/include/linux/types.h:30: error: expected '=', ',', ';', 'asm' or
>> >> '__attribute__' before '__be32'
>> >> | /usr/include/linux/types.h:31: error: expected '=', ',', ';', 'asm' or
>> >> '__attribute__' before '__le64'
>> >> | /usr/include/linux/types.h:32: error: expected '=', ',', ';', 'asm' or
>> >> '__attribute__' before '__be64'
>> >> | /usr/include/linux/types.h:34: error: expected '=', ',', ';', 'asm' or
>> >> '__attribute__' before '__sum16'
>> >> | /usr/include/linux/types.h:35: error: expected '=', ',', ';', 'asm' or
>> >> '__attribute__' before '__wsum'
>> >> | In file included from /usr/include/asm/sigcontext.h:12,
>> >> |                  from /usr/include/bits/sigcontext.h:29,
>> >> |                  from /usr/include/signal.h:340,
>> >> |                  from ../kernel/bootstrap.c:14:
>> >> | /usr/include/asm/ptrace.h:201: error: expected specifier-qualifier-list
>> >> before '__u32'
>> >> | In file included from /usr/include/asm/sigcontext.h:12,
>> >> |                  from /usr/include/bits/sigcontext.h:29,
>> >> |                  from /usr/include/signal.h:340,
>> >> |                  from ../kernel/bootstrap.c:14:
>> >> | /usr/include/asm/ptrace.h:223: error: expected specifier-qualifier-list
>> >> before '__u32'
>> >> | make[1]: *** [host/kernel/bootstrap.o] Error 1
>> >>
>> >>
>> >> Signed-off-by: Aurelien Jarno <aurelien at aurel32.net>
>> >>
>> >> --- a/include/arch/ppc/types.h
>> >> +++ b/include/arch/ppc/types.h
>> >> @@ -75,4 +75,10 @@ typedef short                s16;
>> >> typedef int             s32;
>> >> typedef long long       s64;
>> >>
>> >> +/* Needed by kernel includes */
>> >> +typedef u8   __u8;
>> >> +typedef u16 __u16;
>> >> +typedef u32 __u32;
>> >> +typedef u64 __u64;
>> >> +
>> >> #endif
>> >
>> > Looks fine to me.
>> >
>> > Acked-by: Andreas Färber <andreas.faerber at web.de>
>> >
>> > Do you have commit rights here or should I apply it?
>>
>> I think we should rather try to avoid same file names. We can't be
>> compatible with every userland header out there, including non-Linux
>> systems which may also have asm/types.h. So I'd rename the files or
>> the link 'asm'.
>
> I agree that it would be the ideal, OTOH, my guess is that this header
> is called exactly the same way to avoid including <asm/types.h> from
> kernel includes, as the same types are defined that in openbios.
>
> If we really want to do that, we should rename all u8/16/32 and other
> types as openbios_u8/16/32 or something like that.

Maybe the cell types should be moved to libopenbios/celltypes.h or
similar, while asm/types.h could provide u8 etc. types to match Linux
asm/types.h.



More information about the OpenBIOS mailing list