toolchain: generate check-headers program under $(BUILD_DIR)

Some installations mount /tmp with the 'noexec' option, which prevents
running the program generated there to check the kernel headers.

Avoid the problem by generating the program under $(BUILD_DIR), passed
as the first argument to check-kernel-headers.sh.

We could globally export a TMPDIR environment variable with some path
under $(BUILD_DIR) but such solution would be too intrusive, depriving
the user from the freedom to set TMPDIR at his will (or needs).

Fixes: https://bugs.busybox.net/show_bug.cgi?id=12241

Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit 6136765b23)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Carlos Santos
2019-09-24 08:46:11 -03:00
committed by Peter Korsgaard
parent 2c4897b067
commit 31a1dec1f5
4 changed files with 10 additions and 8 deletions

View File

@@ -133,6 +133,7 @@ endef
ifeq ($(BR2_KERNEL_HEADERS_VERSION)$(BR2_KERNEL_HEADERS_AS_KERNEL)$(BR2_KERNEL_HEADERS_CUSTOM_TARBALL)$(BR2_KERNEL_HEADERS_CUSTOM_GIT),y)
define LINUX_HEADERS_CHECK_VERSION
$(call check_kernel_headers_version,\
$(BUILD_DIR),\
$(STAGING_DIR),\
$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)))
endef