]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-pentiumX.patch
- updated amd64 patch
[packages/rpm.git] / rpm-pentiumX.patch
1 diff -uNr rpm-4.3.orig/installplatform rpm-4.3/installplatform
2 --- rpm-4.3.orig/installplatform        2004-03-24 18:35:51.000000000 +0100
3 +++ rpm-4.3/installplatform     2004-03-24 19:15:25.108751712 +0100
4 @@ -21,7 +21,7 @@
5  
6  RPM="./rpm --rcfile $TEMPRC"
7  
8 -canonarch_sed='s_i.86_i386_;s_athlon_i386_;s_sparc[^-]*_sparc_;s_alpha[^-]*_alpha_;s_\(powerpc\|ppc\)[^-]*_ppc_'
9 +canonarch_sed='s_i.86_i386_;s_pentium[34]_i386_;s_athlon_i386_;s_sparc[^-]*_sparc_;s_alpha[^-]*_alpha_;s_\(powerpc\|ppc\)[^-]*_ppc_'
10  arch="`$RPM --eval '%{_arch}'|sed -e "$canonarch_sed"`"
11  VENDOR="`$RPM --eval '%{_vendor}'`"
12  OS="`$RPM --eval '%{_os}'`"
13 @@ -30,7 +30,7 @@
14  target="`$RPM --eval '%{_target}'|sed -e "$canonarch_sed"`"
15  
16  case "$arch" in
17 -  i[3456]86|athlon) SUBSTS='s_i386_i386_ s_i386_i486_ s_i386_i586_ s_i386_i686_ s_i386_athlon_' ;;
18 +  i[3456]86|pentium[34]|athlon) SUBSTS='s_i386_i386_ s_i386_i486_ s_i386_i586_ s_i386_i686_ s_i386_pentium3_ s_i386_pentium4_ s_i386_athlon_' ;;
19    x86_64*|amd64*) SUBSTS="s/${arch}/x86_64/ s/${arch}/amd64/" ;;
20    alpha*) SUBSTS='s_alpha_alpha_ s_alpha_alphaev5_ s_alpha_alphaev56_ s_alpha_alphapca56_ s_alpha_alphaev6_ s_alpha_alphaev67_' ;;
21    sparc*) SUBSTS='s_sparc\(64\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;;
22 @@ -66,7 +66,7 @@
23      s390x-linux) LIB=lib64; MULTILIBNO=2 ;;
24      ppc-linux) MULTILIBNO=1 ;;
25      ppc64-linux) LIB=lib64; MULTILIBNO=2 ;;
26 -    i?86-linux|athlon-linux) MULTILIBNO=1 ;;
27 +    i?86-linux|pentium?-linux|athlon-linux) MULTILIBNO=1 ;;
28      x86_64-linux|amd64-linux) LIB=lib64; MULTILIBNO=2 ;;
29    esac
30  
31 diff -uNr rpm-4.3.orig/lib/rpmrc.c rpm-4.3/lib/rpmrc.c
32 --- rpm-4.3.orig/lib/rpmrc.c    2004-03-24 18:35:51.000000000 +0100
33 +++ rpm-4.3/lib/rpmrc.c 2004-03-24 19:11:47.433843328 +0100
34 @@ -1038,6 +1038,73 @@
35         return 1;
36  }
37  
38 +static int is_pentium3()
39 +{
40 +    unsigned int eax, ebx, ecx, edx, family, model;
41 +    char vendor[16];
42 +    cpuid(0, &eax, &ebx, &ecx, &edx);
43 +    memset(vendor, 0, sizeof(vendor));
44 +    *((unsigned int *)&vendor[0]) = ebx;
45 +    *((unsigned int *)&vendor[4]) = edx;
46 +    *((unsigned int *)&vendor[8]) = ecx;
47 +    if (strncmp(vendor, "GenuineIntel", 12) != 0)
48 +       return 0;
49 +    cpuid(1, &eax, &ebx, &ecx, &edx);
50 +    family = (eax >> 8) & 0x0f;
51 +    model = (eax >> 4) & 0x0f;
52 +    if (family == 6)
53 +       switch (model)
54 +       {
55 +           case 7:     // Pentium III, Pentium III Xeon (model 7)
56 +           case 8:     // Pentium III, Pentium III Xeon, Celeron (model 8)
57 +           case 9:     // Pentium M
58 +                       /*
59 +                           Intel recently announced its new technology for mobile platforms,
60 +                           named Centrino, and presents it as a big advance in mobile PCs.
61 +                           One of the main part of Centrino consists in a brand new CPU,
62 +                           the Pentium M, codenamed Banias, that we'll study in this review.
63 +                           A particularity of this CPU is that it was designed for mobile platform
64 +                           exclusively, unlike previous mobile CPU (Pentium III-M, Pentium 4-M)
65 +                           that share the same micro-architecture as their desktop counterparts.
66 +                           The Pentium M introduces a new micro-architecture, adapted for mobility
67 +                           constraints, and that is halfway between the Pentium III and the Pentium 4.
68 +                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69 +                       */
70 +           case 10:    // Pentium III Xeon (model A)
71 +           case 11:    // Pentium III (model B)
72 +               return 1;
73 +       }
74 +    return 0;
75 +}
76 +
77 +static int is_pentium4()
78 +{
79 +    unsigned int eax, ebx, ecx, edx, family, model;
80 +    char vendor[16];
81 +    cpuid(0, &eax, &ebx, &ecx, &edx);
82 +    memset(vendor, 0, sizeof(vendor));
83 +    *((unsigned int *)&vendor[0]) = ebx;
84 +    *((unsigned int *)&vendor[4]) = edx;
85 +    *((unsigned int *)&vendor[8]) = ecx;
86 +    if (strncmp(vendor, "GenuineIntel", 12) != 0)
87 +       return 0;
88 +    cpuid(1, &eax, &ebx, &ecx, &edx);
89 +    family = (eax >> 8) & 0x0f;
90 +    model = (eax >> 4) & 0x0f;
91 +    if (family == 15)
92 +       switch (model)
93 +       {
94 +           case 0:     // Pentium 4, Pentium 4 Xeon                 (0.18um)
95 +           case 1:     // Pentium 4, Pentium 4 Xeon MP, Celeron     (0.18um)
96 +           case 2:     // Pentium 4, Mobile Pentium 4-M,
97 +                       // Pentium 4 Xeon, Pentium 4 Xeon MP,
98 +                       // Celeron, Mobile Celron                    (0.13um)
99 +           case 3:     // Pentium 4, Celeron                        (0.09um)
100 +               return 1;
101 +       }
102 +    return 0;
103 +}
104 +
105  #endif
106  
107  #if defined(__linux__) && defined(__powerpc__)
108 @@ -1274,6 +1341,10 @@
109  
110             if ((class == '6' && is_athlon()) || class == '7')
111                 strcpy(un.machine, "athlon");
112 +           else if (is_pentium4())
113 +               strcpy(un.machine, "pentium4");
114 +           else if (is_pentium3())
115 +               strcpy(un.machine, "pentium3");
116             else if (strchr("3456", un.machine[1]) && un.machine[1] != class)
117                 un.machine[1] = class;
118         }
119 diff -uNr rpm-4.3.orig/lib/rpmts.c rpm-4.3/lib/rpmts.c
120 --- rpm-4.3.orig/lib/rpmts.c    2004-01-07 01:39:05.000000000 +0100
121 +++ rpm-4.3/lib/rpmts.c 2004-03-24 19:16:06.842407232 +0100
122 @@ -194,7 +194,7 @@
123  /*@-nullassign@*/
124      /*@observer@*/
125      static const char *arches[] = {
126 -       "i386", "i486", "i586", "i686", "athlon", "x86_64",
127 +       "i386", "i486", "i586", "i686", "pentium3", "pentium4", "athlon", "x86_64",
128         "alpha", "alphaev5", "alphaev56", "alphapca56", "alphaev6", "alphaev67",
129         "sparc", "sun4", "sun4m", "sun4c", "sun4d", "sparcv9",
130         "sparc64", "sun4u",
131 diff -uNr rpm-4.3.orig/macros.in rpm-4.3/macros.in
132 --- rpm-4.3.orig/macros.in      2004-03-24 18:35:50.000000000 +0100
133 +++ rpm-4.3/macros.in   2004-03-24 19:16:49.466927320 +0100
134 @@ -1116,7 +1116,7 @@
135  #   rpm can use regular expressions against target platforms in macro
136  #   conditionals.
137  #
138 -%ix86   i386 i486 i586 i686 athlon
139 +%ix86   i386 i486 i586 i686 pentium3 pentium4 athlon
140  
141  #------------------------------------------------------------------------
142  # Use in %install to generate locale specific file lists. For example,
143 diff -uNr rpm-4.3.orig/rpmrc.in rpm-4.3/rpmrc.in
144 --- rpm-4.3.orig/rpmrc.in       2004-03-24 18:35:51.000000000 +0100
145 +++ rpm-4.3/rpmrc.in    2004-03-24 19:18:56.682587600 +0100
146 @@ -16,6 +16,8 @@
147  optflags: i486 -O2 -march=i486%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_ia32: %{specflags_ia32}}%{?specflags_i486: %{specflags_i486}}}
148  optflags: i586 -O2 -march=i586%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_ia32: %{specflags_ia32}}%{?specflags_i586: %{specflags_i586}}}
149  optflags: i686 -O2 -march=i686%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_ia32: %{specflags_ia32}}%{?specflags_i686: %{specflags_i686}}}
150 +optflags: pentium3 -O2 -march=pentium3%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_ia32: %{specflags_ia32}}%{?specflags_pentium3: %{specflags_pentium3}}}
151 +optflags: pentium4 -O2 -march=pentium4%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_ia32: %{specflags_ia32}}%{?specflags_pentium4: %{specflags_pentium4}}}
152  optflags: athlon -O2 -march=athlon%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_ia32: %{specflags_ia32}}%{?specflags_athlon: %{specflags_athlon}}}
153  optflags: ia64 -O2%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_ia64: %{specflags_ia64}}}
154  optflags: x86_64 -O2%{!?nospecflags:%{?specflags: %{specflags}}%{?specflags_x86_64: %{specflags_x86_64}} %{?specflags_amd64: %{specflags_amd64}} }
155 @@ -68,6 +70,8 @@
156  # Canonical arch names and numbers
157  
158  arch_canon:    athlon: athlon  1
159 +arch_canon:    pentium4:       pentium4        1
160 +arch_canon:    pentium3:       pentium3        1
161  arch_canon:    i686:   i686    1
162  arch_canon:    i586:   i586    1
163  arch_canon:    i486:   i486    1
164 @@ -167,6 +171,8 @@
165  buildarchtranslate: osfmach3_i386: i386
166  
167  buildarchtranslate: athlon: athlon
168 +buildarchtranslate: pentium4: pentium4
169 +buildarchtranslate: pentium3: pentium3
170  buildarchtranslate: i686: i686
171  buildarchtranslate: i586: i586
172  buildarchtranslate: i486: i486
173 @@ -218,6 +224,8 @@
174  arch_compat: alpha: axp noarch
175  
176  arch_compat: athlon: i686
177 +arch_compat: pentium4: pentium3
178 +arch_compat: pentium3: i686
179  arch_compat: i686: i586
180  arch_compat: i586: i486
181  arch_compat: i486: i386
182 @@ -307,6 +315,8 @@
183  buildarch_compat: ia64: noarch
184  
185  buildarch_compat: athlon: i686
186 +buildarch_compat: pentium4: pentium3
187 +buildarch_compat: pentium3: i686
188  buildarch_compat: i686: i586
189  buildarch_compat: i586: i486
190  buildarch_compat: i486: i386
This page took 0.035764 seconds and 3 git commands to generate.