summaryrefslogtreecommitdiff
path: root/dietlibc-diet-m.patch
blob: 8d7fd4b79c947880ad959e8fa17f990d99bdf707 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- 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,32 @@
       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, "sparcv9", 7) && (m==32)) strcpy(shortplatform, "sparc");
+      else if (!strncmp(shortplatform, "sparcv9", 7) && (m==64)) strcpy(shortplatform, "sparc64");
+      else if (!strncmp(shortplatform, "ppc64", 5) && (m==32)) strcpy(shortplatform, "ppc");
+      else if (!strncmp(shortplatform, "ppc", 3) && (m==64)) strcpy(shortplatform, "ppc64");
+      else if (!strncmp(shortplatform, "s390x", 5) && (m==32)) strcpy(shortplatform, "s390");
+      else if (!strncmp(shortplatform, "s390", 4) && (m==64)) strcpy(shortplatform, "s390x");
     } else {
 #ifdef __sparc__
 #ifdef __arch64__
-      shortplatform="sparc64";
+      shortplatform=(m==32?"sparc":"sparc64");
 #else
-      shortplatform="sparc";
+      shortplatform=(m==64?"sparc64":"sparc");
 #endif
 #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";
+      shortplatform=(m==64?"x86_64":"i386");
 #endif
 #ifdef __alpha__
       shortplatform="alpha";
@@ -173,10 +181,10 @@
       shortplatform="mips";
 #endif
 #ifdef __s390x__
-      shortplatform="s390x";
+      shortplatform=(m==32?"s390":"s390x");
 #else
 #ifdef __s390__
-      shortplatform="s390";
+      shortplatform=(m==64?"s390x":"s390");
 #endif
 #endif
 #ifdef __sh__