]> git.pld-linux.org Git - packages/rpm.git/blob - x32.patch
make -lib depend on elfutils-libs instead of elfutils; rel 7
[packages/rpm.git] / x32.patch
1 diff -ur rpm-4.16.1.2/build/rpmfc.c rpm-4.16.1.2.x32/build/rpmfc.c
2 --- rpm-4.16.1.2/build/rpmfc.c  2021-03-21 21:51:28.231530270 +0100
3 +++ rpm-4.16.1.2.x32/build/rpmfc.c      2021-03-21 21:50:04.127398387 +0100
4 @@ -641,6 +641,7 @@
5  
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  
10    { "troff or preprocessor input",     RPMFC_INCLUDE },
11    { "GNU Info",                        RPMFC_INCLUDE },
12 @@ -746,7 +747,11 @@
13         if (strstr(fmstr, fct->token) == NULL)
14             continue;
15  
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))
19 +           fcolor |= RPMFC_ELFX32|RPMFC_INCLUDE;
20 +       else
21 +           fcolor |= fct->colors;
22         if (fcolor & RPMFC_INCLUDE)
23             break;
24      }
25 @@ -1147,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);
37 diff -ur rpm-4.16.1.2/build/rpmfc.h rpm-4.16.1.2.x32/build/rpmfc.h
38 --- rpm-4.16.1.2/build/rpmfc.h  2020-05-28 12:04:25.011136544 +0200
39 +++ rpm-4.16.1.2.x32/build/rpmfc.h      2021-03-21 21:50:04.127398387 +0100
40 @@ -26,8 +26,9 @@
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  
50      RPMFC_WHITE                        = (1 << 29),
51 diff -ur rpm-4.16.1.2/configure.ac rpm-4.16.1.2.x32/configure.ac
52 --- rpm-4.16.1.2/configure.ac   2021-03-21 21:51:28.221530479 +0100
53 +++ rpm-4.16.1.2.x32/configure.ac       2021-03-21 21:50:04.127398387 +0100
54 @@ -930,6 +930,10 @@
55  if echo "$host_os" | grep '.*-gnu' > /dev/null ; then
56         host_os=`echo "${host_os}" | sed 's/-gnu$//'`
57  fi
58 +if echo "$host_os" | grep '.*-gnux32' > /dev/null ; then
59 +       host_os=`echo "${host_os}" | sed 's/-gnux32$//'`
60 +       host_os_gnu=-gnux32
61 +fi
62  
63  changequote(<, >)
64  host_os_exact="${host_os}"
65 diff -ur rpm-4.16.1.2/installplatform rpm-4.16.1.2.x32/installplatform
66 --- rpm-4.16.1.2/installplatform        2020-05-28 12:04:25.027136631 +0200
67 +++ rpm-4.16.1.2.x32/installplatform    2021-03-21 21:51:47.671145954 +0100
68 @@ -21,6 +21,9 @@
69  
70    ARCH_INSTALL_POST='%{nil}'
71    LIB=lib
72 +  TARGETCPU="%{_target_cpu}"
73 +  APPEND_TARGET_ABI=
74 +  PREFERCOLOR=
75  
76    # XXX FIXME: incomplete and quite likely wrong too in places,
77    # consult various arch folks for correct names etc.
78 @@ -82,7 +84,16 @@
79         ISANAME=x86
80         ISABITS=64
81         CANONARCH=x86_64
82 -       CANONCOLOR=3
83 +       CANONCOLOR=7
84 +       ;;
85 +    x32)
86 +       ISANAME=x86
87 +       ISABITS=x32
88 +       CANONARCH=x32
89 +       CANONCOLOR=7
90 +       APPEND_TARGET_ABI=1
91 +       TARGETCPU="x86_64"
92 +       PREFERCOLOR=4
93         ;;
94      ia64)
95         ISANAME=ia
96 @@ -190,10 +200,14 @@
97    # skip architectures for which we dont have full config parameters
98    [ -z "$CANONARCH" ] && continue
99  
100 -  if [ "$OS" = "linux" ] && [ "$CANONCOLOR" = 3 ]; then
101 +  if [ "$OS" = "linux" ] && ( [ "$CANONCOLOR" = 3 ] || [ "$CANONARCH" = "x86_64" ] ); then
102        LIB=${LIB}64
103    fi
104  
105 +  if [ "$OS" = "linux" ] && [ "$CANONARCH" = "x32" ]; then
106 +      LIB=${LIB}x32
107 +  fi
108 +
109    PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}"
110    [ -d $PPD ] || mkdir -p $PPD
111  
112 @@ -202,7 +216,10 @@
113    | sed -e "s,@RPMRC_OPTFLAGS@,$RPMRC_OPTFLAGS," \
114         -e "s,@RPMCANONARCH@,$CANONARCH,g" \
115         -e "s,@RPMCANONCOLOR@,$CANONCOLOR," \
116 +       -e "s,@RPMPREFERCOLOR@,${PREFERCOLOR:+%_prefer_color\\t$PREFERCOLOR}," \
117         -e "s,@RPMRC_GNU@,$RPMRC_GNU," \
118 +       -e "s,@TARGET_ABI@,${APPEND_TARGET_ABI:+%{?_gnu\}}," \
119 +       -e "s,@TARGETCPU@,$TARGETCPU," \
120         -e "s,@LIB@,$LIB," \
121         -e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \
122         -e '/\${\w*:-/!s,\${,%{_,' \
123 diff -ur rpm-4.16.1.2/platform.in rpm-4.16.1.2.x32/platform.in
124 --- rpm-4.16.1.2/platform.in    2020-05-28 12:04:25.047136741 +0200
125 +++ rpm-4.16.1.2.x32/platform.in        2021-03-21 21:51:47.671145954 +0100
126 @@ -8,7 +8,7 @@
127  %_vendor               @RPMCANONVENDOR@
128  %_os                   @RPMCANONOS@
129  %_gnu                  @RPMRC_GNU@
130 -%_target_platform      %{_target_cpu}-%{_vendor}-%{_target_os}
131 +%_target_platform      @TARGETCPU@-%{_vendor}-%{_target_os}@TARGET_ABI@
132  %optflags              @RPMRC_OPTFLAGS@
133  
134  %__isa_name            @ISANAME@
135 @@ -21,6 +21,7 @@
136  #      1       Elf32 permitted
137  #      2       Elf64 permitted
138  %_transaction_color    @RPMCANONCOLOR@
139 +@RPMPREFERCOLOR@
140  
141  #==============================================================================
142  # ---- configure macros.
143 diff -ur rpm-4.16.1.2/rpmrc.in rpm-4.16.1.2.x32/rpmrc.in
144 --- rpm-4.16.1.2/rpmrc.in       2020-05-28 12:04:25.075136894 +0200
145 +++ rpm-4.16.1.2.x32/rpmrc.in   2021-03-21 21:50:04.127398387 +0100
146 @@ -24,6 +24,7 @@
147  optflags: x86_64 -O2 -g
148  optflags: amd64 -O2 -g
149  optflags: ia32e -O2 -g
150 +optflags: x32 -O2 -g -mtune=generic -march=x86-64
151  
152  optflags: alpha -O2 -g -mieee
153  optflags: alphaev5 -O2 -g -mieee -mtune=ev5
154 @@ -155,6 +156,8 @@
155  
156  archcolor: riscv64 2
157  
158 +archcolor: x32 4
159 +
160  #############################################################
161  # Canonical arch names and numbers
162  
163 @@ -170,6 +173,7 @@
164  arch_canon:    amd64:  amd64   1
165  arch_canon:    ia32e:  ia32e   1
166  arch_canon:    em64t:  em64t   1
167 +arch_canon:    x32: x32        1
168  
169  arch_canon:    alpha:  alpha   2
170  arch_canon:    alphaev5: alphaev5      2
171 @@ -379,6 +383,8 @@
172  buildarchtranslate: amd64: x86_64
173  buildarchtranslate: ia32e: x86_64
174  
175 +buildarchtranslate: x32: x32
176 +
177  buildarchtranslate: sh3: sh3
178  buildarchtranslate: sh4: sh4
179  buildarchtranslate: sh4a: sh4
180 @@ -486,10 +492,12 @@
181  
182  arch_compat: ia64: noarch
183  
184 -arch_compat: x86_64: amd64 em64t athlon noarch
185 +arch_compat: x86_64: amd64 em64t athlon x32 noarch
186  arch_compat: amd64: x86_64 em64t athlon noarch
187  arch_compat: ia32e: x86_64 em64t athlon noarch
188  
189 +arch_compat: x32: x32 x86_64 noarch
190 +
191  arch_compat: sh3: noarch
192  arch_compat: sh4: noarch
193  arch_compat: sh4a: sh4
194 @@ -628,6 +636,8 @@
195  buildarch_compat: amd64: x86_64
196  buildarch_compat: ia32e: x86_64
197  
198 +buildarch_compat: x32: noarch
199 +
200  buildarch_compat: sh3: noarch
201  buildarch_compat: sh4: noarch
202  buildarch_compat: sh4a: sh4
203 diff -ur rpm-4.16.1.2/tools/elfdeps.c rpm-4.16.1.2.x32/tools/elfdeps.c
204 --- rpm-4.16.1.2/tools/elfdeps.c        2020-05-28 12:04:25.084136944 +0200
205 +++ rpm-4.16.1.2.x32/tools/elfdeps.c    2021-03-21 21:50:04.127398387 +0100
206 @@ -94,6 +94,9 @@
207             break;
208         }
209      }
210 +    if ((ehdr->e_ident[EI_CLASS] == ELFCLASS32) && (ehdr->e_machine == EM_X86_64)) {
211 +       marker = "(x32bit)";
212 +    }
213      return marker;
214  }
215  
This page took 0.0629 seconds and 4 git commands to generate.