build: Add aarch64 support

Change-Id: If9594936a28355d89edd1a331b3b429dffa44184
Signed-off-by: Yibo Cai <yibo.cai@arm.com>
This commit is contained in:
Yibo Cai 2018-12-19 03:23:25 +00:00 committed by Greg Tucker
parent 32b5c4131b
commit 7a44098a98
8 changed files with 29 additions and 2 deletions

View File

@ -21,6 +21,7 @@ examples=
other_tests=
lsrc_x86_64=
lsrc_x86_32=
lsrc_aarch64=
lsrc_base_aliases=
lsrc32=
unit_tests32=
@ -55,6 +56,10 @@ if CPU_X86_32
libisal_la_SOURCES += ${lsrc_x86_32}
endif
if CPU_AARCH64
libisal_la_SOURCES += ${lsrc_aarch64}
endif
if CPU_UNDEFINED
libisal_la_SOURCES += ${lsrc_base_aliases}
endif
@ -93,19 +98,26 @@ test: $(addsuffix .run,$(unit_tests))
$<
@echo Completed run: $<
# Support for yasm/nasm
# Support for yasm/nasm/gas
if USE_YASM
as_filter = ${srcdir}/tools/yasm-filter.sh
endif
if USE_NASM
as_filter = ${srcdir}/tools/nasm-filter.sh
endif
if CPU_AARCH64
as_filter = gcc
endif
CCAS = $(as_filter)
EXTRA_DIST += tools/yasm-filter.sh tools/nasm-filter.sh
AM_CFLAGS = ${my_CFLAGS} ${INCLUDE} $(src_include) ${D}
if CPU_AARCH64
AM_CCASFLAGS = ${AM_CFLAGS}
else
AM_CCASFLAGS = ${yasm_args} ${INCLUDE} ${src_include} ${DEFS} ${D}
endif
.asm.s:
@echo " MKTMP " $@;

View File

@ -28,9 +28,12 @@ AS_CASE([$host_cpu],
[x86_64], [CPU="x86_64"],
[amd64], [CPU="x86_64"],
[i?86], [CPU="x86_32"],
[aarch64], [CPU="aarch64"],
[arm64], [CPU="aarch64"],
)
AM_CONDITIONAL([CPU_X86_64], [test "$CPU" = "x86_64"])
AM_CONDITIONAL([CPU_X86_32], [test "$CPU" = "x86_32"])
AM_CONDITIONAL([CPU_AARCH64], [test "$CPU" = "aarch64"])
AM_CONDITIONAL([CPU_UNDEFINED], [test "x$CPU" = "x"])
if test "$CPU" = "x86_64"; then

View File

@ -33,6 +33,7 @@ lsrc += \
lsrc_base_aliases += crc/crc_base_aliases.c
lsrc_x86_32 += crc/crc_base_aliases.c
lsrc_aarch64 += crc/crc_base_aliases.c
lsrc_x86_64 += \
crc/crc16_t10dif_01.asm \

View File

@ -30,6 +30,7 @@
lsrc += erasure_code/ec_base.c
lsrc_base_aliases += erasure_code/ec_base_aliases.c
lsrc_aarch64 += erasure_code/ec_base_aliases.c
lsrc_x86_64 += \
erasure_code/ec_highlevel_func.c \

View File

@ -38,6 +38,7 @@ lsrc += igzip/igzip.c \
lsrc_base_aliases += igzip/igzip_base_aliases.c igzip/proc_heap_base.c
lsrc_x86_32 += igzip/igzip_base_aliases.c igzip/proc_heap_base.c
lsrc_aarch64 += igzip/igzip_base_aliases.c igzip/proc_heap_base.c
lsrc_x86_64 += igzip/igzip_body.asm \
igzip/igzip_finish.asm \

View File

@ -104,7 +104,7 @@ CLEANFILES += $(O) *.o *.a $(all_tests) $(bin_PROGRAMS) $(lib_name) $(so_lib_nam
lsrc += $(lsrc_$(host_cpu))
O = bin
lobj += $(patsubst %.c,%.o,$(patsubst %.asm,%.o,$(lsrc) $(lsrc_intrinsic)))
lobj += $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(patsubst %.asm,%.o,$(lsrc) $(lsrc_intrinsic))))
objs = $(addprefix $(O)/,$(notdir $(lobj)))
@ -172,10 +172,16 @@ $(addsuffix .run,$(all_tests)): %.run : %
# Other build rules
msg = $(if $(DEBUG),DEBUG) $(patsubst 32,32-bit,$(host_cpu)) $D
# yasm/nasm assembly files
$(O)/%.o: %.asm
@echo " ---> Building $< $(msg)"
@$(AS) $(ASFLAGS) -o $@ $<
# gcc assembly files
$(O)/%.o: $(host_cpu)/%.S
@echo " ---> Building $< $(msg)"
@$(COMPILE.c) $(OUTPUT_OPTION) $<
$(O)/%.o %.o: %.c
@echo " ---> Building $< $(msg)"
@$(COMPILE.c) $(OUTPUT_OPTION) $<
@ -215,6 +221,7 @@ soname = $(so_lib_inst).$(word 1, $(subst ., ,$(version)))
slib: $(so_lib_name)
aobjs += $(addprefix $(O)/,$(patsubst %.asm,%.o,$(filter %.asm,$(notdir $(lsrc) $(lsrc_intrinsic)))))
aobjs += $(addprefix $(O)/,$(patsubst %.S,%.o,$(filter %.S,$(notdir $(lsrc) $(lsrc_intrinsic)))))
shared_objs += $(addprefix $(O)/shared_ver_,$(patsubst %.c,%.o,$(filter %.c,$(notdir $(lsrc) $(lsrc_intrinsic)))))
$(O)/shared_ver_%.o: %.c

View File

@ -30,6 +30,7 @@
lsrc += mem/mem_zero_detect_base.c
lsrc_base_aliases += mem/mem_zero_detect_base_aliases.c
lsrc_aarch64 += mem/mem_zero_detect_base_aliases.c
lsrc_x86_64 += mem/mem_zero_detect_avx.asm \
mem/mem_zero_detect_sse.asm \

View File

@ -30,6 +30,7 @@
lsrc += raid/raid_base.c
lsrc_base_aliases += raid/raid_base_aliases.c
lsrc_aarch64 += raid/raid_base_aliases.c
lsrc_x86_64 += \
raid/xor_gen_sse.asm \