Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RISC-V compilation with recent GCC #171

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cmake-tool/helpers/rootserver.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ function(DeclareRootserver rootservername)

if(NOT OPENSBI_PLAT_ISA)
set(OPENSBI_PLAT_ISA "rv${OPENSBI_PLAT_XLEN}imafdc")

# Determine if GNU toolchain is used and if yes,
# whether GCC version >= 11.3 (implies binutils version >= 2.38)
if(
CMAKE_ASM_COMPILER_ID STREQUAL "GNU"
AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "11.3"
)
# Manually enable Zicsr and Zifencei extensions
# This became necessary due to a change in the
# default ISA version in GNU binutils 2.38 which
# is the default binutils version shipped with GCC 11.3
string(APPEND OPENSBI_PLAT_ISA "_zicsr_zifencei")
endif()
endif()

if(NOT OPENSBI_PLAT_ABI)
Expand Down