From 4a49b19acdca06fd17480594622e8dd3f9ebd4f4 Mon Sep 17 00:00:00 2001 From: x Date: Mon, 13 Apr 2026 17:20:21 +0200 Subject: [PATCH 1/2] fix: add missing archcolor entries for i386-family sub-architectures The archcolor table in rpmrc.in only had an entry for the base "i386" architecture (color 1). Sub-architectures i486, i586, i686, athlon, geode, pentium3, and pentium4 were missing. Every other arch family already lists all sub-architectures: ARM has armv3l through armv8l, x86_64 has x86_64_v2/v3/v4, e2k has e2kv4/v5/v6/etc. rpmGetArchColor() resolves an arch name to its archcolor by first applying lookupInDefaultTable() and then looking up the archcolor variable. The INSTARCH table has hasTranslate=0 (only BUILDARCH has translate entries), so lookupInDefaultTable("i686") returns "i686" unchanged. With no "archcolor: i686" entry, rpmGetArchColor("i686") returned -1. This broke rpmfcCheckPackageColor() (the only existing caller, added in b714dcea3): the build-time check that warns when ELF binaries don't match the package architecture was silently skipped for all i386-family targets because arch_color <= 0 triggered an early return. Add archcolor entries for all i386-family sub-architectures so that rpmGetArchColor() returns the correct value in both BUILDARCH and INSTARCH contexts. --- rpmrc.in | 7 +++++++ tests/rpmgeneral.at | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/rpmrc.in b/rpmrc.in index 8fd0d7ee1..e15a14f65 100644 --- a/rpmrc.in +++ b/rpmrc.in @@ -124,6 +124,13 @@ optflags: e2k2c3 -Wno-error -O3 -g -mtune=elbrus-2c3 archcolor: noarch 0 archcolor: i386 1 +archcolor: i486 1 +archcolor: i586 1 +archcolor: i686 1 +archcolor: athlon 1 +archcolor: geode 1 +archcolor: pentium3 1 +archcolor: pentium4 1 archcolor: alpha 2 archcolor: sparc 1 archcolor: sparc64 2 diff --git a/tests/rpmgeneral.at b/tests/rpmgeneral.at index e738883a4..628fd089c 100644 --- a/tests/rpmgeneral.at +++ b/tests/rpmgeneral.at @@ -123,6 +123,19 @@ runroot rpm --showrc > /dev/null [warning: Ignoring macrofiles at /root/.config/rpm/rpmrc:1 ]) +# Verify that i386-family sub-architectures have archcolor defined. +# Without explicit entries for i486/i586/i686/etc., rpmGetArchColor() +# returns -1 because the INSTARCH defaults table has no translate +# entries to map sub-arches to the base "i386". +RPMTEST_CHECK([ +rm -f ${RPMTEST}/root/.config/rpm/rpmrc +echo i686-Linux > ${RPMTEST}/${RPMSYSCONFDIR}/platform +runroot rpm --showrc | grep "^archcolor" +], +[0], +[archcolor : 1 +], +[]) RPMTEST_CLEANUP -- 2.53.0