From: Andrew Cooper Date: Thu, 5 Jan 2023 01:17:27 +0000 (+0000) Subject: build: Move -nostdinc from COMMON_CFLAGS to COMMON_FLAGS X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ff160740d9114293f10bb34355b993f54f8e6659;p=xtf.git build: Move -nostdinc from COMMON_CFLAGS to COMMON_FLAGS It needs to find its way into COMMON_AFLAGS too. Also fix a latent bug introduced at the same time. PRIx32 is used by PSE_PRIpte. Fixes: 8e3394a51e08 ("Drop dependency on gcc-multilib") Signed-off-by: Andrew Cooper --- diff --git a/build/common.mk b/build/common.mk index df41fcc..42d4c77 100644 --- a/build/common.mk +++ b/build/common.mk @@ -17,7 +17,7 @@ $(foreach env,$(64BIT_ENVIRONMENTS),$(eval $(env)_arch := x86_64)) comma := , -COMMON_FLAGS := -pipe -I$(ROOT)/include -I$(ROOT)/arch/x86/include -MMD -MP +COMMON_FLAGS := -pipe -nostdinc -I$(ROOT)/include -I$(ROOT)/arch/x86/include -MMD -MP cc-option = $(shell if [ -z "`echo 'int p=1;' | $(CC) $(1) -c -o /dev/null -x c - 2>&1`" ]; \ then echo y; else echo n; fi) @@ -36,7 +36,7 @@ COMMON_AFLAGS := $(COMMON_FLAGS) $(COMMON_AFLAGS-y) -D__ASSEMBLY__ COMMON_CFLAGS := $(COMMON_FLAGS) $(COMMON_CFLAGS-y) COMMON_CFLAGS += -Wall -Wextra -Werror -std=gnu99 -Wstrict-prototypes -O3 -g COMMON_CFLAGS += -fno-common -fno-asynchronous-unwind-tables -fno-strict-aliasing -COMMON_CFLAGS += -fno-stack-protector -fno-pic -ffreestanding -nostdinc +COMMON_CFLAGS += -fno-stack-protector -fno-pic -ffreestanding COMMON_CFLAGS += -mno-red-zone -mno-sse COMMON_CFLAGS += -Wno-unused-parameter -Winline diff --git a/include/inttypes.h b/include/inttypes.h index 565fe9e..a06513d 100644 --- a/include/inttypes.h +++ b/include/inttypes.h @@ -14,6 +14,11 @@ # define __PRIPTR #endif +#define PRId32 "d" +#define PRIx32 "x" +#define PRIo32 "o" +#define PRIu32 "u" + #define PRId64 __PRI64 "d" #define PRIx64 __PRI64 "x" #define PRIo64 __PRI64 "o"