---- dietlibc-0.30/diet.c.orig 2006-12-30 22:29:01.483043000 +0100
-+++ dietlibc-0.30/diet.c 2006-12-30 22:51:22.719475784 +0100
-@@ -146,10 +146,17 @@
+--- dietlibc-0.30/diet.c.orig 2006-12-31 12:01:17.000000000 +0000
++++ dietlibc-0.30/diet.c 2006-12-31 12:02:59.000000000 +0000
+@@ -146,22 +146,30 @@
else if (!strncmp(shortplatform, "pentium3", 8)) strcpy(shortplatform, "i386");
else if (!strncmp(shortplatform, "athlon", 6)) strcpy(shortplatform, "i386");
else if (!strncmp(shortplatform, "amd64", 5)) strcpy(shortplatform, "x86_64");
+ if (!strncmp(shortplatform, "x86_64", 6) && (m==32)) strcpy(shortplatform, "i386");
++ else if (!strncmp(shortplatform, "i386", 4) && (m==64)) strcpy(shortplatform, "x86_64");
+ else if (!strncmp(shortplatform, "sparc64", 7) && (m==32)) strcpy(shortplatform, "sparc");
+ else if (!strncmp(shortplatform, "sparc", 5) && (m==64)) strcpy(shortplatform, "sparc64");
+ else if (!strncmp(shortplatform, "ppc64", 5) && (m==32)) strcpy(shortplatform, "ppc");
- shortplatform="sparc64";
+ shortplatform=(m==32?"sparc":"sparc64");
#else
- shortplatform="sparc";
+- shortplatform="sparc";
++ shortplatform=(m==64?"sparc64":"sparc");
#endif
-@@ -158,7 +165,7 @@
- shortplatform="ppc";
+ #endif
+ #ifdef __powerpc__
+- shortplatform="ppc";
++ shortplatform=(m==64?"ppc64":"ppc");
#endif
#ifdef __powerpc64__
- shortplatform="ppc64";
+ shortplatform=(m==32?"ppc":"ppc64");
#endif
#ifdef __i386__
- shortplatform="i386";
-@@ -173,7 +180,7 @@
+- shortplatform="i386";
++ shortplatform=(m==64?"x86_64":"i386");
+ #endif
+ #ifdef __alpha__
+ shortplatform="alpha";
+@@ -173,10 +181,10 @@
shortplatform="mips";
#endif
#ifdef __s390x__
+ shortplatform=(m==32?"s390":"s390x");
#else
#ifdef __s390__
- shortplatform="s390";
+- shortplatform="s390";
++ shortplatform=(m==64?"s390x":"s390");
+ #endif
+ #endif
+ #ifdef __sh__