[PATCH] Makefile: Report error and stop if we can't set TARGET
I don't think it's necessarily productive to check all the possible
error conditions in the Makefile, but this one is annoying: issue
'make' without a C compiler, then install one, and build again.
Then run passt and it will mysteriously terminate on epoll_wait(),
because seccomp.h is good enough to build against, but the resulting
seccomp filter doesn't allow any system call. Not really fun to debug.
Signed-off-by: Stefano Brivio
On Thu, Dec 19, 2024 at 05:36:34PM +0100, Stefano Brivio wrote:
I don't think it's necessarily productive to check all the possible error conditions in the Makefile, but this one is annoying: issue 'make' without a C compiler, then install one, and build again.
Then run passt and it will mysteriously terminate on epoll_wait(), because seccomp.h is good enough to build against, but the resulting seccomp filter doesn't allow any system call. Not really fun to debug.
Signed-off-by: Stefano Brivio
Haven't hit that, but it does sound really annoying.
Reviewed-by: David Gibson
--- Makefile | 1 + 1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile index 1fce737..464eef1 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ VERSION ?= $(shell git describe --tags HEAD 2>/dev/null || echo "unknown\ versio DUAL_STACK_SOCKETS := 1
TARGET ?= $(shell $(CC) -dumpmachine) +$(if $(TARGET),,$(error Failed to get target architecture)) # Get 'uname -m'-like architecture description for target TARGET_ARCH := $(firstword $(subst -, ,$(TARGET))) TARGET_ARCH := $(patsubst [:upper:],[:lower:],$(TARGET_ARCH))
-- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson
participants (2)
-
David Gibson
-
Stefano Brivio