cmake: Toolchain abstraction: Abstraction of binary tools, foundation.
This forms the foundation for the abstraction of the binary tools,
where the following steps are taken:
- Move binary tool resolving, such as objcopy, objdump, readelf and
so forth, out of compiler definitions and place in a dedicated binary
tools folder with the binary tools supplier as subfolder, similar to
the compiler and linker directories.
- Create binary tool sets, gnu, host-gnu and llvm.
- Each toolchain selects the required set of binary tools by setting
BINTOOLS via its generic.cmake as it also does for compiler and linker.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-07-18 21:06:51 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2022-02-24 20:00:55 +08:00
|
|
|
# Configures binary tools as llvm binary tool set
|
cmake: Toolchain abstraction: Abstraction of binary tools, foundation.
This forms the foundation for the abstraction of the binary tools,
where the following steps are taken:
- Move binary tool resolving, such as objcopy, objdump, readelf and
so forth, out of compiler definitions and place in a dedicated binary
tools folder with the binary tools supplier as subfolder, similar to
the compiler and linker directories.
- Create binary tool sets, gnu, host-gnu and llvm.
- Each toolchain selects the required set of binary tools by setting
BINTOOLS via its generic.cmake as it also does for compiler and linker.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-07-18 21:06:51 +08:00
|
|
|
|
|
|
|
if(DEFINED TOOLCHAIN_HOME)
|
2020-05-19 16:09:28 +08:00
|
|
|
set(find_program_clang_args PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
|
|
set(find_program_binutils_args PATHS ${TOOLCHAIN_HOME})
|
cmake: Toolchain abstraction: Abstraction of binary tools, foundation.
This forms the foundation for the abstraction of the binary tools,
where the following steps are taken:
- Move binary tool resolving, such as objcopy, objdump, readelf and
so forth, out of compiler definitions and place in a dedicated binary
tools folder with the binary tools supplier as subfolder, similar to
the compiler and linker directories.
- Create binary tool sets, gnu, host-gnu and llvm.
- Each toolchain selects the required set of binary tools by setting
BINTOOLS via its generic.cmake as it also does for compiler and linker.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-07-18 21:06:51 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
find_program(CMAKE_AR llvm-ar ${find_program_clang_args} )
|
|
|
|
find_program(CMAKE_NM llvm-nm ${find_program_clang_args} )
|
|
|
|
find_program(CMAKE_OBJDUMP llvm-objdump ${find_program_clang_args} )
|
|
|
|
find_program(CMAKE_RANLIB llvm-ranlib ${find_program_clang_args} )
|
2021-04-17 07:31:52 +08:00
|
|
|
find_program(CMAKE_STRIP llvm-strip ${find_program_clang_args} )
|
cmake: Toolchain abstraction: Abstraction of binary tools, foundation.
This forms the foundation for the abstraction of the binary tools,
where the following steps are taken:
- Move binary tool resolving, such as objcopy, objdump, readelf and
so forth, out of compiler definitions and place in a dedicated binary
tools folder with the binary tools supplier as subfolder, similar to
the compiler and linker directories.
- Create binary tool sets, gnu, host-gnu and llvm.
- Each toolchain selects the required set of binary tools by setting
BINTOOLS via its generic.cmake as it also does for compiler and linker.
The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.
No functional change expected.
Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-07-18 21:06:51 +08:00
|
|
|
find_program(CMAKE_OBJCOPY objcopy ${find_program_binutils_args})
|
|
|
|
find_program(CMAKE_READELF readelf ${find_program_binutils_args})
|
2019-07-18 21:16:39 +08:00
|
|
|
|
2020-10-02 04:46:12 +08:00
|
|
|
# Use the gnu binutil abstraction
|
2021-02-08 11:34:08 +08:00
|
|
|
include(${ZEPHYR_BASE}/cmake/bintools/llvm/target_bintools.cmake)
|