From 55879ed1d83ebb72f2ab6cbbd892448c731a7163 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sat, 19 Mar 2016 00:13:52 -0700 Subject: 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 diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 013c6eb..f8c970d 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -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}" ;; -- cgit v0.10.2-6-g49f6