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
This commit is contained in:
Cody Schafer 2014-05-09 19:13:49 -07:00
parent b61a1b13ee
commit db2872f2ac
2 changed files with 6 additions and 2 deletions

View File

@ -15,6 +15,7 @@ config CC_CORE_EXTRA_CONFIG_ARRAY
string string
prompt "Core gcc extra config" prompt "Core gcc extra config"
default "" default ""
depends on CC_CORE_PASS_1_NEEDED || CC_CORE_PASS_2_NEEDED
help help
Extra flags to pass onto ./configure when configuring the core gcc. Extra flags to pass onto ./configure when configuring the core gcc.
@ -29,7 +30,6 @@ config CC_EXTRA_CONFIG_ARRAY
string string
prompt "gcc extra config" prompt "gcc extra config"
default "" default ""
depends on ! BARE_METAL
help help
Extra flags to pass onto ./configure when configuring gcc. Extra flags to pass onto ./configure when configuring gcc.

View File

@ -188,6 +188,7 @@ do_cc_core_backend() {
local -a extra_config local -a extra_config
local -a core_LDFLAGS local -a core_LDFLAGS
local -a core_targets local -a core_targets
local -a extra_user_config
local arg local arg
for arg in "$@"; do for arg in "$@"; do
@ -201,17 +202,20 @@ do_cc_core_backend() {
extra_config+=("--with-newlib") extra_config+=("--with-newlib")
extra_config+=("--enable-threads=no") extra_config+=("--enable-threads=no")
extra_config+=("--disable-shared") extra_config+=("--disable-shared")
extra_user_config=( "${CT_CC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
copy_headers=y # For baremetal, as there's no headers to copy, copy_headers=y # For baremetal, as there's no headers to copy,
# we copy an empty directory. So, who cares? # we copy an empty directory. So, who cares?
;; ;;
shared) shared)
extra_config+=("--enable-shared") extra_config+=("--enable-shared")
extra_user_config=( "${CT_CC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
copy_headers=y copy_headers=y
;; ;;
baremetal) baremetal)
extra_config+=("--with-newlib") extra_config+=("--with-newlib")
extra_config+=("--enable-threads=no") extra_config+=("--enable-threads=no")
extra_config+=("--disable-shared") extra_config+=("--disable-shared")
extra_user_config=( "${CT_CC_EXTRA_CONFIG_ARRAY[@]}" )
copy_headers=n copy_headers=n
;; ;;
*) *)
@ -391,7 +395,7 @@ do_cc_core_backend() {
${CC_CORE_SYSROOT_ARG} \ ${CC_CORE_SYSROOT_ARG} \
"${extra_config[@]}" \ "${extra_config[@]}" \
--enable-languages="${lang_list}" \ --enable-languages="${lang_list}" \
"${CT_CC_CORE_EXTRA_CONFIG_ARRAY[@]}" "${extra_user_config[@]}"
if [ "${build_libgcc}" = "yes" ]; then if [ "${build_libgcc}" = "yes" ]; then
# HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or # HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or