[libc-commits] [PATCH] D124214: [libc][NOT FOR COMMIT] building LLVM-libc on 32 bit arm with gcc
Michael Jones via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Apr 28 16:45:45 PDT 2022
michaelrj added a comment.
The reason I started with gcc is that it was suggested to me by an embedded developer as being more complete than the clang toolchain at the moment. That being said, the clang build does appear to work, I tried your cmake command and I can confirm that ninja llvmlibc works, although the tests appear to be having some trouble stemming from their inclusions from libc++. My guess is that I'll need to fiddle with the build options some more to get it to work, but the fact that it builds the core library is very promising. I'll look into it more tomorrow.
Comment at: libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake:15
+set(LIBC_COMPILE_OPTIONS_NATIVE -mcpu=cortex-m4 -mabi=aapcs -mthumb)
> For Cortex-m4 strictly speaking you shouldn't need the -mabi=aapcs the GNU embedded toolchain will default to that, the same for -mthumb as Cortex-m4 only supports Thumb.
> Although as you say, this is an experimental patch so no harm done at this point.
The reason I picked cortex-m4 as the cpu was because the build wasn't working and I was trying a bunch of different build options to get it to work. For more long term solutions, the target CPU will be configurable.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the libc-commits