]> git.pld-linux.org Git - packages/rpm.git/blame - x32.patch
ossp-uuid is not required by rpm.org
[packages/rpm.git] / x32.patch
CommitLineData
83a0601a
JR
1diff -ur rpm-4.15.1.orig/build/rpmfc.c rpm-4.15.1/build/rpmfc.c
2--- rpm-4.15.1.orig/build/rpmfc.c 2019-12-29 14:07:19.877313873 +0100
3+++ rpm-4.15.1/build/rpmfc.c 2019-12-29 13:47:23.183804165 +0100
4@@ -595,6 +595,7 @@
fb35e2d9 5
321b78b0
JR
6 { "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE },
7 { "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE },
8+// { "ELF 32-bit", RPMFC_ELFX32|RPMFC_INCLUDE },
9
fb35e2d9
JR
10 { "troff or preprocessor input", RPMFC_INCLUDE },
11 { "GNU Info", RPMFC_INCLUDE },
83a0601a 12@@ -696,7 +697,11 @@
321b78b0
JR
13 if (strstr(fmstr, fct->token) == NULL)
14 continue;
fb35e2d9 15
321b78b0
JR
16- fcolor |= fct->colors;
17+ // This is a nasty hack, but will have to do for now
18+ if ((fct->colors & RPMFC_ELF32) && (strstr(fmstr, "x86-64") != NULL))
83a0601a 19+ fcolor |= RPMFC_ELFX32|RPMFC_INCLUDE;
321b78b0 20+ else
83a0601a 21+ fcolor |= fct->colors;
321b78b0 22 if (fcolor & RPMFC_INCLUDE)
83a0601a 23 break;
321b78b0 24 }
09cbffaa
JR
25@@ -1152,7 +1152,10 @@
26 color = RPMFC_ELF64;
27 break;
28 case ELFCLASS32:
29- color = RPMFC_ELF32;
30+ if (ehdr.e_machine == EM_X86_64)
31+ color = RPMFC_ELFX32;
32+ else
33+ color = RPMFC_ELF32;
34 break;
35 }
36 elf_end(elf);
83a0601a
JR
37diff -ur rpm-4.15.1.orig/build/rpmfc.h rpm-4.15.1/build/rpmfc.h
38--- rpm-4.15.1.orig/build/rpmfc.h 2019-06-26 16:17:31.397985717 +0200
39+++ rpm-4.15.1/build/rpmfc.h 2019-12-29 13:45:05.936980833 +0100
40@@ -26,8 +26,9 @@
321b78b0
JR
41 RPMFC_BLACK = 0,
42 RPMFC_ELF32 = (1 << 0),
43 RPMFC_ELF64 = (1 << 1),
44+ RPMFC_ELFX32 = (1 << 2),
45 RPMFC_ELFMIPSN32 = (1 << 2),
46-#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
47+#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFX32|RPMFC_ELFMIPSN32)
48 /* (1 << 3) leaks into package headers, reserved */
49
83a0601a
JR
50 RPMFC_WHITE = (1 << 29),
51diff -ur rpm-4.15.1.orig/configure.ac rpm-4.15.1/configure.ac
52--- rpm-4.15.1.orig/configure.ac 2019-12-29 14:07:19.813977936 +0100
53+++ rpm-4.15.1/configure.ac 2019-12-29 14:27:41.381850928 +0100
54@@ -1050,6 +1050,9 @@
55 host_os=`echo "${host_os}" | sed 's/-gnueabi$//'`
56 host_os_gnu=-gnueabi
57 fi
58+if echo "$host_os" | grep '.*-gnux32' > /dev/null ; then
59+ host_os=`echo "${host_os}" | sed 's/-gnux32$//'`
60+fi
61 if echo "$host_os" | grep '.*-gnu' > /dev/null ; then
62 host_os=`echo "${host_os}" | sed 's/-gnu$//'`
63 fi
83a0601a
JR
64diff -ur rpm-4.15.1.orig/installplatform rpm-4.15.1/installplatform
65--- rpm-4.15.1.orig/installplatform 2019-06-26 16:17:31.404985707 +0200
66+++ rpm-4.15.1/installplatform 2019-12-29 14:52:09.331085139 +0100
67@@ -21,6 +21,7 @@
68
69 ARCH_INSTALL_POST='%{nil}'
70 LIB=lib
71+ TARGETCPU="%{_target_cpu}"
72
73 # XXX FIXME: incomplete and quite likely wrong too in places,
74 # consult various arch folks for correct names etc.
75@@ -82,7 +83,15 @@
76 ISANAME=x86
77 ISABITS=64
78 CANONARCH=x86_64
5c979c25 79- CANONCOLOR=3
83a0601a
JR
80+ CANONCOLOR=7
81+ ;;
82+ x32)
83+ ISANAME=x86
d6d53b26 84+ ISABITS=x32
83a0601a 85+ CANONARCH=x32
f2d42e9b 86+ CANONCOLOR=7
ba7b32d5 87+ FORCE_RPMRC_GNU="${RPMRC_GNU}x32"
83a0601a
JR
88+ TARGETCPU="x86_64"
89 ;;
90 ia64)
91 ISANAME=ia
92@@ -190,10 +199,14 @@
93 # skip architectures for which we dont have full config parameters
94 [ -z "$CANONARCH" ] && continue
95
96- if [ "$OS" = "linux" ] && [ "$CANONCOLOR" = 3 ]; then
97+ if [ "$OS" = "linux" ] && [ "$CANONARCH" = "x86_64" ]; then
98 LIB=${LIB}64
99 fi
100
101+ if [ "$OS" = "linux" ] && [ "$CANONARCH" = "x32" ]; then
102+ LIB=${LIB}x32
103+ fi
104+
105 PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}"
106 [ -d $PPD ] || mkdir -p $PPD
107
ba7b32d5
JP
108@@ -201,7 +214,8 @@
109 | sed -e "s,@RPMRC_OPTFLAGS@,$RPMRC_OPTFLAGS," \
83a0601a
JR
110 -e "s,@RPMCANONARCH@,$CANONARCH,g" \
111 -e "s,@RPMCANONCOLOR@,$CANONCOLOR," \
ba7b32d5
JP
112- -e "s,@RPMRC_GNU@,$RPMRC_GNU," \
113+ -e "s,@RPMRC_GNU@,${FORCE_RPMRC_GNU:-$RPMRC_GNU}," \
83a0601a
JR
114+ -e "s,@TARGETCPU@,$TARGETCPU," \
115 -e "s,@LIB@,$LIB," \
116 -e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \
117 -e '/\${\w*:-/!s,\${,%{_,' \
ba7b32d5
JP
118@@ -212,6 +226,8 @@
119 | ${FILTER} \
120 > ${PPD}/macros
121
122+ FORCE_RPMRC_GNU=
123+
124 done
125
126 # gently adjust undefined autoconf variables to rpm macros...
83a0601a
JR
127diff -ur rpm-4.15.1.orig/platform.in rpm-4.15.1/platform.in
128--- rpm-4.15.1.orig/platform.in 2019-11-13 10:19:29.371710954 +0100
129+++ rpm-4.15.1/platform.in 2019-12-29 14:47:30.886959421 +0100
130@@ -8,7 +8,7 @@
131 %_vendor @RPMCANONVENDOR@
132 %_os @RPMCANONOS@
133 %_gnu @RPMRC_GNU@
134-%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}
135+%_target_platform @TARGETCPU@-%{_vendor}-%{_target_os}%{?_gnu}
136 %optflags @RPMRC_OPTFLAGS@
137
138 %__isa_name @ISANAME@
139diff -ur rpm-4.15.1.orig/rpmrc.in rpm-4.15.1/rpmrc.in
140--- rpm-4.15.1.orig/rpmrc.in 2019-11-13 10:19:29.418711227 +0100
141+++ rpm-4.15.1/rpmrc.in 2019-12-29 14:51:20.293119352 +0100
142@@ -24,6 +24,7 @@
143 optflags: x86_64 -O2 -g
144 optflags: amd64 -O2 -g
145 optflags: ia32e -O2 -g
146+optflags: x32 -O2 -g -mtune=generic -march=x86-64
147
148 optflags: alpha -O2 -g -mieee
149 optflags: alphaev5 -O2 -g -mieee -mtune=ev5
150@@ -155,6 +156,8 @@
151
152 archcolor: riscv64 2
153
154+archcolor: x32 4
155+
156 #############################################################
157 # Canonical arch names and numbers
158
159@@ -170,6 +173,7 @@
160 arch_canon: amd64: amd64 1
161 arch_canon: ia32e: ia32e 1
162 arch_canon: em64t: em64t 1
163+arch_canon: x32: x32 1
164
165 arch_canon: alpha: alpha 2
166 arch_canon: alphaev5: alphaev5 2
167@@ -379,6 +383,8 @@
168 buildarchtranslate: amd64: x86_64
169 buildarchtranslate: ia32e: x86_64
170
171+buildarchtranslate: x32: x32
172+
173 buildarchtranslate: sh3: sh3
174 buildarchtranslate: sh4: sh4
175 buildarchtranslate: sh4a: sh4
581969f1 176@@ -486,10 +492,12 @@
f2d42e9b
JR
177
178 arch_compat: ia64: noarch
179
180-arch_compat: x86_64: amd64 em64t athlon noarch
181+arch_compat: x86_64: amd64 em64t athlon x32 noarch
83a0601a
JR
182 arch_compat: amd64: x86_64 em64t athlon noarch
183 arch_compat: ia32e: x86_64 em64t athlon noarch
184
f2d42e9b 185+arch_compat: x32: x32 x86_64 noarch
83a0601a
JR
186+
187 arch_compat: sh3: noarch
188 arch_compat: sh4: noarch
189 arch_compat: sh4a: sh4
190@@ -628,6 +636,8 @@
191 buildarch_compat: amd64: x86_64
192 buildarch_compat: ia32e: x86_64
193
194+buildarch_compat: x32: noarch
195+
196 buildarch_compat: sh3: noarch
197 buildarch_compat: sh4: noarch
198 buildarch_compat: sh4a: sh4
199diff -ur rpm-4.15.1.orig/tools/elfdeps.c rpm-4.15.1/tools/elfdeps.c
200--- rpm-4.15.1.orig/tools/elfdeps.c 2019-06-26 16:17:31.462985619 +0200
201+++ rpm-4.15.1/tools/elfdeps.c 2019-12-29 14:22:05.339471071 +0100
202@@ -94,6 +94,9 @@
203 break;
204 }
205 }
206+ if ((ehdr->e_ident[EI_CLASS] == ELFCLASS32) && (ehdr->e_machine == EM_X86_64)) {
207+ marker = "(x32bit)";
208+ }
209 return marker;
210 }
211
b2ff08d9
JR
212--- rpm-4.15.1/fileattrs/pythondist.attr~ 2019-06-26 23:17:31.000000000 +0900
213+++ rpm-4.15.1/fileattrs/pythondist.attr 2020-01-04 23:34:05.680366882 +0900
214@@ -1,3 +1,3 @@
215 %__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides
216 %__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires
217-%__pythondist_path /lib(64)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$
218+%__pythondist_path /lib(64|x32)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$
24b1f498
JR
219--- rpm-4.16.0/fileattrs/python.attr.orig 2020-08-31 11:14:07.991087349 +0200
220+++ rpm-4.16.0/fileattrs/python.attr 2020-10-03 10:47:16.560360859 +0200
221@@ -14,14 +14,15 @@
222 %__python_requires() %{lua:
223 -- Match buildroot paths of the form
224 -- /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and
225- -- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/
226+ -- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ and
227+ -- /PATH/OF/BUILDROOT/usr/libx32/pythonMAJOR.MINOR/
228 -- generating a line of the form:
229 -- python(abi) = MAJOR.MINOR
230 local path = rpm.expand('%1')
231- if path:match('/usr/lib%d*/python%d+%.%d+/.*') then
232- local requires = path:gsub('.*/usr/lib%d*/python(%d+%.%d+)/.*', 'python(abi) = %1')
233+ if path:match('/usr/lib%w*/python%d+%.%d+/.*') then
234+ local requires = path:gsub('.*/usr/lib%w*/python(%d+%.%d+)/.*', 'python(abi) = %1')
235 print(requires)
236 end
237 }
238
239-%__python_path ^((%{_prefix}/lib(64)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$
240+%__python_path ^((%{_prefix}/lib(64|x32)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$
This page took 0.07965 seconds and 4 git commands to generate.