From owner-svn-src-head@FreeBSD.ORG Sat Jan 19 05:33:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5E24297; Sat, 19 Jan 2013 05:33:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2ABAF9; Sat, 19 Jan 2013 05:33:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0J5XvYR000347; Sat, 19 Jan 2013 05:33:57 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0J5XuV0000337; Sat, 19 Jan 2013 05:33:56 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301190533.r0J5XuV0000337@svn.freebsd.org> From: Andrew Turner Date: Sat, 19 Jan 2013 05:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245655 - in head/lib/libc/arm: . aeabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jan 2013 05:33:57 -0000 Author: andrew Date: Sat Jan 19 05:33:55 2013 New Revision: 245655 URL: http://svnweb.freebsd.org/changeset/base/245655 Log: Add the required __aeabi_* functions to libc. The floating point functions are here rather than compiler-rt because the libc softfloat code allows us to set the rounding mode. Added: head/lib/libc/arm/aeabi/ head/lib/libc/arm/aeabi/Makefile.inc (contents, props changed) head/lib/libc/arm/aeabi/Symbol.map (contents, props changed) head/lib/libc/arm/aeabi/aeabi_atexit.c (contents, props changed) head/lib/libc/arm/aeabi/aeabi_double.c (contents, props changed) head/lib/libc/arm/aeabi/aeabi_float.c (contents, props changed) head/lib/libc/arm/aeabi/aeabi_unwind_cpp.c (contents, props changed) Modified: head/lib/libc/arm/Makefile.inc Modified: head/lib/libc/arm/Makefile.inc ============================================================================== --- head/lib/libc/arm/Makefile.inc Sat Jan 19 04:46:18 2013 (r245654) +++ head/lib/libc/arm/Makefile.inc Sat Jan 19 05:33:55 2013 (r245655) @@ -12,5 +12,7 @@ SYM_MAPS+=${.CURDIR}/arm/Symbol.map .if ${MK_ARM_EABI} == "no" # This contains the symbols that were removed when moving to the ARM EABI SYM_MAPS+=${.CURDIR}/arm/Symbol_oabi.map +.else +.include "${.CURDIR}/arm/aeabi/Makefile.inc" .endif Added: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/Makefile.inc Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/arm/aeabi + +SRCS+= aeabi_atexit.c \ + aeabi_double.c \ + aeabi_float.c \ + aeabi_unwind_cpp.c + +SYM_MAPS+=${.CURDIR}/arm/aeabi/Symbol.map + Added: head/lib/libc/arm/aeabi/Symbol.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/Symbol.map Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,47 @@ +/* + * $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_d2iz; + __aeabi_d2f; + + __aeabi_dadd; + __aeabi_ddiv; + __aeabi_dmul; + __aeabi_dsub; + + + __aeabi_fcmpeq; + __aeabi_fcmplt; + __aeabi_fcmple; + __aeabi_fcmpge; + __aeabi_fcmpgt; + __aeabi_fcmpun; + + __aeabi_f2iz; + __aeabi_f2d; + + __aeabi_fadd; + __aeabi_fdiv; + __aeabi_fmul; + __aeabi_fsub; + + + __aeabi_i2d; + __aeabi_i2f; +}; Added: head/lib/libc/arm/aeabi/aeabi_atexit.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_atexit.c Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2012 Andrew Turner + * 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$"); + +int __cxa_atexit(void (*)(void *), void *, void *); + +int +__aeabi_atexit(void *object, void (*func)(void*), void *dso) +{ + return __cxa_atexit(func, object, dso); +} + Added: head/lib/libc/arm/aeabi/aeabi_double.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_double.c Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2012 Andrew Turner + * 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$"); + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +flag __unorddf2(float64, float64); + +int __aeabi_dcmpeq(float64 a, float64 b) +{ + return float64_eq(a, b); +} + +int __aeabi_dcmplt(float64 a, float64 b) +{ + return float64_lt(a, b); +} + +int __aeabi_dcmple(float64 a, float64 b) +{ + return float64_le(a, b); +} + +int __aeabi_dcmpge(float64 a, float64 b) +{ + return float64_le(b, a); +} + +int __aeabi_dcmpgt(float64 a, float64 b) +{ + return float64_lt(b, a); +} + +int __aeabi_dcmpun(float64 a, float64 b) +{ + return __unorddf2(a, b); +} + +int __aeabi_d2iz(float64 a) +{ + return float64_to_int32_round_to_zero(a); +} + +float32 __aeabi_d2f(float64 a) +{ + return float64_to_float32(a); +} + +float64 __aeabi_i2d(int a) +{ + return int32_to_float64(a); +} + +float64 __aeabi_dadd(float64 a, float64 b) +{ + return float64_add(a, b); +} + +float64 __aeabi_ddiv(float64 a, float64 b) +{ + return float64_div(a, b); +} + +float64 __aeabi_dmul(float64 a, float64 b) +{ + return float64_mul(a, b); +} + +float64 __aeabi_dsub(float64 a, float64 b) +{ + return float64_sub(a, b); +} + Added: head/lib/libc/arm/aeabi/aeabi_float.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_float.c Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2012 Andrew Turner + * 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$"); + +#include "softfloat-for-gcc.h" +#include "milieu.h" +#include "softfloat.h" + +flag __unordsf2(float32, float32); + +int __aeabi_fcmpeq(float32 a, float32 b) +{ + return float32_eq(a, b); +} + +int __aeabi_fcmplt(float32 a, float32 b) +{ + return float32_lt(a, b); +} + +int __aeabi_fcmple(float32 a, float32 b) +{ + return float32_le(a, b); +} + +int __aeabi_fcmpge(float32 a, float32 b) +{ + return float32_le(b, a); +} + +int __aeabi_fcmpgt(float32 a, float32 b) +{ + return float32_lt(b, a); +} + +int __aeabi_fcmpun(float32 a, float32 b) +{ + return __unordsf2(a, b); +} + +int __aeabi_f2iz(float32 a) +{ + return float32_to_int32_round_to_zero(a); +} + +float32 __aeabi_f2d(float32 a) +{ + return float32_to_float64(a); +} + +float32 __aeabi_i2f(int a) +{ + return int32_to_float32(a); +} + +float32 __aeabi_fadd(float32 a, float32 b) +{ + return float32_add(a, b); +} + +float32 __aeabi_fdiv(float32 a, float32 b) +{ + return float32_div(a, b); +} + +float32 __aeabi_fmul(float32 a, float32 b) +{ + return float32_mul(a, b); +} + +float32 __aeabi_fsub(float32 a, float32 b) +{ + return float32_sub(a, b); +} + Added: head/lib/libc/arm/aeabi/aeabi_unwind_cpp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_unwind_cpp.c Sat Jan 19 05:33:55 2013 (r245655) @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2011 Andrew Turner + * 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. + * + */ + +/* + * Provide an implementation of __aeabi_unwind_cpp_pr{0,1,2}. These are + * required by libc but are implemented in libgcc_eh.a which we don't link + * against. The libgcc_eh.a version will be called so we call abort to + * check this. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +void __aeabi_unwind_cpp_pr0(void) __hidden; +void __aeabi_unwind_cpp_pr1(void) __hidden; +void __aeabi_unwind_cpp_pr2(void) __hidden; + +void +__aeabi_unwind_cpp_pr0(void) +{ + abort(); +} + +void +__aeabi_unwind_cpp_pr1(void) +{ + abort(); +} + +void +__aeabi_unwind_cpp_pr2(void) +{ + abort(); +} +