From dfc24d03d58e0c4b015898f605228f12c9c4015e Mon Sep 17 00:00:00 2001 From: Jack Rosenthal Date: Mon, 14 Dec 2020 14:35:31 -0700 Subject: 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 Reviewed-by: Simon Glass Commit-Queue: Jack Rosenthal Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2630160 --- zephyr/cmake/compiler/clang/compiler_flags.cmake | 8 ++++++++ zephyr/cmake/compiler/clang/generic.cmake | 5 +++++ zephyr/cmake/compiler/clang/target.cmake | 6 ++++++ 3 files changed, 19 insertions(+) create mode 100644 zephyr/cmake/compiler/clang/compiler_flags.cmake create mode 100644 zephyr/cmake/compiler/clang/generic.cmake create mode 100644 zephyr/cmake/compiler/clang/target.cmake (limited to 'zephyr/cmake/compiler/clang') 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++") -- cgit v1.2.1