Commit graph

24 commits

Author SHA1 Message Date
Timm Knape 019fbefa0f doc: Clarified usage of STL with Minimal C++ Library
STL is not available, so the applications should *not* rely on it.

Signed-off-by: Timm Knape <timm@knp.de>
2024-01-25 08:54:38 +01:00
Benjamin Cabé 155420522b doc: Fix occurrences of repeated words
Another round of repeated words cleanup. This commit tries to keep the
diff minimal and line wrapping was mostly left intact in the touched
files, as having them consistent across the documentation is probably
the topic of a future tree-wide cleanup (or not)

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-15 17:34:39 -05:00
Daniel Leung 26ffa9f59a doc: picolibc: a few words about building without native support
This adds a few words about using Picolibc without native support
from toolchain, and how to enable this behavior for toolchain.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-09-13 17:36:46 -04:00
Stephanos Ioannidis 69d0dce978 doc: picolibc: Add module and toolchain Picolibc synchronisation policy
This commit clarifies that the toolchain-bundled Picolibc in the Zephyr
SDK must also be updated when updating the Picolibc module.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-05-25 16:23:50 +02:00
Stephanos Ioannidis 8ac36c5b3e doc: languages: c: Add minimal libc function scope description
This commit adds the "Functions" section to the minimal libc
documentation that describes the scope of the C standard library
functions available in the minimal libc.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-05-22 23:32:31 +09:00
Keith Packard 9b90f2a351 libc/picolibc: Switch to common malloc implementation
Enable the common malloc implementation when using picolibc. Support
existing Picolibc configurations by respecting existing PICOLIBC_HEAP_SIZE
settings.

When PICOLIBC_HEAP_SIZE is set to a value other than -2, then
*always* set COMMON_LIBC_MALLOC_ARENA_SIZE to that value.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-05-09 01:29:16 +09:00
Keith Packard a9c62caab7 lib/libc: Move malloc from minimal to common library
This will (eventually) permit use of a common malloc implementation with
other C libraries, reducing the amount of Zephyr-specific code required
to support each C library.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-27 20:17:24 +09:00
Keith Packard 22320db5f7 doc/develop: Document common C library APIs
Right now, there's only 'time', which makes this doc pretty short.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-27 20:17:24 +09:00
Keith Packard 3a197934fc doc: Switch main return type from void to int.
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Andy Ross 10b9aab86b doc: Clarify C++ standards support
We weren't explicit about what we mean by "C++ support" as it relates
to standards versions, and it's been causing some friction in the tree
vs. some of our cruftier toolchains.  Add a paragraph to clarify
things.

Fixes #55204

Signed-off-by: Andy Ross <andyross@google.com>
2023-03-01 19:42:32 -05:00
Keith Packard ed51e48ba5 doc/develop: Add picolibc documentation
This describes the capabilities offered by Picolibc along with some of the
requirements applications have when using it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-02-01 10:07:05 -08:00
Stephanos Ioannidis 3f058cc04e doc: languages: cpp: Improve C++ standard library documentation
This commit improves the C++ standard library documentation by adding
the list of supported C++ standard libraries.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00
Stephanos Ioannidis 669a0f5bec lib: cpp: Rework C++ standard library configurations
This commit reworks the C++ standard library configurations such that:

* the separation between the Zephyr minimal C++ library and the fully
  featured C++ standard libraries, such as GNU libstdc++, is clear.
  This is done by deprecating the Kconfig `CONFIG_LIB_CPLUSPLUS`
  symbol, which implies that the minimal C++ library is selected when
  set to `n`, and introducing the `CONFIG_MINIMAL_LIBCPP` symbol.

* the type of the selected C++ standard library is clear. This is done
  by introducing a Kconfig choice, `LIBCPP_IMPLEMENTATION`, for the C++
  standard library type and providing the choice symbols for each
  library type supported, such as `CONFIG_MINIMAL_LIBCPP` and
  `CONFIG_GLIBCXX_LIBCPP`.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00
Stephanos Ioannidis 404e7a9bf7 treewide: Use CONFIG_CPP_EXCEPTIONS instead of CONFIG_EXCEPTIONS
This commit updates all in-tree code to use `CONFIG_CPP_EXCEPTIONS`
instead of `CONFIG_EXCEPTIONS`, which is now deprecated.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00
Stephanos Ioannidis 4a64bfe351 treewide: Use CONFIG_CPP instead of CONFIG_CPLUSPLUS
This commit updates all in-tree code to use `CONFIG_CPP` instead of
`CONFIG_CPLUSPLUS`, which is now deprecated.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00
Stephanos Ioannidis feaab27c1b lib: cpp: Relocate subsys/cpp to lib/cpp
This commit moves the files under `subsys/cpp` directory to the
`lib/cpp` directory because the C++ ABI runtime library and the
standard C++ library components are not a "subsystem" (aka. API) in
conventional sense and is better described as a "library."

Classifying the C++ ABI runtime library and the standard C++ library as
"libraries" instead of "subsystems" also better aligns with how the
existing C standard library implementation (`lib/libc`) is handled.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00
Stephanos Ioannidis 8073115b4c doc: languages: cpp: Add notes about C++ main()
This commit adds notes about the C++ main() function prototype in the
C++ documentation.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-11-05 16:41:45 +09:00
Stephanos Ioannidis 28b22b276a lib: libc: newlib: Make newlib nano variant optional
The newlib nano variant is currently enabled by default when
`CONFIG_NEWLIB_LIBC=y` and the selected toolchain-architecture
combination includes the newlib nano variant support, even if
`CONFIG_NEWLIB_LIBC_NANO` is not selected by the user.

When `CONFIG_NEWLIB_LIBC=y`, this results in the newlib nano variant
being selected for some architectures (e.g. ARC, ARM and RISC-V), while
the full variant is selected for the rest of the architectures.

The above behaviour is problematic because there exist functional
differences between the newlib full and nano variants (e.g. C99 format
modifiers such as `hh`, `ll`, `z`, `j` and `t` are not available in the
newlib nano variant), and this effectively leads to different level of
C standard support across different architectures when
`CONFIG_NEWLIB_LIBC=y`.

This commit fixes this problem by making the `CONFIG_NEWLIB_LIBC_NANO`
not `default y` and requiring its user to explicitly set this symbol to
`y` when they want to use the newlib nano variant.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-10-19 16:02:51 +02:00
Stephanos Ioannidis 81de0276fc doc: languages: c: Add formatted output section
This commit adds "Formatted Output" section to the "C Language Support"
documentation that describes the C library-specific formatted output
support details.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-09-21 12:37:04 +02:00
Stephanos Ioannidis 3d5a28a394 doc: develop: Fix typo in newlib page
Add a missing space to fix documentation display issues.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-02 12:56:25 +02:00
Stephanos Ioannidis 31b9d00e55 doc: develop: c: Add dynamic memory management documentations
This commit adds the sections describing how the dynamic memory
management is handled to the C language support and standard library
documentations.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-01 15:26:48 +02:00
Stephanos Ioannidis 123e6918f4 doc: develop: Improve C++ language support documentation
This commit reworks the C++ language support documentation such that:

1. it contains more up-to-date information regarding the available
   features.

2. it makes a clear distinction between the Zephyr C++ subsystem and
   the C++ standard library and describe the functionalities they
   provide.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-01 15:26:48 +02:00
Stephanos Ioannidis 3013f21a5c doc: develop: Improve C language support documentation
This commit reworks the C language support documentation such that it
is more up to date and contains more information about the Newlib.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-01 15:26:48 +02:00
Stephanos Ioannidis c45a2213c6 doc: develop: Add 'Language Support' sub-category
This commit adds the 'Language Support' sub-category under the
'Developing with Zephyr' category with programming language support-
related documentations.

The contents of the 'C standard library' page have been relocated to
the 'C Language Support' page, and the contents of the 'C++ Support for
Applications' page have been relocated to the 'C++ Language Support'
page.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-01 15:26:48 +02:00