2022-10-13: libc++, multilib followup
Participants
-
Siva Chandra
-
Simon Wallis
-
Tue Ly
-
Michael Jones
-
Nigel Perks
-
David Spickett
-
Pirama
-
Petr Hosek
-
Peter Smith
-
Volodymyr Turanskyy
Agenda
-
Any preparation for the LLVM Dev Meeting (The LLVM Compiler Infrastructure Project Nov 8-9, 2022) round table.
Reminder: there will be no sync up call in November because of LLVM Dev Meeting happening at the same time. -
LLD features for embedded development.
-
Next steps for the libc++ discussion related to embedded use cases.
-
Any follow up on the previous topics on libc.
Discussion
LLVM Dev Meeting round table
-
David and Kristof from Arm will attend the LLVM Dev Meeting.
-
No specific preparation for the round table discussed.
LLD embedded features (Peter)
-
Arm team started working on some feature in LLD for embedded use cases:
-
Big endian was supported for AArch64, we are adding support for Arm for completeness.
-
CMSE (Cortex-M Security Extensions, TrustZone M) support for linking code for secure and non-secure worlds.
-
-
Patches will be upstream soon, reviews are welcome.
libc++ for embedded (Volodymyr)
Looking at existing libraries and guidance targeting embedded use cases, the following are some of the most usual configuration options/needs:
- Cross compilation.
- Cross testing.
- No exceptions.
- No RTTI.
- No dynamic memory allocation, new/delete must not be used, placement new is allowed.
- No IO, including indirect dependencies, e.g. force the demangler not to use any IO.
- No locale support (mostly used by IO).
- No floating point support.
- No other big features like file system.
- Options to simplify porting threading to RTOS.
- Options to simplify porting clocks to RTOS.
- Options to simplify porting to different C libraries.
Other topics:
-
Code size vs performance hand-optimized implementations.
- Algorithms may be a good example here.
-
Multiple small switches vs one embedded configuration that configures everything at once.
- Individual options seem to be more practical since they allow creating custom configurations.
Discussion
-
Fuchsia already uses multiple versions of libc++ with tweaks like above.
-
Actions? All: Try to implement and upstream such configuration options as people work on toolchains with specific libc++ configurations.
-
Pre-submit builders to check that the options still work are needed. Is this a prerequisite by maintainers anyway?
Follow up on previous topics
Multilib support status
-
The plugin prototype presented by Mikhail was finished, so we know the info needed to make the whole approach work. Next question is what is the best way to define this info.
-
Still need to evaluate DSL options to capture the same info.
-
One of ideas is to have build attributes with partial order defined on them, so that the multilib logic can search and pick the best match. Fuchsia uses a similar idea of “priority” to pick up the best variant.
-
DSL options:
-
GCC spec files: can start small, but there is a risk to eventually grow and get the while language in (that is perceived as undesirable).
-
clang config files: There is a thread on Discourse about extending it so that eventually this may be enough, see [RFC] Adding a default file location to config file support - #45 by mgorny
-