Unverified Commit 5ff90d42 authored by James Le Cuirot's avatar James Le Cuirot Committed by Nathan Chancellor
Browse files

kbuild: install-extmod-build: Fix when given dir outside the build dir



Commit b5e39565 ("kbuild: install-extmod-build: Fix build when
specifying KBUILD_OUTPUT") tried to address the "build" variable
expecting a relative path by using `realpath --relative-base=.`, but
this only works when the given directory is below the current directory.
`realpath --relative-to=.` will return a relative path in all cases.

Fixes: b5e39565 ("kbuild: install-extmod-build: Fix build when specifying KBUILD_OUTPUT")
Signed-off-by: default avatarJames Le Cuirot <chewi@gentoo.org>
Reviewed-by: default avatarNicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/20251016091417.9985-1-chewi@gentoo.org


Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
parent dfab6787
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ if [ "${CC}" != "${HOSTCC}" ]; then
	# Clear VPATH and srcroot because the source files reside in the output
	# directory.
	# shellcheck disable=SC2016 # $(MAKE) and $(build) will be expanded by Make
	"${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"$(realpath --relative-base=. "${destdir}")"/scripts
	"${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"$(realpath --relative-to=. "${destdir}")"/scripts

	rm -f "${destdir}/scripts/Kbuild"
fi