diff --git a/Makefile b/Makefile index 010b44a80b..cf89d8ac6e 100644 --- a/Makefile +++ b/Makefile @@ -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") @@ -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 @@ -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: diff --git a/efi-virtio.rom b/efi-virtio.rom deleted file mode 100644 index 70e8588ccd..0000000000 Binary files a/efi-virtio.rom and /dev/null differ diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 048d9a16bd..5995070dbb 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -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"] diff --git a/scripts/make/build.mk b/scripts/make/build.mk index 5c815f5036..be4095fef8 100644 --- a/scripts/make/build.mk +++ b/scripts/make/build.mk @@ -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 diff --git a/scripts/make/build_c.mk b/scripts/make/build_c.mk index f22deebd51..b52013fb89 100644 --- a/scripts/make/build_c.mk +++ b/scripts/make/build_c.mk @@ -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)),) diff --git a/tools/loongarch64/libgcc.a b/tools/loongarch64/libgcc.a index 84d3a79725..8c27516ae5 100644 Binary files a/tools/loongarch64/libgcc.a and b/tools/loongarch64/libgcc.a differ