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>
This commit is contained in:
Carlos Santos
2019-09-24 08:46:11 -03:00
committed by Thomas Petazzoni
parent cf64b689a6
commit 6136765b23
4 changed files with 10 additions and 8 deletions

View File

@@ -158,13 +158,12 @@ copy_toolchain_sysroot = \
# Check the specified kernel headers version actually matches the
# version in the toolchain.
#
# $1: sysroot directory
# $2: kernel version string, in the form: X.Y
# $1: build directory
# $2: sysroot directory
# $3: kernel version string, in the form: X.Y
#
check_kernel_headers_version = \
if ! support/scripts/check-kernel-headers.sh $(1) $(2); then \
exit 1; \
fi
support/scripts/check-kernel-headers.sh $(1) $(2) $(3)
#
# Check the specific gcc version actually matches the version in the

View File

@@ -531,6 +531,7 @@ define $(2)_CONFIGURE_CMDS
$$(Q)$$(call check_unusable_toolchain,$$(TOOLCHAIN_EXTERNAL_CC))
$$(Q)SYSROOT_DIR="$$(call toolchain_find_sysroot,$$(TOOLCHAIN_EXTERNAL_CC))" ; \
$$(call check_kernel_headers_version,\
$$(BUILD_DIR)\
$$(call toolchain_find_sysroot,$$(TOOLCHAIN_EXTERNAL_CC)),\
$$(call qstrip,$$(BR2_TOOLCHAIN_HEADERS_AT_LEAST))); \
$$(call check_gcc_version,$$(TOOLCHAIN_EXTERNAL_CC),\