-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile.uk
45 lines (34 loc) · 2.37 KB
/
Makefile.uk
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
$(eval $(call addlib,appelfloader))
APPELFLOADER_CFLAGS-$(CONFIG_APPELFLOADER_DEBUG) += -DUK_DEBUG
APPELFLOADER_SRCS-y += $(APPELFLOADER_BASE)/main.c
APPELFLOADER_SRCS-y += $(APPELFLOADER_BASE)/elf_load.c
APPELFLOADER_SRCS-y += $(APPELFLOADER_BASE)/elf_ctx.c
APPELFLOADER_SRCS-$(CONFIG_APPELFLOADER_BRK) += $(APPELFLOADER_BASE)/syscalls/brk.c
UK_PROVIDED_SYSCALLS-$(CONFIG_APPELFLOADER_BRK) += brk-1
APPELFLOADER_SRCS-$(CONFIG_APPELFLOADER_ARCH_PRCTL) += $(APPELFLOADER_BASE)/syscalls/arch_prctl.c
UK_PROVIDED_SYSCALLS-$(CONFIG_APPELFLOADER_ARCH_PRCTL) += arch_prctl-3e
APPELFLOADER_SRCS-$(CONFIG_APPELFLOADER_VDSO) += $(APPELFLOADER_BUILD)/vdso-image.c
APPELFLOADER_SRCS-$(CONFIG_APPELFLOADER_VDSO) += $(APPELFLOADER_BASE)/vdso/vsyscall.c
$(APPELFLOADER_BUILD)/vdso.o: $(APPELFLOADER_BASE)/vdso/vdso.c
$(call build_cmd,CC,appelfloader,$(notdir $@), \
$(CC) $< -c -o $@ -fPIC -O2 -nostdlib)
$(APPELFLOADER_BUILD)/vdso.patched.o: $(APPELFLOADER_BUILD)/vdso.o $(APPELFLOADER_BASE)/vdso/vdso_mapping.conf
$(call build_cmd,ADDSYM,appelfloader,$(notdir $@), \
OBJCOPY_CMD=$(OBJCOPY) APPELFLOADER_BASE=$(APPELFLOADER_BASE) VDSO_MAGIC_NUMBER=0x369C217100000000 $(APPELFLOADER_BASE)/vdso/add_symbol.sh $(APPELFLOADER_BASE)/vdso/vdso_mapping.conf $< $@)
$(APPELFLOADER_BUILD)/libvdso.so: $(APPELFLOADER_BUILD)/vdso.patched.o $(APPELFLOADER_BASE)/vdso/vdso.lds
$(call build_cmd,LD,appelfloader,$(notdir $@), \
$(LD) $< -o $@ -nostdlib -Wl$(comma)--hash-style=both -Wl$(comma)-soname=unikraft-vdso.so.1 -Wl$(comma)-shared -Wl$(comma)-T$(comma)$(APPELFLOADER_BASE)/vdso/vdso.lds)
$(APPELFLOADER_BUILD)/vdso-image.c: $(APPELFLOADER_BUILD)/libvdso.so $(APPELFLOADER_BASE)/vdso/vdso_mapping.conf
$(call build_cmd,PYTHON,appelfloader,$(notdir $@), \
$(PYTHON) $(APPELFLOADER_BASE)/vdso/bin2c.py $(APPELFLOADER_BASE)/vdso/vdso_mapping.conf $< $@)
APPELFLOADER_SRCS-$(CONFIG_APPELFLOADER_AUTOGEN) += $(APPELFLOADER_BASE)/autogen/conffile.c
ifneq ($(filter y,$(CONFIG_APPELFLOADER_AUTOGEN_ETCRESOLVCONF) \
$(CONFIG_APPELFLOADER_AUTOGEN_ETCHOSTS) \
$(CONFIG_APPELFLOADER_AUTOGEN_ETCHOSTNAME) \
),)
APPELFLOADER_SRCS-$(CONFIG_APPELFLOADER_AUTOGEN) += $(APPELFLOADER_BASE)/autogen/etc.c
endif
APPELFLOADER_CLEAN += $(APPELFLOADER_BUILD)/vdso.o
APPELFLOADER_CLEAN += $(APPELFLOADER_BUILD)/vdso.patched.o
APPELFLOADER_CLEAN += $(APPELFLOADER_BUILD)/libvdso.so
APPELFLOADER_CLEAN += $(APPELFLOADER_BUILD)/vdso-image.c