-
Notifications
You must be signed in to change notification settings - Fork 8.2k
cmake: clang: Support host's clang for non-MCU x86 targets on Linux #14077
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
14 commits
Select commit
Hold shift + click to select a range
e63239f
cmake: clang: Make clang pick -T option on linking
ozhuraki d6c5eb2
doc/getting_started: mention ZEPHYR_TOOLCHAIN_VARIANT=llvm
ozhuraki 0e2d561
cmake: clang: Allow host's clang to be used for native_posix
ozhuraki 245f166
toolchain: Do not pollute TOOLCHAIN_HOME
ozhuraki 60ed624
cmake: Set TOOLCHAIN_HOME for Zephyr's SDK
ozhuraki e01756f
cmake: llvm: Make the setup for host installed clang easier
ozhuraki 646dcde
cmake: clang: Detect host installed clang
ozhuraki 2f3a904
cmake: clang: Don't unconditionally use gcc's fortify
ozhuraki 3535fec
cmake: clang: Provide toolchain_cc_nostdinc() macro
ozhuraki 2c8c36f
cmake: clang: Fix comment
ozhuraki 9139e18
posix: cmake: Abstract freestanding options
ozhuraki 5ced3e3
boards: native_posix: Add llvm to supported toolchains
ozhuraki 4df24ad
compiler: clang: Don't link libgcc for native_posix
ozhuraki 22eed38
cmake: llvm: Invalidate toolchain capability cache
ozhuraki 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
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 |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ type: native | |
| arch: posix | ||
| toolchain: | ||
| - zephyr | ||
| - llvm | ||
| supported: | ||
| - netif:eth | ||
| - usb_device | ||
|
|
||
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 |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| find_program(CMAKE_C_COMPILER clang PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH) | ||
| if(DEFINED TOOLCHAIN_HOME) | ||
| set(find_program_clang_args PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH) | ||
| endif() | ||
|
|
||
| find_program(CMAKE_C_COMPILER clang ${find_program_clang_args}) | ||
|
|
||
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
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 @@ | ||
| # Copyright (c) 2019 Intel Corporation. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| macro(toolchain_cc_no_freestanding_options) | ||
|
|
||
| zephyr_cc_option(-fno-freestanding) | ||
|
|
||
| endmacro() |
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
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 |
|---|---|---|
| @@ -1,16 +1,16 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if(MINGW) | ||
| set(TOOLCHAIN_HOME ${ZEPHYR_SDK_INSTALL_DIR}/sysroots/i686-pokysdk-mingw32) | ||
| set(HOST_TOOLS_HOME ${ZEPHYR_SDK_INSTALL_DIR}/sysroots/i686-pokysdk-mingw32) | ||
| else() | ||
| set(TOOLCHAIN_HOME ${ZEPHYR_SDK_INSTALL_DIR}/sysroots/${TOOLCHAIN_ARCH}-pokysdk-linux) | ||
| set(HOST_TOOLS_HOME ${ZEPHYR_SDK_INSTALL_DIR}/sysroots/${TOOLCHAIN_ARCH}-pokysdk-linux) | ||
| endif() | ||
|
|
||
| # Path used for searching by the find_*() functions, with appropriate | ||
| # suffixes added. Ensures that the SDK's host tools will be found when | ||
| # we call, e.g. find_program(QEMU qemu-system-x86) | ||
| list(APPEND CMAKE_PREFIX_PATH ${TOOLCHAIN_HOME}/usr) | ||
| list(APPEND CMAKE_PREFIX_PATH ${HOST_TOOLS_HOME}/usr) | ||
|
|
||
| # TODO: Use find_* somehow for these as well? | ||
| set_ifndef(QEMU_BIOS ${TOOLCHAIN_HOME}/usr/share/qemu) | ||
| set_ifndef(OPENOCD_DEFAULT_PATH ${TOOLCHAIN_HOME}/usr/share/openocd/scripts) | ||
| set_ifndef(QEMU_BIOS ${HOST_TOOLS_HOME}/usr/share/qemu) | ||
| set_ifndef(OPENOCD_DEFAULT_PATH ${HOST_TOOLS_HOME}/usr/share/openocd/scripts) |
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
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.
Uh oh!
There was an error while loading. Please reload this page.