forked from Simple-XX/SimpleKernel
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aarch64): add aarch64 support, not finished
Signed-off-by: Zone.N <Zone.NiuZH@hotmail.com>
- Loading branch information
Showing
9 changed files
with
91 additions
and
15 deletions.
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 |
---|---|---|
|
@@ -18,3 +18,4 @@ tools/opensbi/build | |
.idea | ||
3rd | ||
Doxyfile | ||
.gdbinit |
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
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
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,53 @@ | ||
|
||
# This file is a part of Simple-XX/SimpleKernel | ||
# (https://github.com/Simple-XX/SimpleKernel). | ||
# | ||
# x86_64-aarch64-gcc.cmake for Simple-XX/SimpleKernel. | ||
|
||
# 目标为无操作系统的环境 | ||
set(CMAKE_SYSTEM_NAME Generic) | ||
# 目标架构 | ||
set(CMAKE_SYSTEM_PROCESSOR aarch64) | ||
|
||
# @todo mac 测试 | ||
if (APPLE) | ||
message(STATUS "Now is Apple system.") | ||
# GCC | ||
find_program(Compiler_gcc aarch64-linux-gnu-g++) | ||
if (NOT Compiler_gcc) | ||
message(FATAL_ERROR "aarch64-linux-gnu-g++ not found.\n" | ||
"Run `brew install x86_64-elf-g++` to install.") | ||
else () | ||
message(STATUS "Found aarch64-linux-gnu-g++ ${Compiler_gcc}") | ||
endif () | ||
|
||
set(TOOLCHAIN_PREFIX aarch64-linux-gnu-) | ||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) | ||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++) | ||
set(CMAKE_READELF ${TOOLCHAIN_PREFIX}readelf) | ||
set(CMAKE_AR ${TOOLCHAIN_PREFIX}ar) | ||
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}ld) | ||
set(CMAKE_NM ${TOOLCHAIN_PREFIX}nm) | ||
set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump) | ||
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}ranlib) | ||
elseif (UNIX) | ||
message(STATUS "Now is UNIX-like OS's.") | ||
# GCC | ||
find_program(Compiler_gcc aarch64-linux-gnu-g++) | ||
if (NOT Compiler_gcc) | ||
message(FATAL_ERROR "aarch64-linux-gnu-g++ not found.\n" | ||
"Run `sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu` to install.") | ||
else () | ||
message(STATUS "Found aarch64-linux-gnu-g++ ${Compiler_gcc}") | ||
endif () | ||
|
||
set(TOOLCHAIN_PREFIX aarch64-linux-gnu-) | ||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) | ||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++) | ||
set(CMAKE_READELF ${TOOLCHAIN_PREFIX}readelf) | ||
set(CMAKE_AR ${TOOLCHAIN_PREFIX}ar) | ||
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}ld) | ||
set(CMAKE_NM ${TOOLCHAIN_PREFIX}nm) | ||
set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump) | ||
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}ranlib) | ||
endif () |
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
Binary file not shown.