X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm.git;a=blobdiff_plain;f=x32.patch;h=a97fdb785d9a18148159ce0fe7836288578cbeb1;hp=773e383a4ef0dd2fba6bb9eb06688c15f13e4a28;hb=88a3e11;hpb=321b78b0cc66c33e93cebe6b2689d98febe1404f diff --git a/x32.patch b/x32.patch index 773e383..a97fdb7 100644 --- a/x32.patch +++ b/x32.patch @@ -1,43 +1,43 @@ ---- rpm-5.4.15/configure.ac~ 2014-12-20 16:50:32.000000000 +0100 -+++ rpm-5.4.15/configure.ac 2014-12-20 16:54:38.036853187 +0100 -@@ -2200,8 +2200,9 @@ - case "${target_cpu}" in - *86) RPMCANONARCH=i386 ;; - ia32e*) RPMCANONARCH=ia32e ;; --amd64*) RPMCANONARCH=amd64 ;; --x86_64*) RPMCANONARCH=x86_64 ;; -+amd64*) RPMCANONCOLOR=7; RPMCANONARCH=amd64 ;; -+x86_64*) RPMCANONCOLOR=7; RPMCANONARCH=x86_64 ;; -+x32) RPMCANONARCH=x32 ;; - alpha*) RPMCANONARCH=alpha ;; - sparc64*) RPMCANONARCH=sparc64 ;; - sparc*) RPMCANONARCH=sparc ;; ---- rpm-5.4.15/lib/rpmfc.c.orig 2014-12-20 16:50:32.000000000 +0100 -+++ rpm-5.4.15/lib/rpmfc.c 2014-12-20 18:32:11.641808153 +0100 -@@ -581,6 +581,7 @@ - { "MIPS, N32 MIPS32", RPMFC_ELFMIPSN32|RPMFC_INCLUDE }, +diff -ur rpm-4.16.1.2/build/rpmfc.c rpm-4.16.1.2.x32/build/rpmfc.c +--- rpm-4.16.1.2/build/rpmfc.c 2021-03-21 21:51:28.231530270 +0100 ++++ rpm-4.16.1.2.x32/build/rpmfc.c 2021-03-21 21:50:04.127398387 +0100 +@@ -641,6 +641,7 @@ + { "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE }, { "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE }, +// { "ELF 32-bit", RPMFC_ELFX32|RPMFC_INCLUDE }, - { " script", RPMFC_SCRIPT }, - { " text", RPMFC_TEXT }, -@@ -685,7 +686,11 @@ - for (fct = rpmfcTokens; fct->token != NULL; fct++) { + { "troff or preprocessor input", RPMFC_INCLUDE }, + { "GNU Info", RPMFC_INCLUDE }, +@@ -746,7 +747,11 @@ if (strstr(fmstr, fct->token) == NULL) continue; + - fcolor |= fct->colors; + // This is a nasty hack, but will have to do for now + if ((fct->colors & RPMFC_ELF32) && (strstr(fmstr, "x86-64") != NULL)) -+ fcolor |= RPMFC_ELFX32|RPMFC_INCLUDE; ++ fcolor |= RPMFC_ELFX32|RPMFC_INCLUDE; + else -+ fcolor |= fct->colors; ++ fcolor |= fct->colors; if (fcolor & RPMFC_INCLUDE) - return fcolor; + break; } ---- rpm-5.4.15/lib/rpmfc.h.orig 2014-12-20 17:51:48.584934979 +0100 -+++ rpm-5.4.15/lib/rpmfc.h 2014-12-20 17:56:14.690160030 +0100 -@@ -20,8 +20,9 @@ +@@ -1147,7 +1152,10 @@ + color = RPMFC_ELF64; + break; + case ELFCLASS32: +- color = RPMFC_ELF32; ++ if (ehdr.e_machine == EM_X86_64) ++ color = RPMFC_ELFX32; ++ else ++ color = RPMFC_ELF32; + break; + } + elf_end(elf); +diff -ur rpm-4.16.1.2/build/rpmfc.h rpm-4.16.1.2.x32/build/rpmfc.h +--- rpm-4.16.1.2/build/rpmfc.h 2020-05-28 12:04:25.011136544 +0200 ++++ rpm-4.16.1.2.x32/build/rpmfc.h 2021-03-21 21:50:04.127398387 +0100 +@@ -26,8 +26,9 @@ RPMFC_BLACK = 0, RPMFC_ELF32 = (1 << 0), RPMFC_ELF64 = (1 << 1), @@ -47,170 +47,183 @@ +#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFX32|RPMFC_ELFMIPSN32) /* (1 << 3) leaks into package headers, reserved */ - RPMFC_DESKTOP_FILE = (1 << 4), -diff -ur rpm-5.4.15/autodeps/linux.prov rpm-5.4.15.x32/autodeps/linux.prov ---- rpm-5.4.15/autodeps/linux.prov 2010-03-18 10:54:56.000000000 +0100 -+++ rpm-5.4.15.x32/autodeps/linux.prov 2014-12-20 19:18:57.339941715 +0100 -@@ -16,8 +16,12 @@ - - # - # --- Alpha does not mark 64bit dependencies -+# --- Only x86_64 has x32bit dependencies -+markx32="" - case `uname -m` in - alpha*) mark64="" ;; -+ x86_64) markx32="()(x32bit)" -+ mark64="()(64bit)" ;; - *) mark64="()(64bit)" ;; - esac - -@@ -28,6 +32,10 @@ - - lib64=`if file -L $f 2>/dev/null | \ - grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` -+ libx32=`if file -L $f 2>/dev/null | \ -+ grep "ELF 32-bit.*x86-64" > /dev/null; \ -+ then echo "$markx32"; fi` -+ lib64="$lib64$libx32" - if [ "$soname" != "" ]; then - if [ ! -L $f ]; then - echo $soname$lib64 -Only in rpm-5.4.15.x32/autodeps: linux.prov.orig -diff -ur rpm-5.4.15/autodeps/linux.req rpm-5.4.15.x32/autodeps/linux.req ---- rpm-5.4.15/autodeps/linux.req 2010-03-18 10:54:56.000000000 +0100 -+++ rpm-5.4.15.x32/autodeps/linux.req 2014-12-20 19:20:04.622910545 +0100 -@@ -38,8 +38,12 @@ - - # - # --- Alpha does not mark 64bit dependencies -+# --- Only x86_64 has x32bit dependencies -+markx32="" - case `uname -m` in - alpha*) mark64="" ;; -+ x86_64) markx32="()(x32bit)" -+ mark64="()(64bit)" ;; - *) mark64="()(64bit)" ;; - esac - -@@ -50,6 +54,9 @@ - [ -r $f -a -x $f ] || continue - lib64=`if file -L $f 2>/dev/null | \ - grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` -+ libx32=`if file -L $f 2>/dev/null | \ -+ grep "ELF 32-bit.*x86-64" >/dev/null; then echo "$markx32"; fi` -+ lib64="$lib64$libx32" - ldd $f | awk '/=>/ { - if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) { - gsub(/'\''"/,"\\&",$1); -@@ -64,6 +71,9 @@ - [ -r $f ] || continue - lib64=`if file -L $f 2>/dev/null | \ - grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` -+ libx32=`if file -L $f 2>/dev/null | \ -+ grep "ELF 32-bit.*x86-64" >/dev/null; then echo "$markx32"; fi` -+ lib64="$lib64$libx32" - ldd $f | awk '/=>/ { - if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) { - gsub(/'\''"/,"\\&",$1); -@@ -98,6 +108,9 @@ - [ -r $f ] || continue - lib64=`if file -L $f 2>/dev/null | \ - grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` -+ libx32=`if file -L $f 2>/dev/null | \ -+ grep "ELF 32-bit.*x86-64" >/dev/null; then echo "$markx32"; fi` -+ lib64="$lib64$libx32" - $OBJDUMP -p $f | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; } - /^$/ { START=0; } - /^Dynamic Section:$/ { START=1; } -diff -ur rpm-5.4.15/lib/rpmds.c rpm-5.4.15.x32/lib/rpmds.c ---- rpm-5.4.15/lib/rpmds.c 2014-12-20 19:35:31.114557975 +0100 -+++ rpm-5.4.15.x32/lib/rpmds.c 2014-12-20 19:34:54.958087185 +0100 -@@ -2922,19 +2922,26 @@ - * @retval t soname dependency - * @param s elf string (NULL uses "") - * @param isElf64 is this an ELF64 symbol? -+ * @param isX32 is this an X32 symbol? - */ - #if defined(HAVE_GELF_H) && defined(HAVE_LIBELF) && !defined(__FreeBSD__) --static char * sonameDep(/*@returned@*/ char * t, const char * s, int isElf64) -+static char * sonameDep(/*@returned@*/ char * t, const char * s, int isElf64, int isX32) - /*@modifies t @*/ - { - *t = '\0'; - #if !defined(__alpha__) && !defined(__sun) - if (isElf64) { - if (s[strlen(s)-1] != ')') - (void) stpcpy( stpcpy(t, s), "()(64bit)"); - else - (void) stpcpy( stpcpy(t, s), "(64bit)"); - }else -+ if (isX32) { -+ if (s[strlen(s)-1] != ')') -+ (void) stpcpy( stpcpy(t, s), "()(x32bit)"); -+ else -+ (void) stpcpy( stpcpy(t, s), "(x32bit)"); -+ } else - #endif - (void) stpcpy(t, s); - return t; -@@ -2967,6 +2975,7 @@ - char * t; - int xx; - int isElf64; -+ int isX32; - int isDSO; - int gotSONAME = 0; - int gotDEBUG = 0; -@@ -3009,6 +3018,7 @@ - /*@=evalorder@*/ - - isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64; -+ isX32 = (ehdr->e_ident[EI_CLASS] == ELFCLASS32) && (ehdr->e_machine == EM_X86_64); - isDSO = ehdr->e_type == ET_DYN; - - /*@-uniondef @*/ -@@ -3110,7 +3120,7 @@ - - /* Add next provide dependency. */ - ds = rpmdsSingle(RPMTAG_PROVIDES, -- sonameDep(t, buf, isElf64), -+ sonameDep(t, buf, isElf64, isX32), - "", RPMSENSE_FIND_PROVIDES); - xx = add(context, ds); - (void)rpmdsFree(ds); -@@ -3163,7 +3173,7 @@ - - /* Add next require dependency. */ - ds = rpmdsSingle(RPMTAG_REQUIRENAME, -- sonameDep(t, buf, isElf64), -+ sonameDep(t, buf, isElf64, isX32), - "", RPMSENSE_FIND_REQUIRES); - xx = add(context, ds); - (void)rpmdsFree(ds); -@@ -3205,7 +3215,7 @@ - assert(s != NULL); - buf[0] = '\0'; - ds = rpmdsSingle(RPMTAG_REQUIRENAME, -- sonameDep(buf, s, isElf64), -+ sonameDep(buf, s, isElf64, isX32), - "", RPMSENSE_FIND_REQUIRES); - xx = add(context, ds); - (void)rpmdsFree(ds); -@@ -3220,7 +3230,7 @@ - /* Add next provide dependency. */ - buf[0] = '\0'; - ds = rpmdsSingle(RPMTAG_PROVIDENAME, -- sonameDep(buf, s, isElf64), -+ sonameDep(buf, s, isElf64, isX32), - "", RPMSENSE_FIND_PROVIDES); - xx = add(context, ds); - (void)rpmdsFree(ds); -@@ -3256,7 +3266,7 @@ - /* Add next provide dependency. */ - buf[0] = '\0'; - ds = rpmdsSingle(RPMTAG_PROVIDENAME, -- sonameDep(buf, s, isElf64), "", RPMSENSE_FIND_PROVIDES); -+ sonameDep(buf, s, isElf64, isX32), "", RPMSENSE_FIND_PROVIDES); - xx = add(context, ds); - (void)rpmdsFree(ds); - ds = NULL; + RPMFC_WHITE = (1 << 29), +diff -ur rpm-4.16.1.2/configure.ac rpm-4.16.1.2.x32/configure.ac +--- rpm-4.16.1.2/configure.ac 2021-03-21 21:51:28.221530479 +0100 ++++ rpm-4.16.1.2.x32/configure.ac 2021-03-21 21:50:04.127398387 +0100 +@@ -930,6 +930,10 @@ + host_os=`echo "${host_os}" | sed 's/-gnueabi$//'` + host_os_gnu=-gnueabi + fi ++if echo "$host_os" | grep '.*-gnux32' > /dev/null ; then ++ host_os=`echo "${host_os}" | sed 's/-gnux32$//'` ++ host_os_gnu=-gnux32 ++fi + if echo "$host_os" | grep '.*-gnu' > /dev/null ; then + host_os=`echo "${host_os}" | sed 's/-gnu$//'` + fi +diff -ur rpm-4.16.1.2/fileattrs/python.attr rpm-4.16.1.2.x32/fileattrs/python.attr +--- rpm-4.16.1.2/fileattrs/python.attr 2020-08-31 11:14:07.991087349 +0200 ++++ rpm-4.16.1.2.x32/fileattrs/python.attr 2021-03-21 21:50:04.127398387 +0100 +@@ -14,14 +14,15 @@ + %__python_requires() %{lua: + -- Match buildroot paths of the form + -- /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and +- -- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ ++ -- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ and ++ -- /PATH/OF/BUILDROOT/usr/libx32/pythonMAJOR.MINOR/ + -- generating a line of the form: + -- python(abi) = MAJOR.MINOR + local path = rpm.expand('%1') +- if path:match('/usr/lib%d*/python%d+%.%d+/.*') then +- local requires = path:gsub('.*/usr/lib%d*/python(%d+%.%d+)/.*', 'python(abi) = %1') ++ if path:match('/usr/lib%w*/python%d+%.%d+/.*') then ++ local requires = path:gsub('.*/usr/lib%w*/python(%d+%.%d+)/.*', 'python(abi) = %1') + print(requires) + end + } + +-%__python_path ^((%{_prefix}/lib(64)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$ ++%__python_path ^((%{_prefix}/lib(64|x32)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$ +diff -ur rpm-4.16.1.2/fileattrs/pythondist.attr rpm-4.16.1.2.x32/fileattrs/pythondist.attr +--- rpm-4.16.1.2/fileattrs/pythondist.attr 2020-05-28 12:04:25.026136626 +0200 ++++ rpm-4.16.1.2.x32/fileattrs/pythondist.attr 2021-03-21 21:50:04.127398387 +0100 +@@ -1,3 +1,3 @@ + %__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides + %__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires +-%__pythondist_path /lib(64)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$ ++%__pythondist_path /lib(64|x32)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$ +diff -ur rpm-4.16.1.2/installplatform rpm-4.16.1.2.x32/installplatform +--- rpm-4.16.1.2/installplatform 2020-05-28 12:04:25.027136631 +0200 ++++ rpm-4.16.1.2.x32/installplatform 2021-03-21 21:51:47.671145954 +0100 +@@ -21,6 +21,8 @@ + + ARCH_INSTALL_POST='%{nil}' + LIB=lib ++ TARGETCPU="%{_target_cpu}" ++ FORCE_RPMRC_GNU= + + # XXX FIXME: incomplete and quite likely wrong too in places, + # consult various arch folks for correct names etc. +@@ -75,7 +77,15 @@ + ISANAME=x86 + ISABITS=64 + CANONARCH=x86_64 +- CANONCOLOR=3 ++ CANONCOLOR=7 ++ ;; ++ x32) ++ ISANAME=x86 ++ ISABITS=x32 ++ CANONARCH=x32 ++ CANONCOLOR=7 ++ FORCE_RPMRC_GNU="%{?_gnu}" ++ TARGETCPU="x86_64" + ;; + ia64) + ISANAME=ia +@@ -190,6 +201,10 @@ + LIB=${LIB}64 + fi + ++ if [ "$OS" = "linux" ] && [ "$CANONARCH" = "x32" ]; then ++ LIB=${LIB}x32 ++ fi ++ + PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}" + [ -d $PPD ] || mkdir -p $PPD + +@@ -202,6 +221,8 @@ + -e "s,@RPMCANONARCH@,$CANONARCH,g" \ + -e "s,@RPMCANONCOLOR@,$CANONCOLOR," \ + -e "s,@RPMRC_GNU@,$RPMRC_GNU," \ ++ -e "s,@FORCE_RPMRC_GNU@,$FORCE_RPMRC_GNU," \ ++ -e "s,@TARGETCPU@,$TARGETCPU," \ + -e "s,@LIB@,$LIB," \ + -e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \ + -e '/\${\w*:-/!s,\${,%{_,' \ +diff -ur rpm-4.16.1.2/platform.in rpm-4.16.1.2.x32/platform.in +--- rpm-4.16.1.2/platform.in 2020-05-28 12:04:25.047136741 +0200 ++++ rpm-4.16.1.2.x32/platform.in 2021-03-21 21:51:47.671145954 +0100 +@@ -8,7 +8,7 @@ + %_vendor @RPMCANONVENDOR@ + %_os @RPMCANONOS@ + %_gnu @RPMRC_GNU@ +-%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os} ++%_target_platform @TARGETCPU@-%{_vendor}-%{_target_os}@FORCE_RPMRC_GNU@ + %optflags @RPMRC_OPTFLAGS@ + + %__isa_name @ISANAME@ +diff -ur rpm-4.16.1.2/rpmrc.in rpm-4.16.1.2.x32/rpmrc.in +--- rpm-4.16.1.2/rpmrc.in 2020-05-28 12:04:25.075136894 +0200 ++++ rpm-4.16.1.2.x32/rpmrc.in 2021-03-21 21:50:04.127398387 +0100 +@@ -24,6 +24,7 @@ + optflags: x86_64 -O2 -g + optflags: amd64 -O2 -g + optflags: ia32e -O2 -g ++optflags: x32 -O2 -g -mtune=generic -march=x86-64 + + optflags: alpha -O2 -g -mieee + optflags: alphaev5 -O2 -g -mieee -mtune=ev5 +@@ -155,6 +156,8 @@ + + archcolor: riscv64 2 + ++archcolor: x32 4 ++ + ############################################################# + # Canonical arch names and numbers + +@@ -170,6 +173,7 @@ + arch_canon: amd64: amd64 1 + arch_canon: ia32e: ia32e 1 + arch_canon: em64t: em64t 1 ++arch_canon: x32: x32 1 + + arch_canon: alpha: alpha 2 + arch_canon: alphaev5: alphaev5 2 +@@ -379,6 +383,8 @@ + buildarchtranslate: amd64: x86_64 + buildarchtranslate: ia32e: x86_64 + ++buildarchtranslate: x32: x32 ++ + buildarchtranslate: sh3: sh3 + buildarchtranslate: sh4: sh4 + buildarchtranslate: sh4a: sh4 +@@ -486,10 +492,12 @@ + + arch_compat: ia64: noarch + +-arch_compat: x86_64: amd64 em64t athlon noarch ++arch_compat: x86_64: amd64 em64t athlon x32 noarch + arch_compat: amd64: x86_64 em64t athlon noarch + arch_compat: ia32e: x86_64 em64t athlon noarch + ++arch_compat: x32: x32 x86_64 noarch ++ + arch_compat: sh3: noarch + arch_compat: sh4: noarch + arch_compat: sh4a: sh4 +@@ -628,6 +636,8 @@ + buildarch_compat: amd64: x86_64 + buildarch_compat: ia32e: x86_64 + ++buildarch_compat: x32: noarch ++ + buildarch_compat: sh3: noarch + buildarch_compat: sh4: noarch + buildarch_compat: sh4a: sh4 +diff -ur rpm-4.16.1.2/tools/elfdeps.c rpm-4.16.1.2.x32/tools/elfdeps.c +--- rpm-4.16.1.2/tools/elfdeps.c 2020-05-28 12:04:25.084136944 +0200 ++++ rpm-4.16.1.2.x32/tools/elfdeps.c 2021-03-21 21:50:04.127398387 +0100 +@@ -94,6 +94,9 @@ + break; + } + } ++ if ((ehdr->e_ident[EI_CLASS] == ELFCLASS32) && (ehdr->e_machine == EM_X86_64)) { ++ marker = "(x32bit)"; ++ } + return marker; + } +