-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from viv-eth/vivianep/llvm-toolchain
[toolchain] Move to LLVM Toolchain for OpenTitan Peripheral Support
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Moritz Scherer <[email protected]> | ||
# Viviane Potocnik <[email protected]> | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
|
||
|
@@ -11,11 +12,14 @@ set(CMAKE_C_STANDARD 99) | |
# SCHEREMO: Needed to skip compiler test, which doesn't support baremetal targets | ||
set(CMAKE_C_COMPILER_WORKS 1) | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) | ||
set(CMAKE_VERBOSE_MAKEFILE TRUE) | ||
|
||
# SCHEREMO: Help most IDE's LSPs find definitions | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS 1) | ||
|
||
# SCHEREMO: This toolchain file is only used for test compilation! | ||
set(CMAKE_TOOLCHAIN_FILE cmake/toolchain_gcc.cmake) | ||
set(CMAKE_TOOLCHAIN_FILE cmake/toolchain_llvm.cmake) | ||
|
||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
|
This file contains 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 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,23 @@ | ||
# Copyright 2024 ETH Zurich and University of Bologna. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Viviane Potocnik <[email protected]> | ||
# Philip Wiese <[email protected]> | ||
|
||
set(CMAKE_EXECUTABLE_SUFFIX ".elf") | ||
|
||
set(CMAKE_SYSTEM_NAME Generic) | ||
|
||
set(LLVM_TAG llvm) | ||
|
||
set(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/clang) | ||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/clang++) | ||
set(CMAKE_ASM_COMPILER ${TOOLCHAIN_DIR}/clang) | ||
|
||
set(CMAKE_OBJCOPY ${TOOLCHAIN_DIR}/${LLVM_TAG}-objcopy) | ||
set(CMAKE_OBJDUMP ${TOOLCHAIN_DIR}/${LLVM_TAG}-objdump) | ||
set(CMAKE_AR ${TOOLCHAIN_DIR}/${LLVM_TAG}-ar) | ||
|
||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=riscv32-unknown-elf") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --target=riscv32-unknown-elf") |