Some embedded devices are so memory constrained that using -Os or -Oz
is the only way to get the code to fit. Such devices want to use this
option with everything they link, including system libraries like
libc, libm and libgcc.
This series, which will be part of Zephyr SDK version 1.0, adds a new
gcc config option, --enable-multilib-space, that automatically doubles
the set of multilib configurations, creating a new configuration
selected when -Os or -Oz is specified on the compile command line.
When --enable-multilib-space is specified without --enable-multilib,
multilib is implicitly enabled with two configurations.
This series is part of the changes Zephyr SDK 1.0 adds to gcc 14.3 and
has been verified to work correctly for all twelve of those targets.
When not enabled, there should be no effect on the build at all.
There are two preparatory patches:
1. When building libgcc, respect a -Os or -Oz option that appears
anywhere in the CC or CFLAGS values by explicitly appending those
to INTERNAL_CFLAGS and CRTSTUFF_FLAGS
2. Clean up the ARM multilib configuration settings. That was missing
some explicit default values, -marm and -mfloat-abi=soft.
Then the main patch which edits the MULTILIB_EXCEPTIONS,
MULTILIB_OSDIRNAMES, MULTILIB_REQUIRED and MULTILIB_REUSE values
Finally, there's a follow-on patch which changes the libstdc++
compiler flags when it is built with -Os, adding -fno-exceptions and
-fno-asynchronous-unwind-tables in that case.
Keith Packard (4):
libgcc: Use -Os/-Oz from CC or CFLAGS
arm: Add missing multilib default values
gcc: Add --enable-multilib-space option
When using multilib-space, disable C++ exceptions in -Os versions
config-ml.in | 8 +++++---
gcc/Makefile.in | 32 +++++++++++++++++++++++++++-----
gcc/config/arm/arm-mlib.h | 2 +-
gcc/configure.ac | 7 +++++++
gcc/doc/install.texi | 12 ++++++++++++
libgcc/Makefile.in | 10 +++++++---
6 files changed, 59 insertions(+), 12 deletions(-)
--
2.51.0