diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2020-12-14 14:35:31 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-15 03:55:58 +0000 |
commit | dfc24d03d58e0c4b015898f605228f12c9c4015e (patch) | |
tree | 294a14d33e5b360a9c5304e2a479e83eed0c155a /zephyr/cmake/compiler | |
parent | 1a697dfdc386066b8d2c8d0224679ed82741580a (diff) | |
download | chrome-ec-dfc24d03d58e0c4b015898f605228f12c9c4015e.tar.gz |
toolchain: provide definition for chroot host-based LLVM toolchain
This provides a definition for an LLVM toolchain, which acts as a
chroot host-based toolchain. This is for compiling unit tests and the
posix-ec project, not for real devices.
We need this to enable unit tests and posix-ec build in the commit
queue, since Zephyr SDK is not available in the chroot.
BUG=b:175248887
TEST=zmake configure -b -B $BUILD -t llvm projects/experimental/posix-ec
$BUILD/build-singleimage/zephyr/zephyr.elf works
Change-Id: Ie71f53cf53503f9279aab654170c7bc2b7a80d20
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/zephyr-chrome/+/2590992
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2630160
Diffstat (limited to 'zephyr/cmake/compiler')
-rw-r--r-- | zephyr/cmake/compiler/clang/compiler_flags.cmake | 8 | ||||
-rw-r--r-- | zephyr/cmake/compiler/clang/generic.cmake | 5 | ||||
-rw-r--r-- | zephyr/cmake/compiler/clang/target.cmake | 6 |
3 files changed, 19 insertions, 0 deletions
diff --git a/zephyr/cmake/compiler/clang/compiler_flags.cmake b/zephyr/cmake/compiler/clang/compiler_flags.cmake new file mode 100644 index 0000000000..1f71650975 --- /dev/null +++ b/zephyr/cmake/compiler/clang/compiler_flags.cmake @@ -0,0 +1,8 @@ +# 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. + +include("${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake") + +# Disable -fno-freestanding. +set_compiler_property(PROPERTY hosted) diff --git a/zephyr/cmake/compiler/clang/generic.cmake b/zephyr/cmake/compiler/clang/generic.cmake new file mode 100644 index 0000000000..33d82b38e1 --- /dev/null +++ b/zephyr/cmake/compiler/clang/generic.cmake @@ -0,0 +1,5 @@ +# 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. + +set(CMAKE_C_COMPILER "/usr/bin/x86_64-pc-linux-gnu-clang") diff --git a/zephyr/cmake/compiler/clang/target.cmake b/zephyr/cmake/compiler/clang/target.cmake new file mode 100644 index 0000000000..6702087df5 --- /dev/null +++ b/zephyr/cmake/compiler/clang/target.cmake @@ -0,0 +1,6 @@ +# 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. + +set(CMAKE_C_COMPILER "${CROSS_COMPILE}clang") +set(CMAKE_CXX_COMPILER "${CROSS_COMPILE}clang++") |