]> git.pld-linux.org Git - packages/rpm.git/blob - x32.patch
- updated x32 patch
[packages/rpm.git] / x32.patch
1 diff -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 @@
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 @@ -696,7 +697,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 diff -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 @@
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  
38      RPMFC_WHITE                        = (1 << 29),
39 diff -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
52 diff -ur rpm-4.15.1.orig/include/rpm/rpmfc.h rpm-4.15.1/include/rpm/rpmfc.h
53 --- rpm-4.15.1.orig/include/rpm/rpmfc.h 2019-12-29 14:10:54.518828249 +0100
54 +++ rpm-4.15.1/include/rpm/rpmfc.h      2019-12-29 13:50:08.747881304 +0100
55 @@ -26,8 +26,9 @@
56      RPMFC_BLACK                        = 0,
57      RPMFC_ELF32                        = (1 <<  0),
58      RPMFC_ELF64                        = (1 <<  1),
59 +    RPMFC_ELFX32               = (1 <<  2),
60      RPMFC_ELFMIPSN32           = (1 <<  2),
61 -#define        RPMFC_ELF       (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
62 +#define        RPMFC_ELF       (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFX32|RPMFC_ELFMIPSN32)
63         /* (1 << 3) leaks into package headers, reserved */
64  
65      RPMFC_WHITE                        = (1 << 29),
66 diff -ur rpm-4.15.1.orig/installplatform rpm-4.15.1/installplatform
67 --- rpm-4.15.1.orig/installplatform     2019-06-26 16:17:31.404985707 +0200
68 +++ rpm-4.15.1/installplatform  2019-12-29 14:52:09.331085139 +0100
69 @@ -21,6 +21,7 @@
70  
71    ARCH_INSTALL_POST='%{nil}'
72    LIB=lib
73 +  TARGETCPU="%{_target_cpu}"
74  
75    # XXX FIXME: incomplete and quite likely wrong too in places,
76    # consult various arch folks for correct names etc.
77 @@ -82,7 +83,15 @@
78         ISANAME=x86
79         ISABITS=64
80         CANONARCH=x86_64
81 +       CANONCOLOR=7
82 +       ;;
83 +    x32)
84 +       ISANAME=x86
85 +       ISABITS=32
86 +       CANONARCH=x32
87         CANONCOLOR=3
88 +       RPMRC_GNU="${RPMRC_GNU}x32"
89 +       TARGETCPU="x86_64"
90         ;;
91      ia64)
92         ISANAME=ia
93 @@ -190,10 +199,14 @@
94    # skip architectures for which we dont have full config parameters
95    [ -z "$CANONARCH" ] && continue
96  
97 -  if [ "$OS" = "linux" ] && [ "$CANONCOLOR" = 3 ]; then
98 +  if [ "$OS" = "linux" ] && [ "$CANONARCH" = "x86_64" ]; then
99        LIB=${LIB}64
100    fi
101  
102 +  if [ "$OS" = "linux" ] && [ "$CANONARCH" = "x32" ]; then
103 +      LIB=${LIB}x32
104 +  fi
105 +
106    PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}"
107    [ -d $PPD ] || mkdir -p $PPD
108  
109 @@ -202,6 +215,7 @@
110         -e "s,@RPMCANONARCH@,$CANONARCH,g" \
111         -e "s,@RPMCANONCOLOR@,$CANONCOLOR," \
112         -e "s,@RPMRC_GNU@,$RPMRC_GNU," \
113 +       -e "s,@TARGETCPU@,$TARGETCPU," \
114         -e "s,@LIB@,$LIB," \
115         -e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \
116         -e '/\${\w*:-/!s,\${,%{_,' \
117 diff -ur rpm-4.15.1.orig/platform.in rpm-4.15.1/platform.in
118 --- rpm-4.15.1.orig/platform.in 2019-11-13 10:19:29.371710954 +0100
119 +++ rpm-4.15.1/platform.in      2019-12-29 14:47:30.886959421 +0100
120 @@ -8,7 +8,7 @@
121  %_vendor               @RPMCANONVENDOR@
122  %_os                   @RPMCANONOS@
123  %_gnu                  @RPMRC_GNU@
124 -%_target_platform      %{_target_cpu}-%{_vendor}-%{_target_os}
125 +%_target_platform      @TARGETCPU@-%{_vendor}-%{_target_os}%{?_gnu}
126  %optflags              @RPMRC_OPTFLAGS@
127  
128  %__isa_name            @ISANAME@
129 diff -ur rpm-4.15.1.orig/rpmrc.in rpm-4.15.1/rpmrc.in
130 --- rpm-4.15.1.orig/rpmrc.in    2019-11-13 10:19:29.418711227 +0100
131 +++ rpm-4.15.1/rpmrc.in 2019-12-29 14:51:20.293119352 +0100
132 @@ -24,6 +24,7 @@
133  optflags: x86_64 -O2 -g
134  optflags: amd64 -O2 -g
135  optflags: ia32e -O2 -g
136 +optflags: x32 -O2 -g -mtune=generic -march=x86-64
137  
138  optflags: alpha -O2 -g -mieee
139  optflags: alphaev5 -O2 -g -mieee -mtune=ev5
140 @@ -155,6 +156,8 @@
141  
142  archcolor: riscv64 2
143  
144 +archcolor: x32 4
145 +
146  #############################################################
147  # Canonical arch names and numbers
148  
149 @@ -170,6 +173,7 @@
150  arch_canon:    amd64:  amd64   1
151  arch_canon:    ia32e:  ia32e   1
152  arch_canon:    em64t:  em64t   1
153 +arch_canon:    x32: x32        1
154  
155  arch_canon:    alpha:  alpha   2
156  arch_canon:    alphaev5: alphaev5      2
157 @@ -379,6 +383,8 @@
158  buildarchtranslate: amd64: x86_64
159  buildarchtranslate: ia32e: x86_64
160  
161 +buildarchtranslate: x32: x32
162 +
163  buildarchtranslate: sh3: sh3
164  buildarchtranslate: sh4: sh4
165  buildarchtranslate: sh4a: sh4
166 @@ -490,6 +496,8 @@
167  arch_compat: amd64: x86_64 em64t athlon noarch
168  arch_compat: ia32e: x86_64 em64t athlon noarch
169  
170 +arch_compat: x32: x32 noarch
171 +
172  arch_compat: sh3: noarch
173  arch_compat: sh4: noarch
174  arch_compat: sh4a: sh4
175 @@ -628,6 +636,8 @@
176  buildarch_compat: amd64: x86_64
177  buildarch_compat: ia32e: x86_64
178  
179 +buildarch_compat: x32: noarch
180 +
181  buildarch_compat: sh3: noarch
182  buildarch_compat: sh4: noarch
183  buildarch_compat: sh4a: sh4
184 diff -ur rpm-4.15.1.orig/tools/elfdeps.c rpm-4.15.1/tools/elfdeps.c
185 --- rpm-4.15.1.orig/tools/elfdeps.c     2019-06-26 16:17:31.462985619 +0200
186 +++ rpm-4.15.1/tools/elfdeps.c  2019-12-29 14:22:05.339471071 +0100
187 @@ -94,6 +94,9 @@
188             break;
189         }
190      }
191 +    if ((ehdr->e_ident[EI_CLASS] == ELFCLASS32) && (ehdr->e_machine == EM_X86_64)) {
192 +       marker = "(x32bit)";
193 +    }
194      return marker;
195  }
196  
This page took 0.041358 seconds and 3 git commands to generate.