mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 09:58:09 +00:00
make: Provide mandatory options in cflags-y variable
In case if CFLAGS is overriden from command line we don't see our headers anymore. So provide mandatory options in ccflags-y variable to fix that. https://bugzilla.openvz.org/show_bug.cgi?id=2521 Reported-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Tested-by: Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
b8ebb4d260
commit
f7066d7dca
7
Makefile
7
Makefile
@ -76,8 +76,10 @@ ARCH_DIR := arch/$(ARCH)
|
||||
|
||||
$(if $(wildcard $(ARCH_DIR)),,$(error "The architecture $(ARCH) isn't supported"))
|
||||
|
||||
CFLAGS += -iquote include -iquote pie -iquote . -iquote $(ARCH_DIR)
|
||||
CFLAGS += -iquote $(ARCH_DIR)/include -fno-strict-aliasing
|
||||
cflags-y += -iquote include -iquote pie -iquote .
|
||||
cflags-y += -iquote $(ARCH_DIR) -iquote $(ARCH_DIR)/include
|
||||
cflags-y += -fno-strict-aliasing
|
||||
export cflags-y
|
||||
|
||||
LIBS := -lrt -lpthread -lprotobuf-c
|
||||
|
||||
@ -103,6 +105,7 @@ ARCH-LIB := arch/$(ARCH)/crtools.built-in.o
|
||||
|
||||
export E Q CC ECHO MAKE CFLAGS LIBS ARCH DEFINES MAKEFLAGS
|
||||
export SRC_DIR SYSCALL-LIB SH RM ARCH_DIR OBJCOPY LDARCH LD
|
||||
export cflags-y
|
||||
|
||||
include scripts/Makefile.version
|
||||
include scripts/Makefile.rules
|
||||
|
@ -12,7 +12,7 @@ restorer-obj-y += restorer.o
|
||||
restorer-obj-e += $(ARCH_DIR)/restorer.o
|
||||
restorer-libs-e += $(SYSCALL-LIB)
|
||||
|
||||
CFLAGS += -fpie -Wa,--noexecstack -fno-strict-aliasing
|
||||
cflags-y += -fpie -Wa,--noexecstack -fno-strict-aliasing
|
||||
ASMFLAGS += -D__ASSEMBLY__
|
||||
|
||||
GEN-OFFSETS := gen-offsets.sh
|
||||
|
@ -5,43 +5,43 @@
|
||||
define gen-rule-o-from-c-by-name
|
||||
$(1).o: $(1).c
|
||||
$$(E) " CC " $$@
|
||||
$$(Q) $$(CC) -c $$(CFLAGS) $(2) $$< -o $$@
|
||||
$$(Q) $$(CC) -c $$(CFLAGS) $$(cflags-y) $(2) $$< -o $$@
|
||||
endef
|
||||
|
||||
define gen-rule-i-from-c-by-name
|
||||
$(1).i: $(1).c
|
||||
$$(E) " CC " $$@
|
||||
$$(Q) $$(CC) -E $$(CFLAGS) $(2) $$< -o $$@
|
||||
$$(Q) $$(CC) -E $$(CFLAGS) $$(cflags-y) $(2) $$< -o $$@
|
||||
endef
|
||||
|
||||
define gen-rule-s-from-c-by-name
|
||||
$(1).s: $(1).c
|
||||
$$(E) " CC " $$@
|
||||
$$(Q) $$(CC) -S $$(CFLAGS) $(2) -fverbose-asm $$< -o $$@
|
||||
$$(Q) $$(CC) -S $$(CFLAGS) $$(cflags-y) $(2) -fverbose-asm $$< -o $$@
|
||||
endef
|
||||
|
||||
define gen-rule-o-from-S-by-name
|
||||
$(1).o: $(1).S
|
||||
$$(E) " CC " $$@
|
||||
$$(Q) $$(CC) -c $$(CFLAGS) $(2) $$(ASMFLAGS) $(3) $$< -o $$@
|
||||
$$(Q) $$(CC) -c $$(CFLAGS) $$(cflags-y) $(2) $$(ASMFLAGS) $(3) $$< -o $$@
|
||||
endef
|
||||
|
||||
define gen-rule-d-from-c-by-name
|
||||
$(1).d: $(1).c
|
||||
$$(E) " DEP " $$@
|
||||
$$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(CFLAGS) $(2) $$< -o $$@
|
||||
$$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(CFLAGS) $$(cflags-y) $(2) $$< -o $$@
|
||||
endef
|
||||
|
||||
define gen-rule-d-from-S-by-name
|
||||
$(1).d: $(1).S
|
||||
$$(E) " DEP " $$@
|
||||
$$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(CFLAGS) $(2) $$< -o $$@
|
||||
$$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(CFLAGS) $$(cflags-y) $(2) $$< -o $$@
|
||||
endef
|
||||
|
||||
define gen-rule-i-from-S-by-name
|
||||
$(1).i: $(1).S
|
||||
$$(E) " CC " $$@
|
||||
$$(Q) $$(CC) -E $$(CFLAGS) $(2) $$< -o $$@
|
||||
$$(Q) $$(CC) -E $$(CFLAGS) $$(cflags-y) $(2) $$< -o $$@
|
||||
endef
|
||||
|
||||
##
|
||||
|
Loading…
x
Reference in New Issue
Block a user