Hi Andreas,

CC'ing arm maintainers and a couple of comments inline.

On 02/11/14 22:11, Andreas Tobler wrote:
Hello all,

this is a patch which brings support for arm*-*-freebsd* to trunk.
The architectures supported are arm-*-*freebsd*, armv6-*-freebsd* and
armv6hf-*-freebsd*.
armv6 stands for ARM_ARCH == 6, arm stands for ARM_ARCH < 6.

Why split at ARM_ARCH == 6 ? I see in the patch you define TARGET_FREEBSD_ARMv6 but only ever use it to define the SUBTARGET_CPU_DEFAULT. In the other arm triplets I don't think
we have architecture-specific identifiers in the arm* parts...

+
+#if defined (TARGET_FREEBSD_ARMv6)
+#undef  SUBTARGET_CPU_DEFAULT
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm1176jzs
+#else
+#undef  SUBTARGET_CPU_DEFAULT
+#define SUBTARGET_CPU_DEFAULT   TARGET_CPU_arm9
+#endif
+

What about ARMv7? The default CPU there is TARGET_CPU_cortexa8

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc      (revision 217020)
+++ gcc/config.gcc      (working copy)
@@ -259,7 +259,6 @@
     arm*-wince-pe*                     \
   | arm*-*-ecos-elf                    \
   | arm*-*-elf                         \
- | arm*-*-freebsd*                     \
   | arm*-*-linux*                      \
   | arm*-*-uclinux*                    \
   | i[34567]86-go32-*                  \
@@ -1000,6 +999,27 @@
        extra_options="${extra_options} arm/vxworks.opt"
        tmake_file="${tmake_file} arm/t-arm arm/t-vxworks"
        ;;
+arm*-*-freebsd*)                # ARM FreeBSD EABI
+       tm_file="dbxelf.h elfos.h ${fbsd_tm_file} arm/elf.h"
+       case $target in
+       arm*b-*-freebsd*)
+           tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+           ;;
+       esac
+       tmake_file="${tmake_file} arm/t-arm arm/t-bpabi"
+       tm_file="${tm_file} arm/bpabi.h arm/freebsd.h arm/aout.h arm/arm.h"
+       case $target in
+       armv[67]*-*-freebsd*)
+           tm_defines="${tm_defines} TARGET_FREEBSD_ARMv6=1"
+           ;;
+       esac

So you also match armv7*-*-freebsd*. As mentioned above I'm not sure why we would want these per-architecture triplets. If we do want to have these per-architecture triplets, there is also the ARMv8 AArch32 state which is supported in the arm backend and can be identified by ARM_ARCH == 8. Do we want to add an armv8*-*-freebsd triplet as well?

Cheers,
Kyrill


Reply via email to