Skip to contentSkip to conversation

sane-toolchain.inc: THUMB_INTERWORK should not be defined for armv4 and add armv4 to ARM EABI supporting architectures.

PATCH In review Khem Raj 2 participants 9 messages Jul 19, 2010 – Jul 20, 2010

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 sane-toolchain.inc: THUMB_INTERWORK should not be defined for armv4 and add armv4 to ARM EABI supporting architectures.

---
 conf/distro/include/sane-toolchain.inc |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
conf/distro/include/sane-toolchain.inc +8 -3
index 6b6b170..8d9912f 100644
@@ -86,7 +86,12 @@ ARM_INSTRUCTION_SET = "${PREFERRED_ARM_INSTRUCTION_SET}"
 #    but requires more instructions (140% for 70% smaller code) so may be
 #    slower.
 
-THUMB_INTERWORK = "yes"
+# armv4 does not have thumb instruction set therefore no interworking instructions
+# so if machine is based on armv4 we dont have choice.
+
+THUMB_INTERWORK_armv4 = "no"
+THUMB_INTERWORK ?= "yes"
+
 # "yes" "no"
 #    Whether to compile with code to allow interworking between the two
 #    instruction sets.  This allows thumb code to be executed on a primarily
@@ -145,7 +150,7 @@ def detect_arm_abi (d):
 			return "oabi"
 		else:
 			return ""
-	if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'arm', 'armeb' ]:          
+	if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'arm', 'armeb' ]:
 		if 'eabi' in bb.data.getVar('DISTRO_FEATURES',d).split():
 			return "eabi"
 		return "oabi"
@@ -154,7 +159,7 @@ def detect_arm_abi (d):
 def compute_os_portion_of_target_triplet (d):
 	import bb
 	arm_eabi_supporting_arches = "armv6 armv6-novfp \
-	armv5te iwmmxt armv7a armv7 armv5teb armv4t"
+	armv5te iwmmxt armv7a armv7 armv5teb armv4t armv4"
 	ppc_spe_supporting_arches = "ppce500v2 ppce500"
 	gnu_suffix = ""
 	if bb.data.getVar('LIBC', d, 1) == "uclibc":
Signature · 1 line
1.7.0.4
#1 lore raw

conf/distro/include/sane-toolchain.inc ARM_INSTRUCTION_SET = "${PREFERRED_ARM_INSTRUCTION_SET}" · line 93

Quoted 6 lines · Khem Raj
conf/distro/include/sane-toolchain.inc +5 -1
-THUMB_INTERWORK = "yes"
+# armv4 does not have thumb instruction set therefore no interworking instructions
+# so if machine is based on armv4 we dont have choice.
+
+THUMB_INTERWORK_armv4 = "no"
+THUMB_INTERWORK ?= "yes"

I don't think this is necessary or desirable. If you are building for v4 then the BX instructions ought to be fixed up during final link. Is there a particular problem that you're trying to solve?

p.

author
#2 lore raw
Quoted 10 lines · Phil Blundell

conf/distro/include/sane-toolchain.inc ARM_INSTRUCTION_SET = "${PREFERRED_ARM_INSTRUCTION_SET}" · line 93

Quoted 6 lines · Khem Raj
conf/distro/include/sane-toolchain.inc +5 -1
-THUMB_INTERWORK = "yes"
+# armv4 does not have thumb instruction set therefore no interworking instructions
+# so if machine is based on armv4 we dont have choice.
+
+THUMB_INTERWORK_armv4 = "no"
+THUMB_INTERWORK ?= "yes"

I don't think this is necessary or desirable.  If you are building for v4 then the BX instructions ought to be fixed up during final link.

Yes with --fix-v4bx/--fix-v4bx-interworking its possible.

Is

Quoted 2 lines

there a particular problem that you're trying to solve?

Not any particular case but some versions of compiler do not pass flags to --fix-v4bx-interworking ld.

I was thinking its more apt to describe the machine with not supporting THUMB_INTERWORK
hmmm but I now I see that we will need it for v4/EABI support. So better fix the compiler.

Quoted 9 lines

p.

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#3 lore raw
Quoted 15 lines · Khem Raj
Quoted 10 lines · Phil Blundell

conf/distro/include/sane-toolchain.inc ARM_INSTRUCTION_SET = "${PREFERRED_ARM_INSTRUCTION_SET}" · line 93

Quoted 6 lines · Khem Raj
conf/distro/include/sane-toolchain.inc +5 -1
-THUMB_INTERWORK = "yes"
+# armv4 does not have thumb instruction set therefore no interworking instructions
+# so if machine is based on armv4 we dont have choice.
+
+THUMB_INTERWORK_armv4 = "no"
+THUMB_INTERWORK ?= "yes"

I don't think this is necessary or desirable. If you are building for v4 then the BX instructions ought to be fixed up during final link.

Yes with --fix-v4bx/--fix-v4bx-interworking its possible.

Quoted 6 lines

Is

Quoted 2 lines

there a particular problem that you're trying to solve?

Not any particular case but some versions of compiler do not pass flags to --fix-v4bx-interworking ld.

True. But this is sane-toolchain we're talking about, and the version that it selects by default (4.4.4) does get this right. So I don't think it's going to be a big deal in practice.

p.

author
#4 lore raw
Quoted 20 lines · Phil Blundell
Quoted 19 lines · Khem Raj
Quoted 10 lines · Phil Blundell

conf/distro/include/sane-toolchain.inc ARM_INSTRUCTION_SET = "${PREFERRED_ARM_INSTRUCTION_SET}" · line 93

Quoted 6 lines · Khem Raj
conf/distro/include/sane-toolchain.inc +5 -1
-THUMB_INTERWORK = "yes"
+# armv4 does not have thumb instruction set therefore no interworking instructions
+# so if machine is based on armv4 we dont have choice.
+
+THUMB_INTERWORK_armv4 = "no"
+THUMB_INTERWORK ?= "yes"

I don't think this is necessary or desirable.  If you are building for v4 then the BX instructions ought to be fixed up during final link.

Yes with --fix-v4bx/--fix-v4bx-interworking its possible.

Is

Quoted 2 lines

there a particular problem that you're trying to solve?

Quoted 6 lines
Quoted 2 lines

Not any particular case but some versions of compiler do not pass flags to --fix-v4bx-interworking ld.

True.  But this is sane-toolchain we're talking about, and the version that it selects by default (4.4.4) does get this right.  So I don't think it's going to be a big deal in practice.

yes disregard that hunk.

Quoted 10 lines

p.

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#5 lore raw
In reply to Khem Raj

conf/distro/include/sane-toolchain.inc def detect_arm_abi (d): · line 163

Quoted 5 lines · Khem Raj
conf/distro/include/sane-toolchain.inc +1 -1
 	import bb
 	arm_eabi_supporting_arches = "armv6 armv6-novfp \
-	armv5te iwmmxt armv7a armv7 armv5teb armv4t"
+	armv5te iwmmxt armv7a armv7 armv5teb armv4t armv4"
 	ppc_spe_supporting_arches = "ppce500v2 ppce500"

I guess it would make more sense to enumerate here the ARM arches which don't support eabi. All future ones will, presumably, so it's only ARMv3 and older which don't. That way we won't have to keep adjusting this list for every new architecture variant that someone thinks up.

p.

author
#6 lore raw
Quoted 11 lines · Phil Blundell
Quoted 5 lines · Khem Raj

      import bb
      arm_eabi_supporting_arches = "armv6 armv6-novfp \
-     armv5te iwmmxt armv7a armv7 armv5teb armv4t"
+     armv5te iwmmxt armv7a armv7 armv5teb armv4t armv4" ppc_spe_supporting_arches = "ppce500v2 ppce500"

I guess it would make more sense to enumerate here the ARM arches which don't support eabi.  All future ones will, presumably, so it's only ARMv3 and older which don't.  That way we won't have to keep adjusting this list for every new architecture variant that someone thinks up.

yes thats good idea.

Quoted 10 lines

p.

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

author
#7 lore raw
In reply to Phil Blundell
Quoted 7 lines · Phil Blundell
Quoted 5 lines · Khem Raj

      import bb
      arm_eabi_supporting_arches = "armv6 armv6-novfp \
-     armv5te iwmmxt armv7a armv7 armv5teb armv4t"
+     armv5te iwmmxt armv7a armv7 armv5teb armv4t armv4" ppc_spe_supporting_arches = "ppce500v2 ppce500"

Quoted 5 lines

I guess it would make more sense to enumerate here the ARM arches which don't support eabi.  All future ones will, presumably, so it's only ARMv3 and older which don't.  That way we won't have to keep adjusting this list for every new architecture variant that someone thinks up.

and I think the oldest arm architecture we support is armv4 which means we may not need this check at all anymore.

Quoted 9 lines

p.

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#8 lore raw
Quoted 2 lines · Khem Raj

and I think the oldest arm architecture we support is armv4 which means we may not need this check at all anymore.

Yeah, that might well be right. I had thought there were some ARM710 (which is armv3) machines supported, but I can't see any trace of them now so either I imagined it or they have been deleted.

p.