Skip to content

Commit

Permalink
switch loongarch64 toolchain from hard-float to soft-float
Browse files Browse the repository at this point in the history
  • Loading branch information
jtzhpf committed Jan 4, 2024
1 parent da61043 commit 9cc43c9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ else ifeq ($(ARCH), aarch64)
else ifeq ($(ARCH), loongarch64)
ACCEL ?= n
PLATFORM_NAME ?= loongarch64-qemu-virt
TARGET := loongarch64-unknown-none
TARGET := loongarch64-unknown-none-softfloat
BUS := pci
else
$(error "ARCH" must be one of "x86_64", "riscv64", "aarch64" or "loongarch64")
Expand All @@ -134,8 +134,8 @@ export AX_GW=$(GW)
# Binutils
CROSS_COMPILE ?= $(ARCH)-linux-musl-
ifeq ($(ARCH), loongarch64)
CROSS_COMPILE := $(ARCH)-unknown-linux-gnu-
# CROSS_COMPILE := $(ARCH)-linux-gnu-
CROSS_COMPILE := $(ARCH)-linux-gnu-
# CROSS_COMPILE := $(ARCH)-unknown-linux-gnu-
endif
CC := $(CROSS_COMPILE)gcc
AR := $(CROSS_COMPILE)ar
Expand Down Expand Up @@ -188,8 +188,8 @@ debug: build
sleep 1
$(GDB) $(OUT_ELF) \
-ex 'target remote localhost:1234' \
-ex 'b *0x9000000000001000' \
-ex 'b *0x1000' \
-ex 'b rust_entry' \
-ex 'continue' \
-ex 'disp /16i $$pc'

clippy:
Expand Down
Binary file removed efi-virtio.rom
Binary file not shown.
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
profile = "minimal"
channel = "nightly"
components = ["rust-src", "llvm-tools-preview", "rustfmt", "clippy"]
targets = ["x86_64-unknown-none", "riscv64gc-unknown-none-elf", "aarch64-unknown-none-softfloat","loongarch64-unknown-none"]
targets = ["x86_64-unknown-none", "riscv64gc-unknown-none-elf", "aarch64-unknown-none-softfloat","loongarch64-unknown-none-softfloat"]
2 changes: 2 additions & 0 deletions scripts/make/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ else ifeq ($(filter $(MAKECMDGOALS),clippy unittest unittest_no_fail_fast),) # n
endif
ifeq ($(APP_TYPE), c)
$(if $(V), $(info CFLAGS: "$(CFLAGS)") $(info LDFLAGS: "$(LDFLAGS)"))
$(if $(V), $(info RUSTFLAGS: "$(RUSTFLAGS)"))
export RUSTFLAGS
else
$(if $(V), $(info RUSTFLAGS: "$(RUSTFLAGS)"))
export RUSTFLAGS
Expand Down
2 changes: 2 additions & 0 deletions scripts/make/build_c.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ ifeq ($(ARCH), x86_64)
LDFLAGS += --no-relax
else ifeq ($(ARCH), riscv64)
CFLAGS += -march=rv64gc -mabi=lp64d -mcmodel=medany
else ifeq ($(ARCH), loongarch64)
CFLAGS += -mstrict-align -msoft-float -mno-relax
endif

ifeq ($(findstring fp_simd,$(FEATURES)),)
Expand Down
Binary file modified tools/loongarch64/libgcc.a
Binary file not shown.

0 comments on commit 9cc43c9

Please sign in to comment.