Patchwork [v5,19/21] configure: Add handling code for AArch64 targets

login
register
mail settings
Submitter Peter Maydell
Date July 1, 2013, 5:35 p.m.
Message ID <1372700120-8896-20-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/256201/
State New
Headers show

Comments

Peter Maydell - July 1, 2013, 5:35 p.m.
From: Alexander Graf <agraf@suse.de>

Add the necessary code to configure to handle AArch64 as a target
CPU (we already have some code for supporting it as host). Note
that this doesn't enable the AArch64 targets yet.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: John Rigby <john.rigby@linaro.org>
Message-id: 1368505980-17151-12-git-send-email-john.rigby@linaro.org
[PMM:
 * don't need to set TARGET_ABI_DIR to aarch64 as that is the default
 * don't build nwfpe -- this is 32 bit legacy only
 * rewrite commit message
 * add aarch64 to the list of "fdt required" targets
]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 configure |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
Peter Maydell - Sept. 2, 2013, 4:44 p.m.
On 1 July 2013 18:35, Peter Maydell <peter.maydell@linaro.org> wrote:
> From: Alexander Graf <agraf@suse.de>
>
> Add the necessary code to configure to handle AArch64 as a target
> CPU (we already have some code for supporting it as host). Note
> that this doesn't enable the AArch64 targets yet.
> +  aarch64)
> +    TARGET_BASE_ARCH=arm
> +    bflt="yes"
> +    target_nptl="yes"
> +    gdb_xml_files="aarch64-core.xml aarch64-fpu.xml"
> +    target_long_alignment=8

This is a holdover from before Paolo cleaned up the ABI
type alignment handling -- we need to add handling in
abitypes.h now.

-- PMM
Peter Maydell - Sept. 2, 2013, 5:03 p.m.
On 2 September 2013 17:44, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 1 July 2013 18:35, Peter Maydell <peter.maydell@linaro.org> wrote:
>> From: Alexander Graf <agraf@suse.de>
>>
>> Add the necessary code to configure to handle AArch64 as a target
>> CPU (we already have some code for supporting it as host). Note
>> that this doesn't enable the AArch64 targets yet.
>> +  aarch64)
>> +    TARGET_BASE_ARCH=arm
>> +    bflt="yes"
>> +    target_nptl="yes"
>> +    gdb_xml_files="aarch64-core.xml aarch64-fpu.xml"
>> +    target_long_alignment=8
>
> This is a holdover from before Paolo cleaned up the ABI
> type alignment handling -- we need to add handling in
> abitypes.h now.

Except that the default abitypes.h code is correct for
AArch64, so no extra code required. I'll just drop that
line (and the equally out of date target_nptl="yes").

Aside: I wonder why we have
#ifdef TARGET_ARM
#define ABI_LLONG_ALIGNMENT 4
#endif

given that the ARM procedure calling standard says that
64 bit integers are 8 aligned, and gcc's __alignof__
agrees with that (gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2)

Laurent's commit message from 2011 for
c2e3dee6e gives gcc output for ARM of "alignof(long long) 4"
so either that wasn't APCS or gcc was buggy...

-- PMM

Patch

diff --git a/configure b/configure
index 0e0adde..2f83771 100755
--- a/configure
+++ b/configure
@@ -2491,7 +2491,7 @@  fi
 fdt_required=no
 for target in $target_list; do
   case $target in
-    arm*-softmmu|ppc*-softmmu|microblaze*-softmmu)
+    aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu)
       fdt_required=yes
     ;;
   esac
@@ -4169,6 +4169,13 @@  case "$target_name" in
     target_nptl="yes"
     gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
   ;;
+  aarch64)
+    TARGET_BASE_ARCH=arm
+    bflt="yes"
+    target_nptl="yes"
+    gdb_xml_files="aarch64-core.xml aarch64-fpu.xml"
+    target_long_alignment=8
+  ;;
   cris)
     target_nptl="yes"
   ;;