-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[libc][Github] Perform baremetal libc builds #167583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
56db607
[libc][Github] Perform baremetal libc builds
Prabhuk 981b670
Carve out a separate build step.
Prabhuk 91c956f
Conditionally enable baremetal build.
Prabhuk 16dac53
Add build step.
Prabhuk a4b12f6
Reuse build and install directories.
Prabhuk 2a3c203
Guard baremetal config inside cmake step.
Prabhuk 6d660cd
Remove baremetal check.
Prabhuk 484396b
Add missing braces.
Prabhuk a4f6878
Guard test step. Skip compiler works cmake checks.
Prabhuk 65d5107
Remove problematic test guard for now.
Prabhuk adf1e4f
Remove unnecessary spaces.
Prabhuk 14b3572
Introduce a second target.
Prabhuk f5797ba
Use cache file for libc standalone build.
Prabhuk efc999f
Try to fix target if condition. Update cache file.
Prabhuk 37bc709
Bring back enable_baremetal_build for experimentation.
Prabhuk 97a969d
Add default target triple.
Prabhuk 0601f69
Add LIBC_TARGET_TRIPLE
Prabhuk e616557
Cleanup cache file. Make it generic for all relevant baremetal target…
Prabhuk 2810c45
Fix missing backslash.
Prabhuk 9c203f5
Disable tests on baremetal builders.
Prabhuk 2f4781f
Fix ending braces.
Prabhuk c00ac42
Use single quotes.
Prabhuk 7f00c88
Drop enable_baremetal_build
Prabhuk 500ddf2
Cleanup cache file.
Prabhuk dbe9e26
Address reviw comments.
Prabhuk 9a6a569
Cache file location and name fix.
Prabhuk 54bf553
Break out architecture specific flags into dedicated cache files.
Prabhuk 4a3a8ca
Set ARCH_TRIPLE from cache files and not yml file.
Prabhuk bccaf16
Kinda important to set the command name.
Prabhuk 384331f
Rename ARCH_TRIPLE and address other review comments.
Prabhuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "") | ||
| set(RUNTIMES_TARGET_TRIPLE "armv6m-none-eabi" CACHE STRING "") | ||
|
|
||
| foreach(lang C;CXX;ASM) | ||
| set(CMAKE_${lang}_FLAGS "-march=armv6m -mcpu=cortex-m0plus -mfloat-abi=soft -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dfputs(string, stream)=puts(string)\" -D_LIBCPP_PRINT=1" CACHE STRING "") | ||
| endforeach() | ||
|
|
||
| include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "") | ||
| set(RUNTIMES_TARGET_TRIPLE "armv7em-none-eabi" CACHE STRING "") | ||
|
|
||
| foreach(lang C;CXX;ASM) | ||
| set(CMAKE_${lang}_FLAGS "-march=armv7em -mcpu=cortex-m4 -mfloat-abi=soft -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dfputs(string, stream)=puts(string)\" -D_LIBCPP_PRINT=1" CACHE STRING "") | ||
| endforeach() | ||
|
|
||
| include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "") | ||
| set(RUNTIMES_TARGET_TRIPLE "armv7m-none-eabi" CACHE STRING "") | ||
|
|
||
| foreach(lang C;CXX;ASM) | ||
| set(CMAKE_${lang}_FLAGS "-march=armv7m -mcpu=cortex-m4 -mfloat-abi=soft -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dfputs(string, stream)=puts(string)\" -D_LIBCPP_PRINT=1" CACHE STRING "") | ||
| endforeach() | ||
|
|
||
| include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "") | ||
| set(RUNTIMES_TARGET_TRIPLE "armv8.1m.main-none-eabi" CACHE STRING "") | ||
|
|
||
| foreach(lang C;CXX;ASM) | ||
| set(CMAKE_${lang}_FLAGS "-mfloat-abi=hard -march=armv8.1-m.main+mve.fp+fp.dp -mcpu=cortex-m55" CACHE STRING "") | ||
| endforeach() | ||
|
|
||
| include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| set(CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "") | ||
| set(RUNTIMES_TARGET_TRIPLE "armv8m.main-none-eabi" CACHE STRING "") | ||
|
|
||
| foreach(lang C;CXX;ASM) | ||
| set(CMAKE_${lang}_FLAGS "-mfloat-abi=softfp -march=armv8m.main+fp+dsp -mcpu=cortex-m33" CACHE STRING "") | ||
| endforeach() | ||
|
|
||
| include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Expects target triple to be passed as `RUNTIMES_TARGET_TRIPLE` | ||
|
|
||
| set(CMAKE_SYSTEM_NAME Generic CACHE STRING "") | ||
| set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "") | ||
| set(LLVM_ENABLE_RUNTIMES "libc" CACHE STRING "") | ||
| set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "") | ||
| set(CMAKE_C_COMPILER_WORKS ON CACHE BOOL "") | ||
| set(CMAKE_CXX_COMPILER_WORKS ON CACHE BOOL "") | ||
| set(CMAKE_SYSROOT "" CACHE STRING "") | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
| set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | ||
|
|
||
Prabhuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| set(CMAKE_C_COMPILER_TARGET ${RUNTIMES_TARGET_TRIPLE} CACHE STRING "") | ||
| set(CMAKE_CXX_COMPILER_TARGET ${RUNTIMES_TARGET_TRIPLE} CACHE STRING "") | ||
| set(CMAKE_ASM_COMPILER_TARGET ${RUNTIMES_TARGET_TRIPLE} CACHE STRING "") | ||
| set(LLVM_DEFAULT_TARGET_TRIPLE ${RUNTIMES_TARGET_TRIPLE} CACHE STRING "") | ||
| set(LIBC_TARGET_TRIPLE ${RUNTIMES_TARGET_TRIPLE} CACHE STRING "") | ||
|
|
||
| set(LLVM_LIBC_FULL_BUILD "ON" CACHE BOOL "") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| set(CMAKE_SYSTEM_PROCESSOR RISCV CACHE STRING "") | ||
| set(RUNTIMES_TARGET_TRIPLE "riscv32-unknown-elf" CACHE STRING "") | ||
|
|
||
| include(${CMAKE_CURRENT_LIST_DIR}/baremetal_common.cmake) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is double underscore intended here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not. Thanks for catching this. I'll send a patch.