Author: andrew
Date: Thu Jan 17 05:56:28 2013
New Revision: 245539
URL: http://svnweb.freebsd.org/changeset/base/245539

Log:
  Add compiler support for the ARM EABI.
  
  ARM EABI support is disabled by default and can be enabled by setting
  WITH_ARM_EABI when building, however only the kernel-toolchain target will
  work with this flag until the rest of the support is added.

Added:
  head/tools/build/options/WITH_ARM_EABI   (contents, props changed)
Modified:
  head/contrib/gcc/config/arm/freebsd.h
  head/gnu/lib/csu/Makefile
  head/gnu/lib/libgcc/Makefile
  head/gnu/lib/libgcov/Makefile
  head/gnu/lib/libstdc++/Makefile
  head/gnu/usr.bin/cc/Makefile.inc
  head/gnu/usr.bin/cc/c++filt/Makefile
  head/gnu/usr.bin/cc/cc1/Makefile
  head/gnu/usr.bin/cc/cc1plus/Makefile
  head/gnu/usr.bin/cc/cc_int/Makefile
  head/gnu/usr.bin/cc/cc_tools/Makefile
  head/gnu/usr.bin/cc/doc/Makefile
  head/gnu/usr.bin/cc/gcov/Makefile
  head/gnu/usr.bin/cc/include/Makefile
  head/gnu/usr.bin/cc/libcpp/Makefile
  head/gnu/usr.bin/cc/libdecnumber/Makefile
  head/gnu/usr.bin/cc/libiberty/Makefile
  head/share/mk/bsd.own.mk

Modified: head/contrib/gcc/config/arm/freebsd.h
==============================================================================
--- head/contrib/gcc/config/arm/freebsd.h       Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/contrib/gcc/config/arm/freebsd.h       Thu Jan 17 05:56:28 2013        
(r245539)
@@ -29,8 +29,13 @@
   { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
 
 #undef SUBTARGET_EXTRA_ASM_SPEC
+#ifdef TARGET_ARM_EABI
+#define SUBTARGET_EXTRA_ASM_SPEC       \
+  "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4} %{fpic|fpie:-k} 
%{fPIC|fPIE:-k}"
+#else
 #define SUBTARGET_EXTRA_ASM_SPEC       \
   "-matpcs %{fpic|fpie:-k} %{fPIC|fPIE:-k}"
+#endif
 
 /* Default to full FPA if -mhard-float is specified. */
 #undef SUBTARGET_ASM_FLOAT_SPEC
@@ -61,8 +66,25 @@
 #define TARGET_ENDIAN_DEFAULT 0
 #endif
 
+#ifdef TARGET_ARM_EABI
+/* 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_AAPCS_LINUX
+
+#undef  TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+      FBSD_TARGET_OS_CPP_BUILTINS();           \
+      TARGET_BPABI_CPP_BUILTINS();             \
+    }                                          \
+  while (false)
+#else
 /* Default it to use ATPCS with soft-VFP.  */
-#undef TARGET_DEFAULT
 #define TARGET_DEFAULT                 \
   (MASK_APCS_FRAME                     \
    | TARGET_ENDIAN_DEFAULT)
@@ -70,6 +92,10 @@
 #undef ARM_DEFAULT_ABI
 #define ARM_DEFAULT_ABI ARM_ABI_ATPCS
 
+#undef FPUTYPE_DEFAULT
+#define FPUTYPE_DEFAULT FPUTYPE_VFP
+#endif
+
 /* Define the actual types of some ANSI-mandated types.
    Needs to agree with <machine/ansi.h>.  GCC defaults come from c-decl.c,
    c-common.c, and config/<arch>/<arch>.h.  */
@@ -134,5 +160,3 @@ do                                                          
        \
   }                                                                    \
 while (0)
 
-#undef FPUTYPE_DEFAULT
-#define FPUTYPE_DEFAULT FPUTYPE_VFP

Modified: head/gnu/lib/csu/Makefile
==============================================================================
--- head/gnu/lib/csu/Makefile   Thu Jan 17 05:55:53 2013        (r245538)
+++ head/gnu/lib/csu/Makefile   Thu Jan 17 05:56:28 2013        (r245539)
@@ -24,6 +24,10 @@ CFLAGS+=     -I${GCCLIB}/include -I${GCCDIR}
 CRTS_CFLAGS=   -DCRTSTUFFS_O -DSHARED ${PICFLAG}
 MKDEP=         -DCRT_BEGIN
 
+.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+CFLAGS+=       -DTARGET_ARM_EABI
+.endif
+
 .if ${MACHINE_CPUARCH} == "ia64"
 BEGINSRC=      crtbegin.asm
 ENDSRC=                crtend.asm

Modified: head/gnu/lib/libgcc/Makefile
==============================================================================
--- head/gnu/lib/libgcc/Makefile        Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/lib/libgcc/Makefile        Thu Jan 17 05:56:28 2013        
(r245539)
@@ -15,6 +15,10 @@ MK_SSP=      no
 
 .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt"
 
+.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+CFLAGS+=       -DTARGET_ARM_EABI
+.endif
+
 .if ${TARGET_CPUARCH} == "mips"
 LIB=           gcc
 .endif
@@ -55,10 +59,13 @@ LIB2FUNCS+= _fixuns${mode}si
 .endfor
 
 # Likewise double-word routines.
+.if ${TARGET_CPUARCH} != "arm" || ${MK_ARM_EABI} == "no"
+# These are implemented in an ARM specific file but will not be filtered out
 .for mode in sf df xf tf
 LIB2FUNCS+= _fix${mode}di _fixuns${mode}di
 LIB2FUNCS+= _floatdi${mode} _floatundi${mode}
 .endfor
+.endif
 
 LIB2ADD = $(LIB2FUNCS_EXTRA)
 LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
@@ -115,15 +122,14 @@ CFLAGS+=  -fheinous-gnu-extensions
 
 LIB1ASMSRC =   lib1funcs.asm
 LIB1ASMFUNCS =  _dvmd_tls _bb_init_func
-LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
+.if ${MK_ARM_EABI} != "no"
+LIB1ASMFUNCS+= _addsubdf3 _addsubsf3 _cmpdf2 _cmpsf2 _fixdfsi _fixsfsi \
+               _fixunsdfsi _fixunsdfsi _muldivdf3 _muldivsf3 _udivsi3
 
-# 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
+LIB2ADDEH =    unwind-arm.c libunwind.S pr-support.c unwind-c.c
+.else
+LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
+.endif
 .endif
 
 .if ${TARGET_CPUARCH} == mips
@@ -329,6 +335,9 @@ CLEANFILES += cs-*.h option*
 SHLIB_MKMAP      = ${GCCDIR}/mkmap-symver.awk
 SHLIB_MKMAP_OPTS =
 SHLIB_MAPFILES   = ${GCCDIR}/libgcc-std.ver
+.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+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: head/gnu/lib/libgcov/Makefile
==============================================================================
--- head/gnu/lib/libgcov/Makefile       Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/lib/libgcov/Makefile       Thu Jan 17 05:56:28 2013        
(r245539)
@@ -15,6 +15,11 @@ CFLAGS+=     -DIN_GCC -DIN_LIBGCC2 -D__GCC_F
 CFLAGS+=       -D_PTHREADS -DGTHREAD_USE_WEAK
 CFLAGS+=       -I${.CURDIR}/../../usr.bin/cc/cc_tools \
                -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I.
+
+.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+CFLAGS+=       -DTARGET_ARM_EABI
+.endif
+
 #
 # Library members defined in libgcov.c.
 # Defined in libgcov.c, included only in gcov library

Modified: head/gnu/lib/libstdc++/Makefile
==============================================================================
--- head/gnu/lib/libstdc++/Makefile     Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/lib/libstdc++/Makefile     Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 GCCVER=        4.2
 GCCDIR=        ${.CURDIR}/../../../contrib/gcc
 GCCLIB=        ${.CURDIR}/../../../contrib/gcclibs
@@ -14,7 +16,7 @@ LIB=          stdc++
 SHLIB_MAJOR=   6
 
 CFLAGS+=       -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
-.if ${MACHINE_CPUARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} == "no"
 CFLAGS+=       -D_GLIBCXX_SJLJ_EXCEPTIONS=1
 .endif
 CFLAGS+=       -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include
@@ -594,7 +596,13 @@ gthr-default.h: ${GCCDIR}/gthr-posix.h
 
 CLEANFILES+=   ${THRHDRS}
 
+.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
+.else
 unwind.h: ${GCCDIR}/unwind-generic.h
+.endif
+
+unwind.h:
        ln -sf ${.ALLSRC} ${.TARGET}
 
 SRCS+=         unwind.h

Modified: head/gnu/usr.bin/cc/Makefile.inc
==============================================================================
--- head/gnu/usr.bin/cc/Makefile.inc    Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/Makefile.inc    Thu Jan 17 05:56:28 2013        
(r245539)
@@ -26,6 +26,10 @@ CSTD?=       gnu89
 CFLAGS+=       -DCROSS_COMPILE
 .endif
 
+.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+CFLAGS+=       -DTARGET_ARM_EABI
+.endif
+
 .if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "armv6eb"
 CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
 .endif

Modified: head/gnu/usr.bin/cc/c++filt/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/c++filt/Makefile        Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/c++filt/Makefile        Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,5 +1,8 @@
 # $FreeBSD$
 
+NO_MAN=
+.include <bsd.own.mk>
+
 .include "../Makefile.inc"
 .include "../Makefile.fe"
 
@@ -7,7 +10,6 @@
 
 PROG=  c++filt
 SRCS=  cp-demangle.c
-NO_MAN=
 
 CFLAGS+= -DSTANDALONE_DEMANGLER -DVERSION=\"$(GCC_VERSION)\"
 

Modified: head/gnu/usr.bin/cc/cc1/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/cc1/Makefile    Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/cc1/Makefile    Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,9 +1,10 @@
 # $FreeBSD$
 
-.include "../Makefile.inc"
 NO_MAN=
 .include <bsd.own.mk>
 
+.include "../Makefile.inc"
+
 .PATH: ${GCCDIR}
 
 PROG=  cc1

Modified: head/gnu/usr.bin/cc/cc1plus/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/cc1plus/Makefile        Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/cc1plus/Makefile        Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,9 +1,10 @@
 # $FreeBSD$
 
-.include "../Makefile.inc"
 NO_MAN=
 .include <bsd.own.mk>
 
+.include "../Makefile.inc"
+
 .PATH: ${GCCDIR}/cp ${GCCDIR}
 
 PROG=  cc1plus

Modified: head/gnu/usr.bin/cc/cc_int/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/cc_int/Makefile Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/cc_int/Makefile Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 .include "../Makefile.inc"
 .include "../Makefile.ver"
 

Modified: head/gnu/usr.bin/cc/cc_tools/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/cc_tools/Makefile       Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/cc_tools/Makefile       Thu Jan 17 05:56:28 2013        
(r245539)
@@ -51,6 +51,9 @@ TARGET_INC+=  ${GCC_CPU}/elf.h
 .endif
 .if ${TARGET_CPUARCH} == "arm"
 TARGET_INC+=   ${GCC_CPU}/aout.h
+.if ${MK_ARM_EABI} != "no"
+TARGET_INC+=   ${GCC_CPU}/bpabi.h
+.endif
 .endif
 .if ${TARGET_ARCH} == "powerpc64"
 TARGET_INC+=   ${GCC_CPU}/biarch64.h
@@ -349,7 +352,13 @@ gthr-default.h: ${GCCDIR}/gthr-posix.h
 
 GENSRCS+=      gthr-default.h
 
+.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+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

Modified: head/gnu/usr.bin/cc/doc/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/doc/Makefile    Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/doc/Makefile    Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 .include "../Makefile.inc"
 .include "../Makefile.ver"
 

Modified: head/gnu/usr.bin/cc/gcov/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/gcov/Makefile   Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/gcov/Makefile   Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 .include "../Makefile.inc"
 .include "../Makefile.ver"
 

Modified: head/gnu/usr.bin/cc/include/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/include/Makefile        Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/include/Makefile        Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 .include "../Makefile.inc"
 
 INCSDIR=${INCLUDEDIR}/gcc/${GCCVER}

Modified: head/gnu/usr.bin/cc/libcpp/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/libcpp/Makefile Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/libcpp/Makefile Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 # Use our headers in preference to ones from ../cc_tools.
 CFLAGS+=       -I${.CURDIR} -I.
 

Modified: head/gnu/usr.bin/cc/libdecnumber/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/libdecnumber/Makefile   Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/libdecnumber/Makefile   Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 # Use our headers in preference to ones from ../cc_tools.
 CFLAGS+=       -I${.CURDIR} -I.
 

Modified: head/gnu/usr.bin/cc/libiberty/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/libiberty/Makefile      Thu Jan 17 05:55:53 2013        
(r245538)
+++ head/gnu/usr.bin/cc/libiberty/Makefile      Thu Jan 17 05:56:28 2013        
(r245539)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include <bsd.own.mk>
+
 #
 # Make sure we will pick up our config.h file first, not the one from
 # cc_tools.

Modified: head/share/mk/bsd.own.mk
==============================================================================
--- head/share/mk/bsd.own.mk    Thu Jan 17 05:55:53 2013        (r245538)
+++ head/share/mk/bsd.own.mk    Thu Jan 17 05:56:28 2013        (r245539)
@@ -343,6 +343,7 @@ __DEFAULT_YES_OPTIONS = \
     ZONEINFO
 
 __DEFAULT_NO_OPTIONS = \
+    ARM_EABI \
     BIND_IDN \
     BIND_LARGE_FILE \
     BIND_LIBS \

Added: head/tools/build/options/WITH_ARM_EABI
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_ARM_EABI      Thu Jan 17 05:56:28 2013        
(r245539)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set the ARM ABI to EABI.
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to