Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/comp_libs/picolibc.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ config LIBC_PICOLIBC_GCC_LIBSTDCXX
picolibc. This version is linked when "--specs=picolibcpp.specs"
is specified.

config LIBC_PICOLIBC_GCC_LIBSTDCXX_TARGET_CXXFLAGS
string
prompt "Target CXXFLAGS for libstdc++ picolibc variant"
default "-fno-exceptions"
Copy link

@Damian-Nordic Damian-Nordic Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought, would it make sense to use this default for ARM thumb only? I can see some samples in Zephyr that enable CPP_EXCEPTIONS so would probably be good to be able to still run them on some qemu targets.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I found it. I think it would be the best to have the same configuration for all targets.

help
Used to add extra CXXFLAGS when compiling the target libstdc++
picolibc library (e.g. -fno-exceptions).

config LIBC_PICOLIBC_CXA_ATEXIT
def_bool y
select LIBC_PROVIDES_CXA_ATEXIT
Expand Down
3 changes: 3 additions & 0 deletions scripts/build/companion_libs/340-picolibc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ do_cc_libstdcxx_picolibc()
if [ "${CT_LIBC_PICOLIBC_ENABLE_TARGET_OPTSPACE}" = "y" ]; then
final_opts+=( "enable_optspace=yes" )
fi
if [ -n "${CT_LIBC_PICOLIBC_GCC_LIBSTDCXX_TARGET_CXXFLAGS}" ]; then
final_opts+=( "extra_cxxflags_for_target=${CT_LIBC_PICOLIBC_GCC_LIBSTDCXX_TARGET_CXXFLAGS}" )
fi

if [ "${CT_BARE_METAL}" = "y" ]; then
final_opts+=( "mode=baremetal" )
Expand Down