Index: head/lib/libc/arm/aeabi/Makefile.inc =================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc (revision 313865) +++ head/lib/libc/arm/aeabi/Makefile.inc (revision 313866) @@ -1,32 +1,33 @@ # $FreeBSD$ .PATH: ${LIBC_SRCTOP}/arm/aeabi SRCS+= aeabi_atexit.c \ aeabi_unwind_cpp.c \ aeabi_unwind_exidx.c .if (${MACHINE_ARCH:Marmv6*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != "") || \ ${MACHINE_ARCH:Marmv6*} == "" SRCS+= aeabi_asm_double.S \ aeabi_asm_float.S \ aeabi_double.c \ aeabi_float.c .endif .if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") SRCS+= aeabi_vfp_double.S \ aeabi_vfp_float.S .endif # Add the aeabi_mem* functions. While they live in compiler-rt they call into # libc. This causes issues when other parts of libc call these functions. # We work around this by including these functions in libc but mark them as # hidden so users of libc will not pick up these versions. .PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/arm SRCS+= aeabi_memcmp.S \ aeabi_memcpy.S \ aeabi_memmove.S \ aeabi_memset.S -SYM_MAPS+=${LIBC_SRCTOP}/arm/aeabi/Symbol.map +SRCS+= aeabi_int_div.S +SYM_MAPS+=${LIBC_SRCTOP}/arm/aeabi/Symbol.map Index: head/lib/libc/arm/aeabi/Symbol.map =================================================================== --- head/lib/libc/arm/aeabi/Symbol.map (revision 313865) +++ head/lib/libc/arm/aeabi/Symbol.map (revision 313866) @@ -1,72 +1,79 @@ /* * $FreeBSD$ */ /* * This only needs to contain AEABI symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSDprivate_1.0 { __aeabi_atexit; __aeabi_dcmpeq; __aeabi_dcmplt; __aeabi_dcmple; __aeabi_dcmpge; __aeabi_dcmpgt; __aeabi_dcmpun; __aeabi_cdcmpeq; __aeabi_cdcmple; __aeabi_cdrcmple; __aeabi_d2iz; __aeabi_d2f; __aeabi_dadd; __aeabi_ddiv; __aeabi_dmul; __aeabi_dsub; __aeabi_fcmpeq; __aeabi_fcmplt; __aeabi_fcmple; __aeabi_fcmpge; __aeabi_fcmpgt; __aeabi_fcmpun; __aeabi_cfcmpeq; __aeabi_cfcmple; __aeabi_cfrcmple; __aeabi_f2iz; __aeabi_f2d; __aeabi_fadd; __aeabi_fdiv; __aeabi_fmul; __aeabi_fsub; __aeabi_i2d; __aeabi_i2f; __aeabi_memclr; __aeabi_memclr4; __aeabi_memclr8; __aeabi_memcmp; __aeabi_memcmp4; __aeabi_memcmp8; __aeabi_memcpy; __aeabi_memcpy4; __aeabi_memcpy8; __aeabi_memmove; __aeabi_memmove4; __aeabi_memmove8; __aeabi_memset; __aeabi_memset4; __aeabi_memset8; + + /* + * A workaround for DEFINE_AEABI_FUNCTION_ALIAS() bug. + * - see aeabi_int_div.S + */ + __aeabi_idiv; + __aeabi_uidiv; }; Index: head/lib/libc/arm/aeabi/aeabi_int_div.S =================================================================== --- head/lib/libc/arm/aeabi/aeabi_int_div.S (nonexistent) +++ head/lib/libc/arm/aeabi/aeabi_int_div.S (revision 313866) @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2017 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Due to bug in libcompiler_rt, all symbols declared by + * DEFINE_AEABI_FUNCTION_ALIAS() are not hidden. All these but + * __aeabi_uidiv_compat and/or __aeabi_idiv_compat are explicitly + * exported from libc and don't causes problems. + * + * As workaround, export these from libc as compatible symbols, + * in global namespace + */ + +ENTRY(__aeabi_uidiv_compat) + .symver __aeabi_uidiv_compat, __aeabi_uidiv@ + b __udivsi3 +END(__aeabi_uidiv_compat) + +ENTRY(__aeabi_idiv_compat) + .symver __aeabi_idiv_compat, __aeabi_idiv@ + b __divsi3 +END(__aeabi_idiv_compat) + + .section .note.GNU-stack,"",%progbits Property changes on: head/lib/libc/arm/aeabi/aeabi_int_div.S ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property