glibc: do not add bogus options

If a multilib configuration contains an endianness option, the
${endian_extra} is set to, for example, 'mb' (note, no dash!). It is
then added to CFLAGS, resulting in bogus flags like 'mb -mb'. But it is
not even needed, as ${extra_flags} already contains the very same
option!

Found by experimenting with multilibs with different endianness on SH,
which still didn't work, but that's another story...

Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
Alexey Neyman 2016-03-19 00:13:52 -07:00
parent a49e13fb4e
commit 55879ed1d8

View File

@ -288,12 +288,12 @@ do_libc_backend_once() {
|${sed} -r -e '/^(.*[[:space:]])?-(E[BL]|m((big|little)(-endian)?|e?[bl]))([[:space:]].*)?$/!d;' \
-e 's//\2/;' \
)"
# If extra_flags contained an endianness option, no need to add it again. Otherwise,
# add the option from the configuration.
case "${endian_extra}" in
EB|mbig-endian|mbig|meb|mb)
extra_cc_args="${extra_cc_args} ${endian_extra}"
;;
EL|mlittle-endian|mlittle|mel|ml)
extra_cc_args="${extra_cc_args} ${endian_extra}"
;;
"") extra_cc_args="${extra_cc_args} ${CT_ARCH_ENDIAN_OPT}"
;;