Skip to contentSkip to conversation

configure: Unify arm and aarch64 disas configury

PATCH In review Peter Crosthwaite 3 participants 8 messages May 26, 2015 – Jun 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: Unify arm and aarch64 disas configury

From: Peter Crosthwaite <[email protected]>

The "arm" variant for this case already contains everything needed for aarch64. As aarch64 already uses arm as a base architecture, it will already have the CONFIG_ARM_DIS defined meaning no functional change. So just make the configure code simpler.

Following this patch:

$ ./configure --target-list=aarch64-softmmu,aarch64-linux-user
$ grep DIS aarch64-softmmu/config-target.mak
CONFIG_I386_DIS=y
CONFIG_ARM_DIS=y
CONFIG_ARM_A64_DIS=y
$ grep DIS aarch64-linux-user/config-target.mak
CONFIG_I386_DIS=y
CONFIG_ARM_DIS=y
CONFIG_ARM_A64_DIS=y

---
Helps with multi-arch, less code paths to convert to multi-arch for multi-arches many-way disas configury.

---
 configure | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
configure +1 -7
index f758f32..3145dd6 100755
@@ -5405,13 +5405,7 @@ for i in $ARCH $TARGET_BASE_ARCH ; do
     echo "CONFIG_ALPHA_DIS=y"  >> $config_target_mak
     echo "CONFIG_ALPHA_DIS=y"  >> config-all-disas.mak
   ;;
-  aarch64)
-    if test -n "${cxx}"; then
-      echo "CONFIG_ARM_A64_DIS=y"  >> $config_target_mak
-      echo "CONFIG_ARM_A64_DIS=y"  >> config-all-disas.mak
-    fi
-  ;;
-  arm)
+  arm|aarch64)
     echo "CONFIG_ARM_DIS=y"  >> $config_target_mak
     echo "CONFIG_ARM_DIS=y"  >> config-all-disas.mak
     if test -n "${cxx}"; then
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Peter Crosthwaite

From: Peter Crosthwaite <[email protected]>

The "arm" variant for this case already contains everything needed for aarch64. As aarch64 already uses arm as a base architecture, it will already have the CONFIG_ARM_DIS defined meaning no functional change. So just make the configure code simpler.

I'm wondering why we needed to put the A64 disassembler into the "arm" variant at all...

-- PMM

#2 lore raw
Quoted 11 lines · Peter Maydell
Quoted 6 lines · Peter Crosthwaite

From: Peter Crosthwaite <[email protected]>

The "arm" variant for this case already contains everything needed for aarch64. As aarch64 already uses arm as a base architecture, it will already have the CONFIG_ARM_DIS defined meaning no functional change. So just make the configure code simpler.

I'm wondering why we needed to put the A64 disassembler into the "arm" variant at all...

That probably works too. I'm trying to get rid of the dup. respin it?

Regards,
Peter

Quoted 2 lines

-- PMM

#3 lore raw
Quoted 10 lines · Peter Crosthwaite
Quoted 8 lines · Peter Maydell
Quoted 6 lines · Peter Crosthwaite

From: Peter Crosthwaite <[email protected]>

The "arm" variant for this case already contains everything needed for aarch64. As aarch64 already uses arm as a base architecture, it will already have the CONFIG_ARM_DIS defined meaning no functional change. So just make the configure code simpler.

Quoted 5 lines
Quoted 3 lines

I'm wondering why we needed to put the A64 disassembler into the "arm" variant at all...

That probably works too. I'm trying to get rid of the dup. respin it?

I think it would look more like the other entries in the case statement, so worth trying. Maybe we'll find out why it's done this way :-)

-- PMM

#4 lore raw
Quoted 11 lines · Peter Maydell
Quoted 10 lines · Peter Crosthwaite
Quoted 8 lines · Peter Maydell
Quoted 6 lines · Peter Crosthwaite

From: Peter Crosthwaite <[email protected]>

The "arm" variant for this case already contains everything needed for aarch64. As aarch64 already uses arm as a base architecture, it will already have the CONFIG_ARM_DIS defined meaning no functional change. So just make the configure code simpler.

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

I'm wondering why we needed to put the A64 disassembler into the "arm" variant at all...

That probably works too. I'm trying to get rid of the dup. respin it?

I think it would look more like the other entries in the case statement, so worth trying. Maybe we'll find out why it's done this way :-)

OK I am at the bottom of it. The case statement only handles the base arch and the host arch not the actual target arch. This means the "arm)" case is all that is called for aarch64 target. the "aarch64)" case in existing code is presumably to handle an AArch64 host. So the current code will produce the minimal working configury. My patch will still work, but will unneedingly add AArch32 disas to AA64 host. A solution would be to patch that loop to go through all of the base arch, target arch and host arch. Anyone know of a reason not to do so?

Regards,
Peter

Quoted 2 lines

-- PMM

#5 lore raw
Quoted 2 lines · Peter Crosthwaite

OK I am at the bottom of it. The case statement only handles the base arch and the host arch not the actual target arch.

Aha.

Quoted 5 lines

This means the
"arm)" case is all that is called for aarch64 target. the "aarch64)" case in existing code is presumably to handle an AArch64 host. So the current code will produce the minimal working configury. My patch will still work, but will unneedingly add AArch32 disas to AA64 host.

Presumably also the current code will unnecessarily add an A64 disassembler for all AArch32 host builds.

Quoted 2 lines

A solution would be to patch that loop to go through all of the base arch, target arch and host arch. Anyone know of a reason not to do so?

Not offhand, but then I didn't figure out how the current code worked when I looked at it :-) We'd get duplicate lines in the config files, but we already have those when host==target.

-- PMM

#6 lore raw
Quoted 15 lines · Peter Maydell
Quoted 2 lines · Peter Crosthwaite

OK I am at the bottom of it. The case statement only handles the base arch and the host arch not the actual target arch.

Aha.

Quoted 5 lines

This means the
"arm)" case is all that is called for aarch64 target. the "aarch64)" case in existing code is presumably to handle an AArch64 host. So the current code will produce the minimal working configury. My patch will still work, but will unneedingly add AArch32 disas to AA64 host.

Presumably also the current code will unnecessarily add an A64 disassembler for all AArch32 host builds.

Quoted 7 lines
Quoted 2 lines

A solution would be to patch that loop to go through all of the base arch, target arch and host arch. Anyone know of a reason not to do so?

Not offhand, but then I didn't figure out how the current code worked when I looked at it :-) We'd get duplicate lines in the config files, but we already have those when host==target.

Brute force it and sort -u? sort is considered a coreutil by at least my manpages so I wonder if we can assume it is universally available.

Regards,
Peter

Quoted 2 lines

-- PMM

#7 lore raw
Quoted 7 lines · Peter Crosthwaite
Quoted 3 lines · Peter Maydell

worked when I looked at it :-) We'd get duplicate lines in the config files, but we already have those when host==target.

Brute force it and sort -u? sort is considered a coreutil by at least my manpages so I wonder if we can assume it is universally available.

It's only a minor cosmetic thing in a file nobody looks at, so I'm not sure it's worth the effort.

(We already use 'sort -u' in our Makefiles, incidentally.)

-- PMM