forked from checkpoint-restore/criu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.library
69 lines (55 loc) · 1.84 KB
/
Makefile.library
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
target := native
CFLAGS := $(filter-out -DCONFIG_X86_64,$(CFLAGS))
CFLAGS += -Wa,--noexecstack -fno-stack-protector -DCR_NOGLIBC
CFLAGS_native += -fpie
ifeq ($(ARCH),x86)
ifeq ($(CONFIG_COMPAT),y)
target += compat
native-lib-y += util-vdso-elf32.o
endif
CFLAGS_native += -DCONFIG_X86_64
CFLAGS_compat += -fno-pic -m32 -DCONFIG_X86_32
CFLAGS_util-vdso-elf32.o += -DCONFIG_X86_32
endif
OBJS += log-simple.o util-fd.o util.o
ifeq ($(VDSO),y)
OBJS += util-vdso.o parasite-vdso.o ./$(ARCH_DIR)/vdso-pie.o
ifeq ($(SRCARCH),aarch64)
OBJS += ./$(ARCH_DIR)/intraprocedure.o
endif
ifeq ($(SRCARCH),ppc64)
OBJS += ./$(ARCH_DIR)/vdso-trampoline.o
endif
endif
ifeq ($(SRCARCH),ppc64)
OBJS += ./$(ARCH_DIR)/memcpy_power7.o \
./$(ARCH_DIR)/memcmp_64.o ./$(ARCH_DIR)/misc.o
endif
ifeq ($(SRCARCH),x86)
lib-y += ./$(ARCH_DIR)/memcpy.o
endif
define gen-native-objs
native-lib-y += $(1)
CFLAGS_$(1) := $(CFLAGS_native)
endef
compat-obj = $(basename $(notdir $(1)))-compat.o
define gen-compat-objs
compat-lib-y += $(dir ./$(call objectify,$(1)))compat/$(compat-obj)
CFLAGS_$(compat-obj) := $(CFLAGS_compat)
endef
$(eval $(call map,gen-native-objs,$(OBJS)))
$(eval $(call map,gen-compat-objs,$(OBJS)))
#
# We can't provide proper mount implementation
# in parasite code -- it requires run-time rellocation
# applications, which is not the target of the
# project.
#
iquotes := -iquote $(SRC_DIR)/$(PIE_DIR)/piegen
iquotes += -iquote $(SRC_DIR)/$(ARCH_DIR)/include
iquotes += -iquote $(SRC_DIR) -iquote $(SRC_DIR)/criu/include -iquote $(SRC_DIR)/include
CFLAGS := $(filter-out -pg $(CFLAGS-GCOV),$(CFLAGS)) $(iquotes)
asflags-y := -D__ASSEMBLY__ $(iquotes)
ifeq ($(SRCARCH),arm)
ccflags-y += -marm
endif