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>
This commit is contained in:
Yann E. MORIN" 2011-11-21 23:33:08 +01:00
parent d6f8cd9b0a
commit 2d5dc881e3

View File

@ -68,8 +68,10 @@ do_libc() {
# Usage: do_libc_backend param=value [...]
# Parameter : Definition : Type : Default
# libc_mode : 'startfiles' or 'final' : string : (none)
# extra_flags : Extra CFLAGS to use (for multilib) : string : (empty)
do_libc_backend() {
local libc_mode
local extra_flags
local src_dir="${CT_SRC_DIR}/${CT_LIBC}-${CT_LIBC_VERSION}"
local extra_cc_args
local -a extra_config
@ -169,11 +171,13 @@ do_libc_backend() {
printf "${CT_LIBC_GLIBC_CONFIGPARMS}\n" > configparms
cross_cc=$(CT_Which "${CT_TARGET}-gcc")
extra_cc_args+=" ${extra_flags}"
CT_DoLog DEBUG "Using gcc for target: '${cross_cc}'"
CT_DoLog DEBUG "Configuring with addons : '$(do_libc_add_ons_list ,)'"
CT_DoLog DEBUG "Extra config args passed: '${extra_config[*]}'"
CT_DoLog DEBUG "Extra CC args passed : '${extra_cc_args}'"
CT_DoLog DEBUG "Extra flags (multilib) : '${extra_flags}'"
glibc_cflags="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} ${OPTIMIZE}"
case "${CT_LIBC_ENABLE_FORTIFIED_BUILD}" in