Skip to contentSkip to conversation

gcc-target.inc: configure gcc for armv7ve targets to default to armv7ve

PATCH In review Andre McCurdy 2 participants 4 messages Jun 7, 2018 – Jun 13, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gcc-target.inc: configure gcc for armv7ve targets to default to armv7ve

Originally these ARM specific EXTRA_OECONF options were applied to both gcc for the target and gcc-cross. That lead to a compromise being made: gcc on the target was configured to default to an ARM architecture which was at least compatible with the target (but not necessarily an exact match) and gcc-cross was configured default to armv7a for both armv7a and armv7ve (to avoid gcc-cross rebuilds when switching between the two).

However, when these ARM specific EXTRA_OECONF options were moved from gcc-configure-common.inc into gcc-target.inc (ie they were made to apply only to gcc on the target) the compromise no longer needed to be made.

http://git.openembedded.org/openembedded-core/commit/?id=851937dde81de2a9ef54c5f19a78fb12fb82afd4

---
 meta/recipes-devtools/gcc/gcc-target.inc | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
meta/recipes-devtools/gcc/gcc-target.inc +6 -5
index b6e31f5..56e4b95 100644
@@ -9,13 +9,14 @@ EXTRA_OECONF_PATHS = "\
 
 EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
 
-# ARMv6+ adds atomic instructions that affect the ABI in libraries built
-# with TUNE_CCARGS in gcc-runtime.  Make the compiler default to a
-# compatible architecture.  armv6 and armv7a cover the minimum tune
-# features used in OE.
+# Configure gcc running on the target to default to an architecture which will
+# be compatible with that of gcc-runtime (which is cross compiled to be target
+# specific). For example, for ARM, ARMv6+ adds atomic instructions that may
+# affect the ABI in the gcc-runtime libs. Since we can't rely on gcc on the
+# target to always be passed -march etc, its built-in default needs to be safe.
 EXTRA_OECONF_append_armv6 = " --with-arch=armv6"
 EXTRA_OECONF_append_armv7a = " --with-arch=armv7-a"
-EXTRA_OECONF_append_armv7ve = " --with-arch=armv7-a"
+EXTRA_OECONF_append_armv7ve = " --with-arch=armv7ve"
 
 # libcc1 requres gcc_cv_objdump when cross build, but gcc_cv_objdump is
 # set in subdir gcc, so subdir libcc1 can't use it, export it here to
Signature · 1 line
1.9.1
#1 lore raw
Quoted 8 lines · Andre McCurdy

Originally these ARM specific EXTRA_OECONF options were applied to both gcc for the target and gcc-cross. That lead to a compromise being made: gcc on the target was configured to default to an ARM architecture which was at least compatible with the target (but not necessarily an exact match) and gcc-cross was configured default to armv7a for both armv7a and armv7ve (to avoid gcc-cross rebuilds when switching between the two).

Quoted 7 lines

However, when these ARM specific EXTRA_OECONF options were moved from gcc-configure-common.inc into gcc-target.inc (ie they were made to apply only to gcc on the target) the compromise no longer needed to be made.

   http://git.openembedded.org/openembedded-core/commit/?id=851937dde81de2a9ef54c5f19a78fb12fb82afd4

this was done with a purpose so we can avoid gcc complaining about incompatible architectures when building programs on device. probably testing compiling some c++ apps on device might be good to validate this if at all this is working.

Quoted 30 lines
---
  meta/recipes-devtools/gcc/gcc-target.inc | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)
meta/recipes-devtools/gcc/gcc-target.inc +6 -5
index b6e31f5..56e4b95 100644
@@ -9,13 +9,14 @@ EXTRA_OECONF_PATHS = "\
 
  EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
 
-# ARMv6+ adds atomic instructions that affect the ABI in libraries built
-# with TUNE_CCARGS in gcc-runtime.  Make the compiler default to a
-# compatible architecture.  armv6 and armv7a cover the minimum tune
-# features used in OE.
+# Configure gcc running on the target to default to an architecture which will
+# be compatible with that of gcc-runtime (which is cross compiled to be target
+# specific). For example, for ARM, ARMv6+ adds atomic instructions that may
+# affect the ABI in the gcc-runtime libs. Since we can't rely on gcc on the
+# target to always be passed -march etc, its built-in default needs to be safe.
  EXTRA_OECONF_append_armv6 = " --with-arch=armv6"
  EXTRA_OECONF_append_armv7a = " --with-arch=armv7-a"
-EXTRA_OECONF_append_armv7ve = " --with-arch=armv7-a"
+EXTRA_OECONF_append_armv7ve = " --with-arch=armv7ve"
 
  # libcc1 requres gcc_cv_objdump when cross build, but gcc_cv_objdump is
  # set in subdir gcc, so subdir libcc1 can't use it, export it here to
#2 lore raw
Quoted 15 lines · Khem Raj
Quoted 14 lines · Andre McCurdy

Originally these ARM specific EXTRA_OECONF options were applied to both gcc for the target and gcc-cross. That lead to a compromise being made: gcc on the target was configured to default to an ARM architecture which was at least compatible with the target (but not necessarily an exact match) and gcc-cross was configured default to armv7a for both armv7a and armv7ve (to avoid gcc-cross rebuilds when switching between the two).

However, when these ARM specific EXTRA_OECONF options were moved from gcc-configure-common.inc into gcc-target.inc (ie they were made to apply only to gcc on the target) the compromise no longer needed to be made.

Quoted 4 lines
Quoted 1 line

http://git.openembedded.org/openembedded-core/commit/?id=851937dde81de2a9ef54c5f19a78fb12fb82afd4

this was done with a purpose so we can avoid gcc complaining about incompatible architectures when building programs on device.

Thanks for your reassurance. I know it was done on purpose... because it was me that did it! :-)

http://git.openembedded.org/openembedded-core/commit/?id=02c3ac6f066ccd1cbb6e457080bf10db5d6abfe0

Quoted 2 lines

probably testing compiling some c++ apps on device might be good to validate this if at all this is working.

#3 lore raw
Quoted 11 lines · Andre McCurdy
Quoted 10 lines · Khem Raj
Quoted 9 lines · Andre McCurdy

Originally these ARM specific EXTRA_OECONF options were applied to both gcc for the target and gcc-cross. That lead to a compromise being made: gcc on the target was configured to default to an ARM architecture which was at least compatible with the target (but not necessarily an exact match) and gcc-cross was configured default to armv7a for both armv7a and armv7ve (to avoid gcc-cross rebuilds when switching between the two).

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

However, when these ARM specific EXTRA_OECONF options were moved from gcc-configure-common.inc into gcc-target.inc (ie they were made to apply only to gcc on the target) the compromise no longer needed to be made.

http://git.openembedded.org/openembedded-core/commit/?id=851937dde81de2a9ef54c5f19a78fb12fb82afd4

Ping.