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,9 @@
+@@ -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$//'`
ARCH_INSTALL_POST='%{nil}'
LIB=lib
+ TARGETCPU="%{_target_cpu}"
-+ FORCE_RPMRC_GNU=
++ APPEND_TARGET_ABI=
# XXX FIXME: incomplete and quite likely wrong too in places,
# consult various arch folks for correct names etc.
-@@ -75,7 +77,16 @@
+@@ -82,7 +84,15 @@
ISANAME=x86
ISABITS=64
CANONARCH=x86_64
+ ISABITS=x32
+ CANONARCH=x32
+ CANONCOLOR=7
-+ RPMRC_GNU="gnux32"
-+ FORCE_RPMRC_GNU="%{?_gnu}"
++ APPEND_TARGET_ABI=1
+ TARGETCPU="x86_64"
;;
ia64)
ISANAME=ia
-@@ -190,10 +201,14 @@
+@@ -190,10 +200,14 @@
# skip architectures for which we dont have full config parameters
[ -z "$CANONARCH" ] && continue
- if [ "$OS" = "linux" ] && [ "$CANONCOLOR" = 3 ]; then
-+ if [ "$OS" = "linux" ] && [ "$CANONARCH" = "x86_64" ]; then
++ if [ "$OS" = "linux" ] && ( [ "$CANONCOLOR" = 3 ] || [ "$CANONARCH" = "x86_64" ] ); then
LIB=${LIB}64
fi
PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}"
[ -d $PPD ] || mkdir -p $PPD
-@@ -202,6 +221,8 @@
+@@ -202,6 +216,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,@TARGET_ABI@,${APPEND_TARGET_ABI:+%{?_gnu\}}," \
+ -e "s,@TARGETCPU@,$TARGETCPU," \
-e "s,@LIB@,$LIB," \
-e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \
%_os @RPMCANONOS@
%_gnu @RPMRC_GNU@
-%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}
-+%_target_platform @TARGETCPU@-%{_vendor}-%{_target_os}@FORCE_RPMRC_GNU@
++%_target_platform @TARGETCPU@-%{_vendor}-%{_target_os}@TARGET_ABI@
%optflags @RPMRC_OPTFLAGS@
%__isa_name @ISANAME@