diff options
-rw-r--r-- | zephyr/cmake/bintools/gnu/target.cmake | 7 | ||||
-rw-r--r-- | zephyr/cmake/compiler/gcc/compiler_flags.cmake | 7 | ||||
-rw-r--r-- | zephyr/cmake/compiler/gcc/target.cmake | 7 | ||||
-rw-r--r-- | zephyr/cmake/linker/ld/linker_flags.cmake | 7 | ||||
-rw-r--r-- | zephyr/cmake/linker/ld/target.cmake | 7 | ||||
-rw-r--r-- | zephyr/cmake/toolchain/coreboot-sdk/generic.cmake | 17 | ||||
-rw-r--r-- | zephyr/cmake/toolchain/coreboot-sdk/target.cmake | 31 |
7 files changed, 83 insertions, 0 deletions
diff --git a/zephyr/cmake/bintools/gnu/target.cmake b/zephyr/cmake/bintools/gnu/target.cmake new file mode 100644 index 0000000000..2ec9d075dc --- /dev/null +++ b/zephyr/cmake/bintools/gnu/target.cmake @@ -0,0 +1,7 @@ +# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Zephyr cmake system looks into ${TOOLCHAIN_ROOT}, but we just send +# this out to the copy in ${ZEPHYR_BASE}. +include("${ZEPHYR_BASE}/cmake/bintools/gnu/target.cmake") diff --git a/zephyr/cmake/compiler/gcc/compiler_flags.cmake b/zephyr/cmake/compiler/gcc/compiler_flags.cmake new file mode 100644 index 0000000000..125f909c87 --- /dev/null +++ b/zephyr/cmake/compiler/gcc/compiler_flags.cmake @@ -0,0 +1,7 @@ +# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Zephyr cmake system looks into ${TOOLCHAIN_ROOT}, but we just send +# this out to the copy in ${ZEPHYR_BASE}. +include("${ZEPHYR_BASE}/cmake/compiler/gcc/compiler_flags.cmake") diff --git a/zephyr/cmake/compiler/gcc/target.cmake b/zephyr/cmake/compiler/gcc/target.cmake new file mode 100644 index 0000000000..39e5839eba --- /dev/null +++ b/zephyr/cmake/compiler/gcc/target.cmake @@ -0,0 +1,7 @@ +# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Zephyr cmake system looks into ${TOOLCHAIN_ROOT}, but we just send +# this out to the copy in ${ZEPHYR_BASE}. +include("${ZEPHYR_BASE}/cmake/compiler/gcc/target.cmake") diff --git a/zephyr/cmake/linker/ld/linker_flags.cmake b/zephyr/cmake/linker/ld/linker_flags.cmake new file mode 100644 index 0000000000..c80d1d2452 --- /dev/null +++ b/zephyr/cmake/linker/ld/linker_flags.cmake @@ -0,0 +1,7 @@ +# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Zephyr cmake system looks into ${TOOLCHAIN_ROOT}, but we just send +# this out to the copy in ${ZEPHYR_BASE}. +include("${ZEPHYR_BASE}/cmake/linker/ld/linker_flags.cmake") diff --git a/zephyr/cmake/linker/ld/target.cmake b/zephyr/cmake/linker/ld/target.cmake new file mode 100644 index 0000000000..0e2ad1f4d7 --- /dev/null +++ b/zephyr/cmake/linker/ld/target.cmake @@ -0,0 +1,7 @@ +# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Zephyr cmake system looks into ${TOOLCHAIN_ROOT}, but we just send +# this out to the copy in ${ZEPHYR_BASE}. +include("${ZEPHYR_BASE}/cmake/linker/ld/target.cmake") diff --git a/zephyr/cmake/toolchain/coreboot-sdk/generic.cmake b/zephyr/cmake/toolchain/coreboot-sdk/generic.cmake new file mode 100644 index 0000000000..7f5f6d3df5 --- /dev/null +++ b/zephyr/cmake/toolchain/coreboot-sdk/generic.cmake @@ -0,0 +1,17 @@ +# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# generic.cmake is used for host-side compilation and preprocessing +# (e.g., for device-tree). Thus, we should use LLVM for this +# actually, as that's what's currently supported compiler-wise in the +# chroot right now. + +set(CMAKE_C_COMPILER "/usr/bin/x86_64-pc-linux-gnu-clang") + +set(CMAKE_AR "/usr/bin/llvm-ar") +set(CMAKE_NM "/usr/bin/llvm-nm") +set(CMAKE_OBJCOPY "/usr/bin/llvm-objcopy") +set(CMAKE_OBJDUMP "/usr/bin/llvm-objdump") +set(CMAKE_RANLIB "/usr/bin/llvm-ar") +set(CMAKE_READELF "/usr/bin/llvm-readelf") diff --git a/zephyr/cmake/toolchain/coreboot-sdk/target.cmake b/zephyr/cmake/toolchain/coreboot-sdk/target.cmake new file mode 100644 index 0000000000..cf3a6ec736 --- /dev/null +++ b/zephyr/cmake/toolchain/coreboot-sdk/target.cmake @@ -0,0 +1,31 @@ +# Copyright 2020 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Coreboot SDK uses GCC +set(COMPILER gcc) +set(LINKER ld) +set(BINTOOLS gnu) + +# Mapping of Zephyr architecture -> coreboot-sdk toolchain +set(CROSS_COMPILE_TARGET_arm arm-eabi) +set(CROSS_COMPILE_TARGET_riscv riscv64-elf) +set(CROSS_COMPILE_TARGET_x86 i386-elf) + +set(CROSS_COMPILE_TARGET ${CROSS_COMPILE_TARGET_${ARCH}}) + +if("${ARCH}" STREQUAL "arm" AND CONFIG_ARM64) + set(CROSS_COMPILE_TARGET aarch64-elf) +elseif("${ARCH}" STREQUAL "x86" AND CONFIG_X86_64) + set(CROSS_COMPILE_TARGET x86_64-elf) +endif() + +set(CC gcc) +set(CROSS_COMPILE "/opt/coreboot-sdk/bin/${CROSS_COMPILE_TARGET}-") + +set(CMAKE_AR "${CROSS_COMPILE}ar") +set(CMAKE_NM "${CROSS_COMPILE}nm") +set(CMAKE_OBJCOPY "${CROSS_COMPILE}objcopy") +set(CMAKE_OBJDUMP "${CROSS_COMPILE}objdump") +set(CMAKE_RANLIB "${CROSS_COMPILE}ranlib") +set(CMAKE_READELF "${CROSS_COMPILE}readelf") |