cc/gcc: allow CC_EXTRA_CONFIG_ARRAY on baremetal
authorCody Schafer <dev@codyps.com>
Fri May 09 19:13:49 2014 -0700 (2014-05-09)
changeset 33124876ff97e039
parent 3311 e35fa03cd204
child 3313 ad14212ebf54
cc/gcc: allow CC_EXTRA_CONFIG_ARRAY on baremetal

The final bare-metal compiler is built using the core backend.
Currently the core uses the CC_CORE_EXTRA_CONFIG_ARRAY variable.

While this works as supposed to, this can leave the user puzzled
in the menuconfig, since all he can see is the core options, not
the final options.

Only show the core options if any of the core passes are needed,
and use the final options in the core-backend if we're issuing
the bare-metal compiler.

Signed-off-by: Cody P Schafer <dev@codyps.com>
[yann.morin.1998@free.fr: hide core options if no core pass needed;
use final option in core backend if issuing the bare-metal compiler]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <22181e546ba746202489.1399688067@localhost>
Patchwork-Id: 347586
config/cc/gcc.in.2
scripts/build/cc/gcc.sh
     1.1 --- a/config/cc/gcc.in.2	Fri May 09 19:11:59 2014 -0700
     1.2 +++ b/config/cc/gcc.in.2	Fri May 09 19:13:49 2014 -0700
     1.3 @@ -15,6 +15,7 @@
     1.4      string
     1.5      prompt "Core gcc extra config"
     1.6      default ""
     1.7 +    depends on CC_CORE_PASS_1_NEEDED || CC_CORE_PASS_2_NEEDED
     1.8      help
     1.9        Extra flags to pass onto ./configure when configuring the core gcc.
    1.10        
    1.11 @@ -29,7 +30,6 @@
    1.12      string
    1.13      prompt "gcc extra config"
    1.14      default ""
    1.15 -    depends on ! BARE_METAL
    1.16      help
    1.17        Extra flags to pass onto ./configure when configuring gcc.
    1.18        
     2.1 --- a/scripts/build/cc/gcc.sh	Fri May 09 19:11:59 2014 -0700
     2.2 +++ b/scripts/build/cc/gcc.sh	Fri May 09 19:13:49 2014 -0700
     2.3 @@ -188,6 +188,7 @@
     2.4      local -a extra_config
     2.5      local -a core_LDFLAGS
     2.6      local -a core_targets
     2.7 +    local -a extra_user_config
     2.8      local arg
     2.9  
    2.10      for arg in "$@"; do
    2.11 @@ -201,17 +202,20 @@
    2.12              extra_config+=("--with-newlib")
    2.13              extra_config+=("--enable-threads=no")
    2.14              extra_config+=("--disable-shared")
    2.15 +            extra_user_config=( "${CT_CC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
    2.16              copy_headers=y  # For baremetal, as there's no headers to copy,
    2.17                              # we copy an empty directory. So, who cares?
    2.18              ;;
    2.19          shared)
    2.20              extra_config+=("--enable-shared")
    2.21 +            extra_user_config=( "${CT_CC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
    2.22              copy_headers=y
    2.23              ;;
    2.24          baremetal)
    2.25              extra_config+=("--with-newlib")
    2.26              extra_config+=("--enable-threads=no")
    2.27              extra_config+=("--disable-shared")
    2.28 +            extra_user_config=( "${CT_CC_EXTRA_CONFIG_ARRAY[@]}" )
    2.29              copy_headers=n
    2.30              ;;
    2.31          *)
    2.32 @@ -391,7 +395,7 @@
    2.33          ${CC_CORE_SYSROOT_ARG}                      \
    2.34          "${extra_config[@]}"                        \
    2.35          --enable-languages="${lang_list}"           \
    2.36 -        "${CT_CC_CORE_EXTRA_CONFIG_ARRAY[@]}"
    2.37 +        "${extra_user_config[@]}"
    2.38  
    2.39      if [ "${build_libgcc}" = "yes" ]; then
    2.40          # HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or