Commit 789f9208 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

pie.lib: generate compatible pie object files

Now compatible objects will be in $(obj)/compat/$(basename)-compat.o
I can't use just $(obj)/compat/$(basename).o as basename for file
will be the same as for native object, which wouldn't work by
the reason of CFLAGS_$(F) in nmk-ccflags.
So, I need different names for compatible/native objects.
Because I don't want to make a mess in parent directories,
I put this symlinks to compat/ dirs.
This is how I came to that decision (even if I do not like it).
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent af04c83c
../vdso-pie.c
\ No newline at end of file
target := native target := native
$(target)-lib-y += log-simple.o CFLAGS := $(filter-out -DCONFIG_X86_64,$(CFLAGS))
$(target)-lib-y += util-fd.o CFLAGS += -Wa,--noexecstack -fno-stack-protector -DCR_NOGLIBC
$(target)-lib-y += util.o
$(target)-lib-y += string.o CFLAGS_native += -fpie
ifeq ($(ARCH),x86)
target += compat
CFLAGS_native += -DCONFIG_X86_64
CFLAGS_compat += -fno-pic -m32 -DCONFIG_X86_32
endif
OBJS += log-simple.o util-fd.o util.o string.o
ifeq ($(VDSO),y) ifeq ($(VDSO),y)
$(target)-lib-y += util-vdso.o OBJS += util-vdso.o parasite-vdso.o ./$(ARCH_DIR)/vdso-pie.o
$(target)-lib-y += parasite-vdso.o
$(target)-lib-y += ./$(ARCH_DIR)/vdso-pie.o
ifeq ($(SRCARCH),aarch64) ifeq ($(SRCARCH),aarch64)
$(target)-lib-y += ./$(ARCH_DIR)/intraprocedure.o OBJS += ./$(ARCH_DIR)/intraprocedure.o
endif endif
ifeq ($(SRCARCH),ppc64) ifeq ($(SRCARCH),ppc64)
$(target)-lib-y += ./$(ARCH_DIR)/vdso-trampoline.o OBJS += ./$(ARCH_DIR)/vdso-trampoline.o
endif endif
endif endif
ifeq ($(SRCARCH),ppc64) ifeq ($(SRCARCH),ppc64)
$(target)-lib-y += ./$(ARCH_DIR)/memcpy_power7.o OBJS += ./$(ARCH_DIR)/memcpy_power7.o \
$(target)-lib-y += ./$(ARCH_DIR)/memcmp_64.o ./$(ARCH_DIR)/memcmp_64.o ./$(ARCH_DIR)/misc.o
$(target)-lib-y += ./$(ARCH_DIR)/misc.o
endif endif
ifeq ($(SRCARCH),x86) ifeq ($(SRCARCH),x86)
lib-y += ./$(ARCH_DIR)/memcpy.o lib-y += ./$(ARCH_DIR)/memcpy.o
endif 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 # We can't provide proper mount implementation
# in parasite code -- it requires run-time rellocation # in parasite code -- it requires run-time rellocation
......
../log-simple.c
\ No newline at end of file
../parasite-vdso.c
\ No newline at end of file
../util.c
\ No newline at end of file
../util-fd.c
\ No newline at end of file
../util-vdso.c
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment