aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/cc/gcc.in9
-rw-r--r--scripts/build/cc/gcc.sh2
-rw-r--r--scripts/build/libc/avr-libc.sh68
3 files changed, 61 insertions, 18 deletions
diff --git a/config/cc/gcc.in b/config/cc/gcc.in
index 1f50460a..d064ffb4 100644
--- a/config/cc/gcc.in
+++ b/config/cc/gcc.in
@@ -54,6 +54,15 @@ config CC_GCC_ENABLE_CXX_FLAGS
Note: just pass in the option _value_, that is only the part that goes
after the '=' sign.
+config CC_GCC_EXTRA_LIBSTDCXX
+ bool "Re-enable libstdcxx"
+ default n
+ depends on LIBC_AVR_LIBC
+ select CC_CORE_PASS_2_NEEDED
+ help
+ libstdcxx is normally disabled on avr systems due to size limitations.
+ Set this option to re-enable libstdcxx support.
+
config CC_GCC_CORE_EXTRA_CONFIG_ARRAY
string "Core gcc extra config"
default ""
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index f14f31da..275e239c 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -1052,6 +1052,8 @@ do_gcc_backend() {
if [ "${build_libstdcxx}" = "no" ]; then
extra_config+=(--disable-libstdcxx)
+ elif [ "${CT_CC_GCC_EXTRA_LIBSTDCXX}" = "y" ]; then
+ extra_config+=(--enable-libstdcxx)
fi
if [ "${CT_LIBC_PICOLIBC}" = "y" ]; then
diff --git a/scripts/build/libc/avr-libc.sh b/scripts/build/libc/avr-libc.sh
index 34eb0f55..c13ae39b 100644
--- a/scripts/build/libc/avr-libc.sh
+++ b/scripts/build/libc/avr-libc.sh
@@ -2,28 +2,60 @@
avr_libc_post_cc()
{
- CT_DoStep INFO "Installing C library"
+ if [ "${CT_CC_CORE_PASS_2_NEEDED}" != "y" ]; then
+ CT_DoStep INFO "Installing C library"
- CT_DoLog EXTRA "Copying sources to build directory"
- CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/avr-libc/." \
- "${CT_BUILD_DIR}/build-libc-post-cc"
- cd "${CT_BUILD_DIR}/build-libc-post-cc"
+ CT_DoLog EXTRA "Copying sources to build directory"
+ CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/avr-libc/." \
+ "${CT_BUILD_DIR}/build-libc-post-cc"
+ cd "${CT_BUILD_DIR}/build-libc-post-cc"
- CT_DoLog EXTRA "Configuring C library"
+ CT_DoLog EXTRA "Configuring C library"
- CT_DoExecLog CFG \
- ${CONFIG_SHELL} \
- ./configure \
- --build=${CT_BUILD} \
- --host=${CT_TARGET} \
- --prefix=${CT_PREFIX_DIR} \
- "${CT_LIBC_AVR_LIBC_EXTRA_CONFIG_ARRAY[@]}"
+ CT_DoExecLog CFG \
+ ${CONFIG_SHELL} \
+ ./configure \
+ --build=${CT_BUILD} \
+ --host=${CT_TARGET} \
+ --prefix=${CT_PREFIX_DIR} \
+ "${CT_LIBC_AVR_LIBC_EXTRA_CONFIG_ARRAY[@]}"
- CT_DoLog EXTRA "Building C library"
- CT_DoExecLog ALL make ${CT_JOBSFLAGS}
+ CT_DoLog EXTRA "Building C library"
+ CT_DoExecLog ALL make ${CT_JOBSFLAGS}
- CT_DoLog EXTRA "Installing C library"
- CT_DoExecLog ALL make install
+ CT_DoLog EXTRA "Installing C library"
+ CT_DoExecLog ALL make install
- CT_EndStep
+ CT_EndStep
+ fi
+}
+
+avr_libc_main()
+{
+ if [ "${CT_CC_CORE_PASS_2_NEEDED}" = "y" ]; then
+ CT_DoStep INFO "Installing C library"
+
+ CT_DoLog EXTRA "Copying sources to build directory"
+ CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/avr-libc/." \
+ "${CT_BUILD_DIR}/build-libc"
+ cd "${CT_BUILD_DIR}/build-libc"
+
+ CT_DoLog EXTRA "Configuring C library"
+
+ CT_DoExecLog CFG \
+ ${CONFIG_SHELL} \
+ ./configure \
+ --build=${CT_BUILD} \
+ --host=${CT_TARGET} \
+ --prefix=${CT_PREFIX_DIR} \
+ "${CT_LIBC_AVR_LIBC_EXTRA_CONFIG_ARRAY[@]}"
+
+ CT_DoLog EXTRA "Building C library"
+ CT_DoExecLog ALL make ${CT_JOBSFLAGS}
+
+ CT_DoLog EXTRA "Installing C library"
+ CT_DoExecLog ALL make install
+
+ CT_EndStep
+ fi
}