Thanks for the reply. With trunk I assume you mean the HEAD of the main branch.
I tried this first and I did manage to compile it, however there were some problems there which made me assume that the main branch wasn’t ready and therefore I used the release/19.x branch.
First target “arm-none-eabi” doesn’t work because I get this error.
libc\src/__support/CPP/atomic.h:91:5: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Werror,-Watomic-alignment]
91 | __scoped_atomic_store_n(&val, rhs, int(mem_ord), (int)(mem_scope));
| ^
This error can go away if you set the target to “armv7-none-eabi”. Then the libc and libm go through the build.
However, then when you start to use the libc headers in a project I get this problem. I added in libc\config\baremetal\arm\headers.txt
libc.include.wchar
and in libc\config\baremetal\arm\entrypoints.txt
# wchar.h entrypoints
libc.src.wchar.wctob
Because I need wchar.
Then I get the following error.
libc/include\llvm-libc-types/wchar_t.h:12:1: warning: typedef requires
a name [-Wmissing-declarations]
12 | typedef __WCHAR_TYPE__ wchar_t;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The libc\include\llvm-libc-types\wchar.h include file is different from the release/19.x which looks like this.
#ifndef LLVM_LIBC_TYPES_WCHAR_T_H
#define LLVM_LIBC_TYPES_WCHAR_T_H
// Since __need_wchar_t is defined, we get the definition of wchar_t from the
// standalone C header stddef.h. Also, because __need_wchar_t is defined,
// including stddef.h will pull only the type wchar_t and nothing else.
#define __need_wchar_t
#include <stddef.h>
#undef __need_wchar_t
#endif // LLVM_LIBC_TYPES_WCHAR_T_H
versus the main branch.
#ifndef LLVM_LIBC_TYPES_WCHAR_T_H
#define LLVM_LIBC_TYPES_WCHAR_T_H
typedef __WCHAR_TYPE__ wchar_t;
#endif // LLVM_LIBC_TYPES_WCHAR_T_H
I dont’ know the background of this change and when I search for __WCHAR_TYPE__
I end up with nothing other than in wchar_t.h itself.
Is this also related to the LLVM needs to be built before libc?