--- build/parsePreamble.c.orig 2025-04-25 09:33:36.850778834 +0000 +++ build/parsePreamble.c 2025-04-25 09:33:51.002755713 +0000 @@ -1332,6 +1332,11 @@ int parsePreamble(rpmSpec spec, int init "%{dirname:%{buildroot}}", RMIL_GLOBAL, 0); } + /* XXX Skip valid arch check if not building binary package */ + if (!(spec->flags & RPMSPEC_ANYARCH) && checkForValidArchitectures(spec)) { + goto exit; + } + /* if we get down here nextPart has been set to non-error */ res = nextPart; --- build/parseSpec.c.orig 2025-04-25 09:34:05.770731591 +0000 +++ build/parseSpec.c 2025-04-25 09:34:20.242707943 +0000 @@ -1355,11 +1355,6 @@ static rpmRC finalizeSpec(rpmSpec spec) char *os = rpmExpand("%{_target_os}", NULL); char *optflags = rpmExpand("%{optflags}", NULL); - /* XXX Skip valid arch check if not building binary package */ - if (!(spec->flags & RPMSPEC_ANYARCH) && checkForValidArchitectures(spec)) { - goto exit; - } - fillOutMainPackage(spec->packages->header); /* Define group tag to something when group is undefined in main package*/ if (!headerIsEntry(spec->packages->header, RPMTAG_GROUP)) {