* [PATCH] klibc
@ 2006-06-01 19:47 Bob Picco
2006-06-01 20:06 ` Brian F. G. Bidulock
0 siblings, 1 reply; 7+ messages in thread
From: Bob Picco @ 2006-06-01 19:47 UTC (permalink / raw)
To: hpa; +Cc: akpm, linux-kernel, bob.picco
This change enabled me to boot on OpenPower 710. Otherwise klibc's statfs is
built for 32 bit and not for 64 bit. The failure was in kinit when
calling run_init. run_init would attempt to validate ramfs and
failed calling statfs of "/".
Signed-off-by: Bob Picco <bob.picco@hp.com>
usr/include/sys/vfs.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-2.6.17-rc5-mm2/usr/include/sys/vfs.h
===================================================================
--- linux-2.6.17-rc5-mm2.orig/usr/include/sys/vfs.h 2006-06-01 14:51:11.000000000 -0400
+++ linux-2.6.17-rc5-mm2/usr/include/sys/vfs.h 2006-06-01 14:52:20.000000000 -0400
@@ -13,7 +13,8 @@
/* struct statfs64 -- there seems to be two standards -
one for 32 and one for 64 bits, and they're incompatible... */
-#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__)
+#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__) && \
+ !defined(__powerpc64__)
struct statfs {
uint32_t f_type;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] klibc
2006-06-01 19:47 [PATCH] klibc Bob Picco
@ 2006-06-01 20:06 ` Brian F. G. Bidulock
2006-06-01 20:23 ` H. Peter Anvin
0 siblings, 1 reply; 7+ messages in thread
From: Brian F. G. Bidulock @ 2006-06-01 20:06 UTC (permalink / raw)
To: Bob Picco; +Cc: hpa, akpm, linux-kernel
On Thu, 01 Jun 2006, Bob Picco wrote:
>
> -#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__)
> +#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__) && \
> + !defined(__powerpc64__)
Why not just !defined(__LP64__) ?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] klibc
2006-06-01 20:06 ` Brian F. G. Bidulock
@ 2006-06-01 20:23 ` H. Peter Anvin
2006-06-02 8:14 ` maximilian attems
0 siblings, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2006-06-01 20:23 UTC (permalink / raw)
To: Bob Picco, hpa, akpm, linux-kernel
Brian F. G. Bidulock wrote:
> On Thu, 01 Jun 2006, Bob Picco wrote:
>>
>> -#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__)
>> +#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__) && \
>> + !defined(__powerpc64__)
>
> Why not just !defined(__LP64__) ?
_BITSIZE == 64 is really the right formula... if I remember correctly, there were some
64-bit platforms (Alpha?) which didn't conform, though. I will look at this later today.
-hpa
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] klibc
2006-06-01 20:23 ` H. Peter Anvin
@ 2006-06-02 8:14 ` maximilian attems
2006-06-03 22:26 ` H. Peter Anvin
0 siblings, 1 reply; 7+ messages in thread
From: maximilian attems @ 2006-06-02 8:14 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, klibc list
On Thu, 01 June 2006, H. Peter Anvin wrote:
> Brian F. G. Bidulock wrote:
> > On Thu, 01 Jun 2006, Bob Picco wrote:
> >>
> >> -#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__)
> >> +#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__) && \
> >> + !defined(__powerpc64__)
> >
> > Why not just !defined(__LP64__) ?
>
> _BITSIZE == 64 is really the right formula... if I remember correctly, there were some
> 64-bit platforms (Alpha?) which didn't conform, though. I will look at this later today.
>
> -hpa
indeed aboves line contains an mistake by an earlier patch of mine.
-#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__)
+#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__arch64__)
is atm needed to get statfs right on sparc.
--
maks
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] klibc
2006-06-02 8:14 ` maximilian attems
@ 2006-06-03 22:26 ` H. Peter Anvin
2006-06-04 6:30 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2006-06-03 22:26 UTC (permalink / raw)
To: maximilian attems; +Cc: linux-kernel, klibc list
maximilian attems wrote:
> On Thu, 01 June 2006, H. Peter Anvin wrote:
>> Brian F. G. Bidulock wrote:
>>> On Thu, 01 Jun 2006, Bob Picco wrote:
>>>>
>>>> -#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__)
>>>> +#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__) && \
>>>> + !defined(__powerpc64__)
>>> Why not just !defined(__LP64__) ?
>> _BITSIZE == 64 is really the right formula... if I remember correctly, there were some
>> 64-bit platforms (Alpha?) which didn't conform, though. I will look at this later today.
>>
>> -hpa
>
> indeed aboves line contains an mistake by an earlier patch of mine.
>
> -#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__sparc_v9__)
> +#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__arch64__)
>
> is atm needed to get statfs right on sparc.
>
__arch64__ is ugly; it doesn't say it's a sparc thing. I have added
-D__sparc_v9__ to the sparc64 MCONFIG file, so I think that's fine.
Perhaps the right thing to do is to make this an archconfig.h configurable.
-hpa
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] klibc
2006-06-03 22:26 ` H. Peter Anvin
@ 2006-06-04 6:30 ` David Miller
2006-06-04 17:42 ` H. Peter Anvin
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2006-06-04 6:30 UTC (permalink / raw)
To: hpa; +Cc: maks, linux-kernel, klibc
From: "H. Peter Anvin" <hpa@zytor.com>
Date: Sat, 03 Jun 2006 15:26:05 -0700
> __arch64__ is ugly; it doesn't say it's a sparc thing. I have added
> -D__sparc_v9__ to the sparc64 MCONFIG file, so I think that's fine.
>
> Perhaps the right thing to do is to make this an archconfig.h configurable.
Please don't do this, I'll explain why.
Using __sparc_v9__ is incorrect, here is the lowdown on these defines:
1) __sparc_v9__ means "-mcpu={ultrasparc*,niagara}" or "-mcpu=v9".
Although this is implied by "-m64" it can be used for 32-bit
code too.
__sparc_v9__ means "using v9 instructions" which does not
necessarily mean 64-bit
2) "__sparc__ && __arch64__" means 64-bit sparc
People often get this wrong, and it certainly is confusing.
Jakub Jelinek gives a good explanation on the gcc mailing
list here:
http://gcc.gnu.org/ml/gcc/2002-12/msg00108.html
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] klibc
2006-06-04 6:30 ` David Miller
@ 2006-06-04 17:42 ` H. Peter Anvin
0 siblings, 0 replies; 7+ messages in thread
From: H. Peter Anvin @ 2006-06-04 17:42 UTC (permalink / raw)
To: David Miller; +Cc: maks, linux-kernel, klibc
David Miller wrote:
>
>> __arch64__ is ugly; it doesn't say it's a sparc thing. I have added
>> -D__sparc_v9__ to the sparc64 MCONFIG file, so I think that's fine.
>>
>> Perhaps the right thing to do is to make this an archconfig.h configurable.
>
> Please don't do this, I'll explain why.
>
> Using __sparc_v9__ is incorrect, here is the lowdown on these defines:
>
> 1) __sparc_v9__ means "-mcpu={ultrasparc*,niagara}" or "-mcpu=v9".
> Although this is implied by "-m64" it can be used for 32-bit
> code too.
>
> __sparc_v9__ means "using v9 instructions" which does not
> necessarily mean 64-bit
>
> 2) "__sparc__ && __arch64__" means 64-bit sparc
>
> People often get this wrong, and it certainly is confusing.
>
Okay, how about __sparc64__ then (via -D in the MCONFIG file.)
I did change this particular instance to be a archconfig variable, so it
doesn't exist (I try very much to avoid architecture-specific #ifdefs in
bulk code.)
-hpa
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-06-04 17:43 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-01 19:47 [PATCH] klibc Bob Picco
2006-06-01 20:06 ` Brian F. G. Bidulock
2006-06-01 20:23 ` H. Peter Anvin
2006-06-02 8:14 ` maximilian attems
2006-06-03 22:26 ` H. Peter Anvin
2006-06-04 6:30 ` David Miller
2006-06-04 17:42 ` H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox