Skip to content

Commit

Permalink
Merge pull request #386 from EETagent/ubuntu-noble
Browse files Browse the repository at this point in the history
Upgrade Dockerfile to Ubuntu 23.04, GCC13, RISC-V zifencei extension
  • Loading branch information
ckirsch authored May 28, 2024
2 parents 0f4f5b6 + d6f5cf8 commit b4b8aa2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#####################################
# RISCV gnu toolchain builder image #
#####################################
FROM ubuntu:jammy AS riscvgnutoolchainbuilder
FROM ubuntu:23.04 AS riscvgnutoolchainbuilder

ENV TOP=/opt RISCV=/opt/riscv PATH=$PATH:/opt/riscv/bin

Expand All @@ -31,7 +31,7 @@ RUN cd riscv-gnu-toolchain \
###################################
# PK (Proxy kernel) builder image #
###################################
FROM ubuntu:jammy AS pkbuilder
FROM ubuntu:23.04 AS pkbuilder

ENV TOP=/opt RISCV=/opt/riscv PATH=$PATH:/opt/riscv/bin

Expand All @@ -54,15 +54,15 @@ ENV MAKEFLAGS=-j4
# because spike looks for riscv64-unknown-elf by default when running pk
RUN mkdir -p riscv-pk/build \
&& cd riscv-pk/build \
&& ../configure --prefix=$RISCV --host=riscv64-linux-gnu --with-arch=rv64gc --with-abi=lp64d \
&& ../configure --prefix=$RISCV --host=riscv64-linux-gnu --with-arch=rv64imafdc_zifencei --with-abi=lp64d \
&& make \
&& make install \
&& mv $RISCV/riscv64-linux-gnu $RISCV/riscv64-unknown-elf

#######################################
# Spike (ISA simulator) builder image #
#######################################
FROM ubuntu:jammy AS spikebuilder
FROM ubuntu:23.04 AS spikebuilder

ENV TOP=/opt RISCV=/opt/riscv PATH=$PATH:/opt/riscv/bin

Expand All @@ -88,7 +88,7 @@ RUN mkdir -p riscv-isa-sim/build \
######################
# QEMU builder image #
######################
FROM ubuntu:jammy AS qemubuilder
FROM ubuntu:23.04 AS qemubuilder

ENV TOP=/opt RISCV=/opt/riscv PATH=$PATH:/opt/riscv/bin

Expand All @@ -110,7 +110,7 @@ RUN mkdir -p $RISCV/bin \
########################################
# Boolector (SMT solver) builder image #
########################################
FROM ubuntu:jammy AS boolectorbuilder
FROM ubuntu:23.04 AS boolectorbuilder

ENV TOP=/opt RISCV=/opt/riscv PATH=$PATH:/opt/riscv/bin

Expand Down Expand Up @@ -145,7 +145,7 @@ RUN mkdir -p $RISCV \
#########################
# OpenOCD builder image #
#########################
FROM ubuntu:jammy AS openocdbuilder
FROM ubuntu:23.04 AS openocdbuilder

ENV TOP=/opt RISCV=/opt/riscv PATH=$PATH:/opt/riscv/bin

Expand Down Expand Up @@ -176,7 +176,7 @@ RUN mkdir -p $RISCV \
############################
# Selfie interactive image #
############################
FROM ubuntu:jammy AS selfieall
FROM ubuntu:23.04 AS selfieall

ENV TOP=/opt RISCV=/opt/riscv PATH=$PATH:/opt/riscv/bin

Expand All @@ -191,9 +191,8 @@ RUN apt-get update \
ca-certificates \
make git \
gcc gdb libc6-dev-i386-amd64-cross \
python3.10 \
python3 \
device-tree-compiler gcc-riscv64-linux-gnu \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 \
&& apt-get install -y --no-install-recommends \
binutils-riscv64-linux-gnu libc-dev-riscv64-cross \
libusb-dev libhidapi-dev \
Expand Down Expand Up @@ -229,7 +228,7 @@ FROM selfieall AS selfieeverything

# install tools for 32-bit selfie
RUN apt-get update \
&& apt-get install -y --no-install-recommends lib32gcc-11-dev \
&& apt-get install -y --no-install-recommends lib32gcc-13-dev lib32gcc-12-dev \
&& apt clean

# specify user work directory
Expand Down
2 changes: 1 addition & 1 deletion machine/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ OBJCOPY=$(PREFIX)objcopy
QEMU=qemu-system-riscv64

# Our ABI, architecture and memory model must match with OpenSBI
CFLAGS=-mabi=lp64d -march=rv64imafdc -mcmodel=medany -ffreestanding -Iinclude -Wall -Wextra -MMD -MP -O3
CFLAGS=-mabi=lp64d -march=rv64imafdc_zifencei -mcmodel=medany -ffreestanding -Iinclude -Wall -Wextra -MMD -MP -O3
ASFLAGS=$(CFLAGS)
LDFLAGS=-nostdlib -lgcc -Wl,--build-id=none
QEMUFLAGS=-M virt -m 128M -nographic -bios none
Expand Down
2 changes: 1 addition & 1 deletion machine/defines.mk
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ endef
define generate-target-sbi-elf

$$(TARGET_$(1)_$(2)_DIR)/selfie-opensbi.elf: $$(TARGET_$(1)_$(2)_DIR)/selfie.bin | opensbi
$$(MAKE) -C opensbi CROSS_COMPILE=$$(PREFIX) PLATFORM_RISCV_XLEN=64 PLATFORM=$$(BOARD_$(1)_SBI_NAME) O=build-$(2)/ FW_PAYLOAD=y FW_PAYLOAD_PATH=$$(realpath $$<) FW_TEXT_START=$$(BOARD_$(1)_PAYLOAD_START) FW_PAYLOAD_OFFSET=$$(BOARD_$(1)_PAYLOAD_OFFSET)
$$(MAKE) -C opensbi PLATFORM_RISCV_ISA=rv64imafdc_zifencei CROSS_COMPILE=$$(PREFIX) PLATFORM_RISCV_XLEN=64 PLATFORM=$$(BOARD_$(1)_SBI_NAME) O=build-$(2)/ FW_PAYLOAD=y FW_PAYLOAD_PATH=$$(realpath $$<) FW_TEXT_START=$$(BOARD_$(1)_PAYLOAD_START) FW_PAYLOAD_OFFSET=$$(BOARD_$(1)_PAYLOAD_OFFSET)
mv opensbi/build-$(2)/platform/$$(BOARD_$(1)_SBI_NAME)/firmware/fw_payload.elf $$@
rm -r opensbi/build-$(2)/platform/$$(BOARD_$(1)_SBI_NAME)/firmware/*

Expand Down

0 comments on commit b4b8aa2

Please sign in to comment.