From 34150f154ccab488f8cef7e8fee22b0f0c536947 Mon Sep 17 00:00:00 2001 From: AI Dev Date: Sun, 8 Nov 2026 06:52:09 +0000 Subject: [PATCH] build: keep TARGET out of Buildroot's environment `make TARGET=...` exported TARGET to every recipe and passed it to sub-makes through MAKEFLAGS, so it reached each package's configure. host-libffi's AX_ENABLE_BUILDDIR treats $TARGET as a build subdirectory, then re-runs ../../configure from inside it and fails with exit 127. That broke the multi-board pattern CLAUDE.md recommends for any board that pulls in host-python3. Buildroot already gets O=$(TARGET), and repack-final passes TARGET explicitly, so drop it from MAKEOVERRIDES and unexport it. Fixes #2794 --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index b2cd3714a5..e0734d82d5 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,15 @@ BR_LINK = https://github.com/buildroot/buildroot/archive BR_FILE = /tmp/buildroot-$(BR_VER).tar.gz BR_CONF = $(TARGET)/openipc_defconfig TARGET ?= $(PWD)/output +# TARGET is this Makefile's name for the output directory, and it stops here. A +# variable given on the make command line is exported to every recipe and handed +# to sub-makes through MAKEFLAGS, so `make TARGET=...` used to reach Buildroot and +# every package's configure. host-libffi's AX_ENABLE_BUILDDIR takes $TARGET as a +# build subdirectory, then re-runs ../../configure from it and fails (#2794). +# Buildroot is told where to build by O=$(TARGET); the one sub-make of this file +# that needs TARGET, repack-final's, passes it explicitly. +MAKEOVERRIDES := $(filter-out TARGET=%,$(MAKEOVERRIDES)) +unexport TARGET export CMAKE_POLICY_VERSION_MINIMUM := 3.5 # GCC 15 defaults to -std=gnu23, where an empty parameter list means "takes no