2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 18:07:57 +00:00

build: Move __ASSEMBLY__ define to the top Makefile

__ASSEMBLY__ is used to guard C-related code in headers from
asm-compatible defines. We actually want every .S file to be assembled
with -D__ASSEMBLY__ not to burst with C in asm file.

Move __ASSEMBLY__ from all local asflags to top Makefile's AFLAGS.

Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
Dmitry Safonov 2019-05-17 23:53:02 +01:00 committed by Andrei Vagin
parent 1b66b66b56
commit 9df47bb26f
7 changed files with 4 additions and 8 deletions

View File

@ -129,9 +129,10 @@ ifeq ($(GMON),1)
export GMON GMONLDOPT export GMON GMONLDOPT
endif endif
AFLAGS += -D__ASSEMBLY__
CFLAGS += $(USERCFLAGS) $(WARNINGS) $(DEFINES) -iquote include/ CFLAGS += $(USERCFLAGS) $(WARNINGS) $(DEFINES) -iquote include/
HOSTCFLAGS += $(WARNINGS) $(DEFINES) -iquote include/ HOSTCFLAGS += $(WARNINGS) $(DEFINES) -iquote include/
export CFLAGS USERCLFAGS HOSTCFLAGS export AFLAGS CFLAGS USERCLFAGS HOSTCFLAGS
# Default target # Default target
all: criu lib crit all: criu lib crit

View File

@ -29,7 +29,7 @@ asflags-y += -iquote $(PLUGIN_ARCH_DIR)
# General flags for assembly # General flags for assembly
asflags-y += -fpie -Wstrict-prototypes asflags-y += -fpie -Wstrict-prototypes
asflags-y += -D__ASSEMBLY__ -nostdlib -fomit-frame-pointer asflags-y += -nostdlib -fomit-frame-pointer
asflags-y += -fno-stack-protector asflags-y += -fno-stack-protector
ldflags-y += -z noexecstack ldflags-y += -z noexecstack

View File

@ -3,7 +3,6 @@ builtin-name := crtools.built-in.o
ccflags-y += -iquote $(obj)/include -iquote criu/include ccflags-y += -iquote $(obj)/include -iquote criu/include
ccflags-y += -iquote include ccflags-y += -iquote include
ccflags-y += $(COMPEL_UAPI_INCLUDES) ccflags-y += $(COMPEL_UAPI_INCLUDES)
asflags-y += -D__ASSEMBLY__
ldflags-y += -r ldflags-y += -r
obj-y += cpu.o obj-y += cpu.o

View File

@ -4,7 +4,6 @@ ccflags-y += -iquote $(obj)/include
ccflags-y += -iquote criu/include -iquote include ccflags-y += -iquote criu/include -iquote include
ccflags-y += $(COMPEL_UAPI_INCLUDES) ccflags-y += $(COMPEL_UAPI_INCLUDES)
asflags-y += -D__ASSEMBLY__
ldflags-y += -r -z noexecstack ldflags-y += -r -z noexecstack
obj-y += cpu.o obj-y += cpu.o

View File

@ -5,7 +5,7 @@ ccflags-y += -iquote criu/include -iquote include
ccflags-y += $(COMPEL_UAPI_INCLUDES) ccflags-y += $(COMPEL_UAPI_INCLUDES)
asflags-y += -Wstrict-prototypes asflags-y += -Wstrict-prototypes
asflags-y += -D__ASSEMBLY__ -nostdlib -fomit-frame-pointer asflags-y += -nostdlib -fomit-frame-pointer
asflags-y += -iquote $(obj)/include asflags-y += -iquote $(obj)/include
ldflags-y += -r -z noexecstack ldflags-y += -r -z noexecstack

View File

@ -17,8 +17,6 @@ ifneq ($(filter-out clean mrproper,$(MAKECMDGOALS)),)
compel_plugins := $(shell $(COMPEL_BIN) plugins) compel_plugins := $(shell $(COMPEL_BIN) plugins)
endif endif
asflags-y += -D__ASSEMBLY__
LDS := compel/arch/$(SRCARCH)/scripts/compel-pack.lds.S LDS := compel/arch/$(SRCARCH)/scripts/compel-pack.lds.S
restorer-obj-y += ./$(ARCH_DIR)/restorer.o restorer-obj-y += ./$(ARCH_DIR)/restorer.o

View File

@ -35,6 +35,5 @@ endif
CFLAGS := $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN),$(CFLAGS)) CFLAGS := $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN),$(CFLAGS))
asflags-y := -D__ASSEMBLY__
ccflags-y += $(COMPEL_UAPI_INCLUDES) ccflags-y += $(COMPEL_UAPI_INCLUDES)
ccflags-y += $(CFLAGS_PIE) ccflags-y += $(CFLAGS_PIE)