svn commit: r228389 - in projects/arm_eabi: contrib/gcc/config/arm
gnu/lib/libgcc gnu/usr.bin/cc/cc_tools
Andrew Turner
andrew at FreeBSD.org
Sat Dec 10 07:48:50 UTC 2011
Author: andrew
Date: Sat Dec 10 07:48:50 2011
New Revision: 228389
URL: http://svn.freebsd.org/changeset/base/228389
Log:
Get GCC producing what appears to be ARM EABI binaries.
Currently we are required to explicitly link against libgcc_s to get the
__aeabi_* symbols. ld should be performing this, however its --as-needed
argument appears to not be working.
Modified:
projects/arm_eabi/contrib/gcc/config/arm/freebsd.h
projects/arm_eabi/gnu/lib/libgcc/Makefile
projects/arm_eabi/gnu/usr.bin/cc/cc_tools/Makefile
Modified: projects/arm_eabi/contrib/gcc/config/arm/freebsd.h
==============================================================================
--- projects/arm_eabi/contrib/gcc/config/arm/freebsd.h Sat Dec 10 07:29:06 2011 (r228388)
+++ projects/arm_eabi/contrib/gcc/config/arm/freebsd.h Sat Dec 10 07:48:50 2011 (r228389)
@@ -30,7 +30,7 @@
#undef SUBTARGET_EXTRA_ASM_SPEC
#define SUBTARGET_EXTRA_ASM_SPEC \
- "-matpcs %{fpic|fpie:-k} %{fPIC|fPIE:-k}"
+ "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4} %{fpic|fpie:-k} %{fPIC|fPIE:-k}"
/* Default to full FPA if -mhard-float is specified. */
#undef SUBTARGET_ASM_FLOAT_SPEC
@@ -56,20 +56,28 @@
/************************[ Target stuff ]***********************************/
#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (FreeBSD/StrongARM ELF)");
+#define TARGET_VERSION fprintf (stderr, " (FreeBSD/ARM ELF)");
#ifndef TARGET_ENDIAN_DEFAULT
#define TARGET_ENDIAN_DEFAULT 0
#endif
-/* Default it to use ATPCS with soft-VFP. */
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT \
- (MASK_APCS_FRAME \
- | TARGET_ENDIAN_DEFAULT)
+/* We default to a soft-float ABI so that binaries can run on all
+ target hardware. */
+#undef TARGET_DEFAULT_FLOAT_ABI
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
#undef ARM_DEFAULT_ABI
-#define ARM_DEFAULT_ABI ARM_ABI_ATPCS
+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ FBSD_TARGET_OS_CPP_BUILTINS(); \
+ TARGET_BPABI_CPP_BUILTINS(); \
+ } \
+ while (false)
/* Define the actual types of some ANSI-mandated types.
Needs to agree with <machine/ansi.h>. GCC defaults come from c-decl.c,
@@ -87,7 +95,7 @@
#undef WCHAR_TYPE
#undef SUBTARGET_CPU_DEFAULT
-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_strongarm
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9
/* FreeBSD does its profiling differently to the Acorn compiler. We
don't need a word following the mcount call; and to skip it
@@ -121,5 +129,3 @@ do \
} \
while (0)
-#undef FPUTYPE_DEFAULT
-#define FPUTYPE_DEFAULT FPUTYPE_VFP
Modified: projects/arm_eabi/gnu/lib/libgcc/Makefile
==============================================================================
--- projects/arm_eabi/gnu/lib/libgcc/Makefile Sat Dec 10 07:29:06 2011 (r228388)
+++ projects/arm_eabi/gnu/lib/libgcc/Makefile Sat Dec 10 07:48:50 2011 (r228389)
@@ -54,7 +54,9 @@ LIB2FUNCS+= _fixuns${mode}si
# Likewise double-word routines.
.for mode in sf df xf tf
LIB2FUNCS+= _fix${mode}di _fixuns${mode}di
+.if ${TARGET_CPUARCH} != "arm"
LIB2FUNCS+= _floatdi${mode} _floatundi${mode}
+.endif
.endfor
LIB2ADD = $(LIB2FUNCS_EXTRA)
@@ -108,15 +110,18 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udi
CFLAGS+= -Dinhibit_libc -fno-inline
LIB1ASMSRC = lib1funcs.asm
LIB1ASMFUNCS = _dvmd_tls _bb_init_func
-LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
+LIB1ASMFUNCS+= _udivsi3 _divsi3 _umodsi3 _modsi3\
+ _call_via_rX _interwork_call_via_rX \
+ _lshrdi3 _ashrdi3 _ashldi3 \
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
+ _fixsfsi _fixunssfsi _floatdidf _floatdisf \
+ _aeabi_ulcmp _aeabi_ldivmod _aeabi_uldivmod
+LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c
+LIB2FUNCS_EXTRA = bpabi.c
-# Not now
-#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func
-#LIB1ASMFUNCS+= _call_via_rX _interwork_call_via_rX \
-# _lshrdi3 _ashrdi3 _ashldi3 \
-# _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
-# _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
-# _fixsfsi _fixunssfsi _floatdidf _floatdisf
+# Make bpabi.So depend on bpabi.c and not bpabi.S
+bpabi.So: bpabi.c
.endif
.if ${TARGET_CPUARCH} == mips
@@ -322,6 +327,9 @@ CLEANFILES += cs-*.h option*
SHLIB_MKMAP = ${GCCDIR}/mkmap-symver.awk
SHLIB_MKMAP_OPTS =
SHLIB_MAPFILES = ${GCCDIR}/libgcc-std.ver
+.if ${TARGET_CPUARCH} == "arm"
+SHLIB_MAPFILES += ${GCCDIR}/config/arm/libgcc-bpabi.ver
+.endif
VERSION_MAP = libgcc.map
libgcc.map: ${SHLIB_MKMAP} ${SHLIB_MAPFILES} ${SOBJS} ${OBJS:R:S/$/.So/}
Modified: projects/arm_eabi/gnu/usr.bin/cc/cc_tools/Makefile
==============================================================================
--- projects/arm_eabi/gnu/usr.bin/cc/cc_tools/Makefile Sat Dec 10 07:29:06 2011 (r228388)
+++ projects/arm_eabi/gnu/usr.bin/cc/cc_tools/Makefile Sat Dec 10 07:48:50 2011 (r228389)
@@ -51,6 +51,7 @@ TARGET_INC+= ${GCC_CPU}/elf.h
.endif
.if ${TARGET_CPUARCH} == "arm"
TARGET_INC+= ${GCC_CPU}/aout.h
+TARGET_INC+= ${GCC_CPU}/bpabi.h
.endif
.if ${TARGET_ARCH} == "powerpc64"
TARGET_INC+= ${GCC_CPU}/biarch64.h
@@ -358,7 +359,13 @@ gthr-default.h: ${GCCDIR}/gthr-posix.h
GENSRCS+= gthr-default.h
+.if ${TARGET_CPUARCH} == "arm"
+unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
+.else
unwind.h: ${GCCDIR}/unwind-generic.h
+.endif
+
+unwind.h:
ln -sf ${.ALLSRC} ${.TARGET}
GENSRCS+= unwind.h
More information about the svn-src-projects
mailing list