diff mbox series

[v3,05/46] configure: allow user to specify --cross-cc-cflags-foo=

Message ID 20180424152405.10304-6-alex.bennee@linaro.org
State New
Headers show
Series fix building of tests/tcg | expand

Commit Message

Alex Bennée April 24, 2018, 3:23 p.m. UTC
As an individual compiler may be able to support several targets with
the appropriate flags we need to expose this to the user as well.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>


---
v3
  - fix up the cross-cc
---
 configure | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.17.0

Comments

Richard Henderson April 25, 2018, 12:12 a.m. UTC | #1
On 04/24/2018 05:23 AM, Alex Bennée wrote:
> As an individual compiler may be able to support several targets with

> the appropriate flags we need to expose this to the user as well.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> 

> ---

> v3

>   - fix up the cross-cc

> ---

>  configure | 8 ++++++++

>  1 file changed, 8 insertions(+)

> 

> diff --git a/configure b/configure

> index ffd96d930f..282e1f1e2b 100755

> --- a/configure

> +++ b/configure

> @@ -454,7 +454,10 @@ docker="no"

>  


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>



r~
diff mbox series

Patch

diff --git a/configure b/configure
index ffd96d930f..282e1f1e2b 100755
--- a/configure
+++ b/configure
@@ -454,7 +454,10 @@  docker="no"
 
 # cross compilers defaults, can be overridden with --cross-cc-ARCH
 cross_cc_aarch64="aarch64-linux-gnu-gcc"
+cross_cc_aarch64_be="$cross_cc_aarch64"
+cross_cc_cflags_aarch64_be="-mbig-endian"
 cross_cc_arm="arm-linux-gnueabihf-gcc"
+cross_cc_cflags_armeb="-mbig-endian"
 cross_cc_powerpc="powerpc-linux-gnu-gcc"
 cross_cc_i386="i386-pc-linux-gnu-gcc"
 cross_cc_cflags_i386=""
@@ -493,6 +496,9 @@  for opt do
   ;;
   --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option"
   ;;
+  --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-}; cc_arch=${cc_arch%%=*}
+                      eval "cross_cc_cflags_${cc_arch}=\$optarg"
+  ;;
   --cross-cc-*) cc_arch=${opt#--cross-cc-}; cc_arch=${cc_arch%%=*}
                 eval "cross_cc_${cc_arch}=\$optarg"
   ;;
@@ -6830,6 +6836,7 @@  case "$target_name" in
     mttcg="yes"
     gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
     target_compiler=$cross_cc_arm
+    eval "target_compiler_cflags=\$cross_cc_cflags_${target_name}"
   ;;
   aarch64|aarch64_be)
     TARGET_ARCH=aarch64
@@ -6838,6 +6845,7 @@  case "$target_name" in
     mttcg="yes"
     gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
     target_compiler=$cross_cc_aarch64
+    eval "target_compiler_cflags=\$cross_cc_cflags_${target_name}"
   ;;
   cris)
     target_compiler=$cross_cc_cris