lib-name		:= pie.lib.a

CFLAGS			+= -fno-stack-protector -DCR_NOGLIBC -fpie

lib-y			+= util.o

ifeq ($(VDSO),y)
        lib-y		+= util-vdso.o parasite-vdso.o ./$(ARCH_DIR)/vdso-pie.o

        ifeq ($(SRCARCH),aarch64)
                lib-y	+= ./$(ARCH_DIR)/intraprocedure.o
        endif

        ifeq ($(SRCARCH),ppc64)
                lib-y	+= ./$(ARCH_DIR)/vdso-trampoline.o
        endif
endif

ifeq ($(SRCARCH),ppc64)
        lib-y		+= ./$(ARCH_DIR)/misc.o
endif

ifeq ($(SRCARCH),x86)
        ifeq ($(CONFIG_COMPAT),y)
                lib-y	+= util-vdso-elf32.o
        endif
        CFLAGS_util-vdso-elf32.o	+= -DCONFIG_VDSO_32
endif

#
# We can't provide proper mount implementation
# in parasite code -- it requires run-time rellocation
# applications, which is not the target of the
# project.
#
CFLAGS		:= $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN),$(CFLAGS))

asflags-y		:= -D__ASSEMBLY__
ccflags-y		+= $(COMPEL_UAPI_INCLUDES)

ifeq ($(SRCARCH),arm)
	ccflags-y	+= -marm
endif
