[Mod] Raspi 支持自动部署工具链
This commit is contained in:
2
Platform/Raspi4B/.gitignore
vendored
Normal file
2
Platform/Raspi4B/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
GCC/
|
||||||
37
Platform/Raspi4B/Raspi-Toolchain.cmake
Normal file
37
Platform/Raspi4B/Raspi-Toolchain.cmake
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
get_filename_component(CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} DIRECTORY)
|
||||||
|
|
||||||
|
# 定义目标目录和压缩文件
|
||||||
|
set(GCC_VERSION "gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf")
|
||||||
|
set(GCC_DIRECTORY "${CURRENT_LIST_DIR}/GCC")
|
||||||
|
set(ARCHIVE_FILE "${CURRENT_LIST_DIR}/${GCC_VERSION}.tar")
|
||||||
|
|
||||||
|
# 检查目录是否存在
|
||||||
|
execute_process(
|
||||||
|
COMMAND test -d "${GCC_DIRECTORY}"
|
||||||
|
RESULT_VARIABLE DIRECTORY_EXISTS
|
||||||
|
)
|
||||||
|
|
||||||
|
# 如果目录不存在,则解压
|
||||||
|
if(NOT DIRECTORY_EXISTS EQUAL 0)
|
||||||
|
execute_process(
|
||||||
|
COMMAND mkdir -p "${GCC_DIRECTORY}"
|
||||||
|
COMMAND tar xf "${ARCHIVE_FILE}" -C "${GCC_DIRECTORY}" --strip-components=1
|
||||||
|
RESULT_VARIABLE TAR_RESULT
|
||||||
|
)
|
||||||
|
if(TAR_RESULT)
|
||||||
|
message(FATAL_ERROR "Failed to extract archive file.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM_NAME Linux)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER ${GCC_DIRECTORY}/bin/arm-linux-gnueabihf-gcc)
|
||||||
|
set(CMAKE_CXX_COMPILER ${GCC_DIRECTORY}/bin/arm-linux-gnueabihf-g++)
|
||||||
|
set(CMAKE_SYSROOT ${GCC_DIRECTORY}/bin/../arm-linux-gnueabihf/libc)
|
||||||
|
#set(CMAKE_STAGING_PREFIX ${HOME}/recycle/stage)
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
BIN
Platform/Raspi4B/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar
Executable file
BIN
Platform/Raspi4B/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar
Executable file
Binary file not shown.
BIN
Platform/Raspi4B/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar
Executable file
BIN
Platform/Raspi4B/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar
Executable file
Binary file not shown.
@ -37,5 +37,12 @@ cmake -DBUS_SPIUserMode=ON -DFRONTEND_PN5180=ON -DFRONTEND_PN5190=OFF -DCMAKE_EX
|
|||||||
### Raspi4B + PN5180
|
### Raspi4B + PN5180
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cmake -DBUS_SPIUserMode=ON -DFRONTEND_PN5180=ON -DFRONTEND_PN5190=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=True --toolchain ../Platform/Raspi4B/F5Plus-Toolchain.cmake ../
|
mkdir -p output && cd output/
|
||||||
|
|
||||||
|
cmake -DBUS_SPIUserMode=ON -DFRONTEND_PN5180=ON -DFRONTEND_PN5190=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=True --toolchain ../Platform/Raspi4B/Raspi-Toolchain.cmake ../
|
||||||
```
|
```
|
||||||
|
#### 工具链
|
||||||
|
|
||||||
|
- 用户程序,32位:[gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz](https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz);
|
||||||
|
- 内核编译,64位:[gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz](https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user