[libc-commits] [libc] [libc] Add baremetal minor archive support. (PR #203015)
Simi Pallipurath via libc-commits
libc-commits at lists.llvm.org
Thu Jul 9 01:37:51 PDT 2026
simpal01 wrote:
@vhscampos and @michaelrj-google Thank you both for the comments.
Based on comments,
1. **Dependency closure Issue**
- LLVM libc entrypoints should not depend on other entrypoints. The known allowed exceptions are libc.src.errno.errno and libc.src.setjmp.longjmp.
- For the string case I tested, only strdup depends on errno.
So looks like dependency-closure issue appears very limited.
3. **Unintended dependency packaging**
In Our layout, each minor variant links something like:
variant libllvmstring.a + base libc.a
The base libc.a will already contain errno. If the variant libstring.a also contains libc_errno.cpp.obj, then errno exists in both layers.
Then the link order can make the minor layering archive visible before the base archive so linker only extracts one copy from one archive.
-lllvmstring -lc
For layered multilibs, the cleaner model is:
```
base libc.a:
errno
common libc objects
default string implementation, if needed
variant libstring.a:
only specialized string objects
no errno
```
I would not argue that errno duplication will always break. I would argue that it is a layering violation and an unnecessary dependency packaging. Victor and I agreed that it’s okay to leave it as it is for now until we identify a suitable solution.
4. Yeah my thought was also to pass a a cmake flag from downsteam project to change the exported archive's name
These are my thoughts. I still need to complete the full testing with LIBC_CONFIG_PATH and update this patch based on the results.
https://github.com/llvm/llvm-project/pull/203015
More information about the libc-commits
mailing list