Use musl for biscuit programs in RISC-V

master
Jiajie Chen 6 years ago committed by oslab
parent f5ec8a84c3
commit 779831fd05

@ -41,7 +41,7 @@ ifneq ($(arch), x86_64)
endif endif
biscuit: biscuit:
ifeq ($(arch), $(filter $(arch), x86_64 aarch64)) ifeq ($(arch), $(filter $(arch), x86_64 aarch64 riscv64))
@echo Building biscuit programs @echo Building biscuit programs
@mkdir -p biscuit/build @mkdir -p biscuit/build
@cd biscuit/build && cmake $(cmake_build_args) .. && make @cd biscuit/build && cmake $(cmake_build_args) .. && make

@ -22,6 +22,7 @@ $ sudo pacman -Syu musl # archlinux
$ brew install FileSottile/musl-cross/musl-cross $ brew install FileSottile/musl-cross/musl-cross
# for ubuntu 16.04, we should build gcc-musl for newest musl-1.1.21 # for ubuntu 16.04, we should build gcc-musl for newest musl-1.1.21
# please see build-gcc-musl.md # please see build-gcc-musl.md
# for riscv musl toolchain, please install [musl-riscv-toolchain](https://github.com/jiegec/musl-riscv-toolchain)
``` ```
```bash ```bash

@ -35,8 +35,8 @@ elseif (${ARCH} STREQUAL riscv32)
set(PREFIX riscv64-unknown-elf-) set(PREFIX riscv64-unknown-elf-)
set(CMAKE_C_FLAGS "-march=rv32imac -mabi=ilp32 -mcmodel=medany") set(CMAKE_C_FLAGS "-march=rv32imac -mabi=ilp32 -mcmodel=medany")
elseif (${ARCH} STREQUAL riscv64) elseif (${ARCH} STREQUAL riscv64)
set(PREFIX riscv64-unknown-elf-) set(PREFIX riscv64-linux-musl-)
set(CMAKE_C_FLAGS "-march=rv64imac -mabi=lp64 -mcmodel=medany") set(CMAKE_C_FLAGS "-march=rv64imafdc -mabi=lp64d -mcmodel=medany")
elseif (${ARCH} STREQUAL aarch64) elseif (${ARCH} STREQUAL aarch64)
set(PREFIX aarch64-linux-musl-) set(PREFIX aarch64-linux-musl-)
else () else ()
@ -54,8 +54,10 @@ if (KERNEL_HEADERS_DIR)
include_directories(${KERNEL_HEADERS_DIR}/include/uapi) include_directories(${KERNEL_HEADERS_DIR}/include/uapi)
endif () endif ()
# Execuatble # Executable
foreach (PATH ${SRCS}) foreach (PATH ${SRCS})
get_filename_component(NAME ${PATH} NAME_WE) if (NOT ${ARCH} STREQUAL riscv64 OR NOT "${PATH}" MATCHES "^c/(usertests).c$")
add_executable(${NAME} ${PATH}) get_filename_component(NAME ${PATH} NAME_WE)
add_executable(${NAME} ${PATH})
endif ()
endforeach () endforeach ()

Loading…
Cancel
Save