tag 347902 +patch
thanks, 

On Sun, Feb 12, 2006 at 11:00:43PM +0100, Frans Pop wrote:
> On request of Jeff Bailey I've run an strace on run-init with the
> following result. (Copied by hand, so minor mistakes possible.)
> 
> execve("bin/run-init", [bin/run-init", "root/", "sbin/init"], [*/13 vars 
> */]') = 0
> chdir(umovestr: Input/output error
> 0xffccdf3d)             = 0
> stat64("/", ptrace: umoven: Input/output error
> {...})
> stat64(".", ptrace: umoven: Input/output error
> {...})
> stat64("/init", ptrace: umoven: Input/output error
> {...})
> stat64("/", 88, 0xffccdbb8) = -1 EINVAL (Invlaid argument)
> write(2, ptrace: umoven: Input/output error
> 0xffcc57b0, 41bin/run-init: statfs /: Invalid argument
> )                       = 41
> exit(1)     = ?

Had the same problem on my Ultra 5. Digged around a little in the klibc source.

It seems that klibc uses __sparc64__ to determine if it's compiled in 64 bit
mode on sparc, unfortunatly gcc doesn't define __sparc64__ :) It does define
__arch64__ though.

$ cat /tmp/test.c
#ifdef __sparc64__ 
  "sparc64 defined"
#endif
#ifdef __sparc__ 
    "sparc defined"
#endif
#ifdef __arch64__ 
      "arch64 defined"
#endif

$  gcc -E /tmp/test.c | grep defined 
  "sparc defined"

$ gcc -m64 -E /tmp/test.c | grep defined 
  "sparc defined"
  "arch64 defined"

Attached patch fixes this issue. With this (and working around the current FTBS
on sparc) i could sucessfully boot my sparc with initramfs.

  Sjoerd
-- 
Brahma said: Well, after hearing ten thousand explanations, a fool is no
wiser.  But an intelligent man needs only two thousand five hundred.
                -- The Mahabharata
--- klibc-1.2.2.orig/include/sys/vfs.h  2006-02-15 18:32:10.000000000 +0100
+++ klibc-1.2.2/include/sys/vfs.h       2006-02-15 18:32:35.000000000 +0100
@@ -13,7 +13,7 @@
 /* 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(__sparc64__)
+#if !defined(__x86_64__) && !defined(__ia64__) && !defined(__arch64__)
 
 struct statfs {
         uint32_t f_type;

Reply via email to