libports: enable gmp 6.1.2 for ARMv8

issue #3537
This commit is contained in:
Sebastian Sumpf 2019-10-24 15:11:38 +02:00 committed by Christian Helmuth
parent 31a035a907
commit d28fe9e938
6 changed files with 103 additions and 3 deletions

View File

@ -9,6 +9,10 @@ ifeq ($(filter-out $(SPECS),arm),)
INC_DIR += $(GMP_PORT_DIR)/include/spec/arm
endif
ifeq ($(filter-out $(SPECS),arm_64),)
REP_INC_DIR += include/spec/64bit/gmp
INC_DIR += $(GMP_PORT_DIR)/include/spec/arm_64
endif
ifeq ($(filter-out $(SPECS),x86_32),)
REP_INC_DIR += include/spec/32bit/gmp
INC_DIR += $(GMP_PORT_DIR)/include/spec/x86_32

View File

@ -4,7 +4,7 @@ include $(REP_DIR)/lib/import/import-gmp.mk
LIBS += libc
CC_OPT += -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP
CC_OPT += -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DCOUNT_LEADING_ZEROS_NEED_CLZ_TAB
INC_DIR += $(REP_DIR)/include/gcc
INC_DIR += $(GMP_DIR)

View File

@ -0,0 +1,60 @@
GMP_MPN_DIR = $(GMP_DIR)/mpn
# this file uses the 'sdiv_qrnnd' symbol which is not defined
FILTER_OUT += udiv_w_sdiv.c
# add ARM-specific assembly files and filter out the generic C files if needed
SRC_ASM += copyd.asm copyi.asm
FILTER_OUT += popham.c
FILTER_OUT += logops_n.c sec_div.c sec_pi1_div.c copyi.c copyd.c
SRC_C += $(notdir $(wildcard $(REP_DIR)/src/lib/gmp/mpn/spec/64bit/*.c))
SRC_C += $(filter-out $(FILTER_OUT),$(notdir $(wildcard $(GMP_MPN_DIR)/generic/*.c)))
include $(REP_DIR)/lib/mk/gmp.inc
PWD := $(shell pwd)
SRC_O += $(SRC_ASM:.asm=.o) hamdist.o popcount.o
#
# Create execution environment for the m4-ccas tool, which is used by the gmp
# library to assemble asm files to object files. Make sure to execute this rule
# only from the actual build pass (not when called from 'dep_lib.mk'). This
# way, the 'm4env' gets created within the local build directory of the
# library, not the global build directory.
#
ifeq ($(called_from_lib_mk),yes)
all: m4env
endif
m4env:
$(VERBOSE)mkdir -p $@/mpn/arm_64
$(VERBOSE)ln -s $(REP_DIR)/src/lib/gmp/spec/arm_64/config.m4 m4env
$(VERBOSE)ln -s $(GMP_MPN_DIR)/asm-defs.m4 m4env/mpn
#
# Create object files out of asm files
#
ifneq ($(VERBOSE),)
M4_OUTPUT_FILTER = > /dev/null
endif
hamdist.o popcount.o: popham.c
$(MSG_COMP)$@
$(VERBOSE)$(CC) $(CC_DEF) $(CC_C_OPT) -DOPERATION_${@:.o=} $(INCLUDES) -c $< -o $@
%.o: %.asm
$(MSG_ASSEM)$@
$(VERBOSE)cd m4env/mpn; \
$(GMP_MPN_DIR)/m4-ccas --m4=m4 $(CC) $(CC_MARCH) -std=gnu99 -fPIC -DPIC $(CC_OPT_$*) $(INCLUDES) -c $< -o $(PWD)/$@ \
$(M4_OUTPUT_FILTER)
vpath %.c $(REP_DIR)/src/lib/gmp/mpn/spec/64bit
vpath %.c $(GMP_MPN_DIR)/generic
vpath %.asm $(GMP_MPN_DIR)/arm64
CC_CXX_WARN_STRICT =

View File

@ -1 +1 @@
07b77c4f05fe9aefdbd217f5b42382100f270b62
855680cf4411a440d5353ea01c55ee6289c67b26

View File

@ -11,7 +11,8 @@ DIR(gmp) := src/lib/gmp
DIRS := include
DIR_CONTENT(include) := ${DIR(gmp)}/gmp-impl.h
DIRS += $(addprefix include/spec/, x86_32 x86_64 arm)
DIRS += $(addprefix include/spec/, x86_32 x86_64 arm arm_64)
DIR_CONTENT(include/spec/x86_32) := ${DIR(gmp)}/mpn/x86/pentium/gmp-mparam.h
DIR_CONTENT(include/spec/x86_64) := ${DIR(gmp)}/mpn/x86_64/gmp-mparam.h
DIR_CONTENT(include/spec/arm) := ${DIR(gmp)}/mpn/arm/gmp-mparam.h
DIR_CONTENT(include/spec/arm_64) := ${DIR(gmp)}/mpn/arm64/gmp-mparam.h

View File

@ -0,0 +1,35 @@
dnl config.m4. Generated automatically by configure.
changequote(<,>)
ifdef(<__CONFIG_M4_INCLUDED__>,,<
define(<CONFIG_TOP_SRCDIR>,<`../.'>)
define(<WANT_ASSERT>,0)
define(<WANT_PROFILING>,<`no'>)
define(<M4WRAP_SPURIOUS>,<no>)
define(<TEXT>, <.text>)
define(<DATA>, <.data>)
define(<LABEL_SUFFIX>, <:>)
define(<GLOBL>, <.globl>)
define(<GLOBL_ATTR>, <>)
define(<GSYM_PREFIX>, <>)
define(<RODATA>, < .section .rodata>)
define(<TYPE>, <.type $1,@$2>)
define(<SIZE>, <.size $1,$2>)
define(<LSYM_PREFIX>, <.L>)
define(<W32>, <.long>)
define(<ALIGN_LOGARITHMIC>,<yes>)
define(<SQR_TOOM2_THRESHOLD>,<28>)
define(<BMOD_1_TO_MOD_1_THRESHOLD>,<30>)
define(<SIZEOF_UNSIGNED>,<4>)
define(<GMP_LIMB_BITS>,64)
define(<GMP_NAIL_BITS>,0)
define(<GMP_NUMB_BITS>,eval(GMP_LIMB_BITS-GMP_NAIL_BITS))
>)
changequote(`,')
ifdef(`__CONFIG_M4_INCLUDED__',,`
include(CONFIG_TOP_SRCDIR`/mpn/asm-defs.m4')
define_not_for_expansion(`HAVE_HOST_CPU_aarch64')
define_not_for_expansion(`HAVE_ABI_64')
define_not_for_expansion(`HAVE_LIMB_LITTLE_ENDIAN')
define_not_for_expansion(`HAVE_DOUBLE_IEEE_LITTLE_ENDIAN')
')
define(`__CONFIG_M4_INCLUDED__')