- make python deps generators work on x32
[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 }
83a0601a
JR
25diff -ur rpm-4.15.1.orig/build/rpmfc.h rpm-4.15.1/build/rpmfc.h
26--- rpm-4.15.1.orig/build/rpmfc.h 2019-06-26 16:17:31.397985717 +0200
27+++ rpm-4.15.1/build/rpmfc.h 2019-12-29 13:45:05.936980833 +0100
28@@ -26,8 +26,9 @@
321b78b0
JR
29 RPMFC_BLACK = 0,
30 RPMFC_ELF32 = (1 << 0),
31 RPMFC_ELF64 = (1 << 1),
32+ RPMFC_ELFX32 = (1 << 2),
33 RPMFC_ELFMIPSN32 = (1 << 2),
34-#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
35+#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFX32|RPMFC_ELFMIPSN32)
36 /* (1 << 3) leaks into package headers, reserved */
37
83a0601a
JR
38 RPMFC_WHITE = (1 << 29),
39diff -ur rpm-4.15.1.orig/configure.ac rpm-4.15.1/configure.ac
40--- rpm-4.15.1.orig/configure.ac 2019-12-29 14:07:19.813977936 +0100
41+++ rpm-4.15.1/configure.ac 2019-12-29 14:27:41.381850928 +0100
42@@ -1050,6 +1050,9 @@
43 host_os=`echo "${host_os}" | sed 's/-gnueabi$//'`
44 host_os_gnu=-gnueabi
45 fi
46+if echo "$host_os" | grep '.*-gnux32' > /dev/null ; then
47+ host_os=`echo "${host_os}" | sed 's/-gnux32$//'`
48+fi
49 if echo "$host_os" | grep '.*-gnu' > /dev/null ; then
50 host_os=`echo "${host_os}" | sed 's/-gnu$//'`
51 fi
83a0601a
JR
52diff -ur rpm-4.15.1.orig/installplatform rpm-4.15.1/installplatform
53--- rpm-4.15.1.orig/installplatform 2019-06-26 16:17:31.404985707 +0200
54+++ rpm-4.15.1/installplatform 2019-12-29 14:52:09.331085139 +0100
55@@ -21,6 +21,7 @@
56
57 ARCH_INSTALL_POST='%{nil}'
58 LIB=lib
59+ TARGETCPU="%{_target_cpu}"
60
61 # XXX FIXME: incomplete and quite likely wrong too in places,
62 # consult various arch folks for correct names etc.
63@@ -82,7 +83,15 @@
64 ISANAME=x86
65 ISABITS=64
66 CANONARCH=x86_64
67+ CANONCOLOR=7
68+ ;;
69+ x32)
70+ ISANAME=x86
71+ ISABITS=32
72+ CANONARCH=x32
73 CANONCOLOR=3
74+ RPMRC_GNU="${RPMRC_GNU}x32"
75+ TARGETCPU="x86_64"
76 ;;
77 ia64)
78 ISANAME=ia
79@@ -190,10 +199,14 @@
80 # skip architectures for which we dont have full config parameters
81 [ -z "$CANONARCH" ] && continue
82
83- if [ "$OS" = "linux" ] && [ "$CANONCOLOR" = 3 ]; then
84+ if [ "$OS" = "linux" ] && [ "$CANONARCH" = "x86_64" ]; then
85 LIB=${LIB}64
86 fi
87
88+ if [ "$OS" = "linux" ] && [ "$CANONARCH" = "x32" ]; then
89+ LIB=${LIB}x32
90+ fi
91+
92 PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}"
93 [ -d $PPD ] || mkdir -p $PPD
94
95@@ -202,6 +215,7 @@
96 -e "s,@RPMCANONARCH@,$CANONARCH,g" \
97 -e "s,@RPMCANONCOLOR@,$CANONCOLOR," \
98 -e "s,@RPMRC_GNU@,$RPMRC_GNU," \
99+ -e "s,@TARGETCPU@,$TARGETCPU," \
100 -e "s,@LIB@,$LIB," \
101 -e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \
102 -e '/\${\w*:-/!s,\${,%{_,' \
103diff -ur rpm-4.15.1.orig/platform.in rpm-4.15.1/platform.in
104--- rpm-4.15.1.orig/platform.in 2019-11-13 10:19:29.371710954 +0100
105+++ rpm-4.15.1/platform.in 2019-12-29 14:47:30.886959421 +0100
106@@ -8,7 +8,7 @@
107 %_vendor @RPMCANONVENDOR@
108 %_os @RPMCANONOS@
109 %_gnu @RPMRC_GNU@
110-%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}
111+%_target_platform @TARGETCPU@-%{_vendor}-%{_target_os}%{?_gnu}
112 %optflags @RPMRC_OPTFLAGS@
113
114 %__isa_name @ISANAME@
115diff -ur rpm-4.15.1.orig/rpmrc.in rpm-4.15.1/rpmrc.in
116--- rpm-4.15.1.orig/rpmrc.in 2019-11-13 10:19:29.418711227 +0100
117+++ rpm-4.15.1/rpmrc.in 2019-12-29 14:51:20.293119352 +0100
118@@ -24,6 +24,7 @@
119 optflags: x86_64 -O2 -g
120 optflags: amd64 -O2 -g
121 optflags: ia32e -O2 -g
122+optflags: x32 -O2 -g -mtune=generic -march=x86-64
123
124 optflags: alpha -O2 -g -mieee
125 optflags: alphaev5 -O2 -g -mieee -mtune=ev5
126@@ -155,6 +156,8 @@
127
128 archcolor: riscv64 2
129
130+archcolor: x32 4
131+
132 #############################################################
133 # Canonical arch names and numbers
134
135@@ -170,6 +173,7 @@
136 arch_canon: amd64: amd64 1
137 arch_canon: ia32e: ia32e 1
138 arch_canon: em64t: em64t 1
139+arch_canon: x32: x32 1
140
141 arch_canon: alpha: alpha 2
142 arch_canon: alphaev5: alphaev5 2
143@@ -379,6 +383,8 @@
144 buildarchtranslate: amd64: x86_64
145 buildarchtranslate: ia32e: x86_64
146
147+buildarchtranslate: x32: x32
148+
149 buildarchtranslate: sh3: sh3
150 buildarchtranslate: sh4: sh4
151 buildarchtranslate: sh4a: sh4
152@@ -490,6 +496,8 @@
153 arch_compat: amd64: x86_64 em64t athlon noarch
154 arch_compat: ia32e: x86_64 em64t athlon noarch
155
156+arch_compat: x32: x32 noarch
157+
158 arch_compat: sh3: noarch
159 arch_compat: sh4: noarch
160 arch_compat: sh4a: sh4
161@@ -628,6 +636,8 @@
162 buildarch_compat: amd64: x86_64
163 buildarch_compat: ia32e: x86_64
164
165+buildarch_compat: x32: noarch
166+
167 buildarch_compat: sh3: noarch
168 buildarch_compat: sh4: noarch
169 buildarch_compat: sh4a: sh4
170diff -ur rpm-4.15.1.orig/tools/elfdeps.c rpm-4.15.1/tools/elfdeps.c
171--- rpm-4.15.1.orig/tools/elfdeps.c 2019-06-26 16:17:31.462985619 +0200
172+++ rpm-4.15.1/tools/elfdeps.c 2019-12-29 14:22:05.339471071 +0100
173@@ -94,6 +94,9 @@
174 break;
175 }
176 }
177+ if ((ehdr->e_ident[EI_CLASS] == ELFCLASS32) && (ehdr->e_machine == EM_X86_64)) {
178+ marker = "(x32bit)";
179+ }
180 return marker;
181 }
182
b2ff08d9
JR
183--- rpm-4.15.1/fileattrs/python.attr~ 2019-06-26 23:17:31.000000000 +0900
184+++ rpm-4.15.1/fileattrs/python.attr 2020-01-04 23:33:40.929651751 +0900
185@@ -1,4 +1,4 @@
186 %__python_provides %{_rpmconfigdir}/pythondeps.sh --provides
187 %__python_requires %{_rpmconfigdir}/pythondeps.sh --requires
188-%__python_path ((/lib(64)?/python[[:digit:]]\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(^%{_bindir}/python[[:digit:]]\\.[[:digit:]]+))$
189+%__python_path ((/lib(64|x32)?/python[[:digit:]]\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(^%{_bindir}/python[[:digit:]]\\.[[:digit:]]+))$
190 %__python_magic [Pp]ython.*(executable|byte-compiled)
191--- rpm-4.15.1/fileattrs/pythondist.attr~ 2019-06-26 23:17:31.000000000 +0900
192+++ rpm-4.15.1/fileattrs/pythondist.attr 2020-01-04 23:34:05.680366882 +0900
193@@ -1,3 +1,3 @@
194 %__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides
195 %__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires
196-%__pythondist_path /lib(64)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$
197+%__pythondist_path /lib(64|x32)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$
This page took 0.537196 seconds and 4 git commands to generate.