Hi Kyrill,

On 03.11.14 12:44, Kyrill Tkachov wrote:

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

Thank you!

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...

Well, I mentioned it in another response, it was unfortunate from me to write the equal sign. What we currently do is the following:

ARM_ARCH >= 6 becomes armv6*-*-freebsd*
ARM_ARCH <= 5 becomes arm-*-freebsd*

So, would you suggest to leave the SUBTARGET_CPU_DEFAULT away?

+
+#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

Would fall under armv6 with the above rule.

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?

Aehm, this is left over from a trial where I tried an armv7hf-*-freebsd*. This does not exist yet and I'm not sure if we really want that.

Regarding armv8, for the 64-bit there will be another triplet. armv8 with AArch32 would also fall under armv6 now, but I can not say how it would behave, I lack the hardware ;)

Thanks for the feedback.

Andreas

Reply via email to