crosstool-ng/scripts/build/libc
Alexey Neyman 82072d0cbc multilib: Determine which options may pass through.
On some arches (e.g. MIPS) the options like -mabi do not work if
specified more than once (see the comment in 100-gcc.sh). Therefore,
we need to determine which of the options produced by <arch>.sh can
be passed to multilib builds and which must be removed (i.e., which
options vary among the multilibs).

This presents a chicken-and-egg problem. GCC developers, in their
infinite wisdom, do not allow arbitrary multilib specification to be
supplied to GCC's configure. Instead, the target (and sometimes some
extra options) determine the set of multilibs - which may include
different CPUs, different ABIs, different endianness, different FPUs,
different floating-point ABIs, ... That is, we don't know which parts
vary until we build GCC and ask it.

So, the solution implemented here is:
- For multilib builds, start with empty CT_ARCH_TARGET_CFLAGS/LDFLAGS.
- For multilib builds, require core pass 1. Pass 1 does not build any
  target binaries, so at that point, our target options have not been
  used yet.
- Provide an API to modify the environment variables for the steps that
  follow the current one.
- As a part of multilib-related housekeeping, determine the variable
  part of multilibs and filter out these options; pass the rest into
  CT_TARGET_CFLAGS/LDFLAGS.

This still does not handle extra dependencies between GCC options (like
-ma implying -mcpu=X -mtune=Y, etc.) but I feel that would complicate
matters too much. Let's leave this until there's a compelling case for
it.

Also, query GCC's sysroot suffix for targets that use it (SuperH,
for example) - the default multilib may not work if the command line
specifies the default option explicitly (%sysroot_suffix_spec is not
aware of multilib defaults).

Signed-off-by: Alexey Neyman <stilor@att.net>
2016-08-23 11:00:27 -07:00
..
avr-libc.sh scripts: Update usage of CT_GetCustom 2015-12-08 10:55:13 -08:00
glibc.sh multilib: Determine which options may pass through. 2016-08-23 11:00:27 -07:00
mingw.sh consistency: Use exported variables of required tools 2015-11-17 02:48:09 -08:00
musl.sh musl-libc: Rewrite musl.sh build script 2016-02-29 17:20:28 -08:00
newlib.sh newlib: add option to enable nano formatted io 2016-03-08 04:48:27 -08:00
none.sh avr-libc: add support for avr-libc C library 2015-06-21 20:53:06 -03:00
uClibc.sh scripts: Update usage of CT_GetCustom 2015-12-08 10:55:13 -08:00