libc/glibc: add extra CFLAGS when building the C library
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Nov 21 23:33:08 2011 +0100 (2011-11-21)
changeset 28208a836b6d6e8c
parent 2819 48cefdec12eb
child 2821 fc0afaf5c817
libc/glibc: add extra CFLAGS when building the C library

When building multilib, we need extra CFLAGS that tell the compiler
to use non-default settings (eg. big/little endian, hard/soft float,
-march/cpu/tune flags, and so on...).

We have to pass these flags to the build.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
scripts/build/libc/glibc-eglibc.sh-common
     1.1 --- a/scripts/build/libc/glibc-eglibc.sh-common	Tue Dec 13 11:51:07 2011 +0100
     1.2 +++ b/scripts/build/libc/glibc-eglibc.sh-common	Mon Nov 21 23:33:08 2011 +0100
     1.3 @@ -68,8 +68,10 @@
     1.4  # Usage: do_libc_backend param=value [...]
     1.5  #   Parameter           : Definition                            : Type      : Default
     1.6  #   libc_mode           : 'startfiles' or 'final'               : string    : (none)
     1.7 +#   extra_flags         : Extra CFLAGS to use (for multilib)    : string    : (empty)
     1.8  do_libc_backend() {
     1.9      local libc_mode
    1.10 +    local extra_flags
    1.11      local src_dir="${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}"
    1.12      local extra_cc_args
    1.13      local -a extra_config
    1.14 @@ -169,11 +171,13 @@
    1.15      printf "${CT_LIBC_GLIBC_CONFIGPARMS}\n" > configparms
    1.16  
    1.17      cross_cc=$(CT_Which "${CT_TARGET}-gcc")
    1.18 +    extra_cc_args+=" ${extra_flags}"
    1.19  
    1.20      CT_DoLog DEBUG "Using gcc for target:     '${cross_cc}'"
    1.21      CT_DoLog DEBUG "Configuring with addons : '$(do_libc_add_ons_list ,)'"
    1.22      CT_DoLog DEBUG "Extra config args passed: '${extra_config[*]}'"
    1.23      CT_DoLog DEBUG "Extra CC args passed    : '${extra_cc_args}'"
    1.24 +    CT_DoLog DEBUG "Extra flags (multilib)  : '${extra_flags}'"
    1.25  
    1.26      glibc_cflags="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} ${OPTIMIZE}"
    1.27      case "${CT_LIBC_ENABLE_FORTIFIED_BUILD}" in