From 83a7aaa46bbc411c43d4fc099c6c8884efbe4771 Mon Sep 17 00:00:00 2001 From: login Date: Sat, 17 Dec 2022 16:31:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4rust=5Fhelloworld=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20(#113)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 -- kernel/src/libs/Makefile | 2 +- kernel/src/libs/rust_helloworld/Makefile | 13 ------------- kernel/src/libs/rust_helloworld/helloworld.rs | 17 ----------------- 4 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 kernel/src/libs/rust_helloworld/Makefile delete mode 100644 kernel/src/libs/rust_helloworld/helloworld.rs diff --git a/Makefile b/Makefile index 94ff8a1a..4d760954 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,6 @@ endif export ARCH=__x86_64__ export ROOT_PATH=$(shell pwd) -export RUSTC=$(shell which rustc) - export DEBUG=DEBUG export GLOBAL_CFLAGS := -mcmodel=large -fno-builtin -m64 -fno-stack-protector -D $(ARCH) -D $(EMULATOR) -O1 diff --git a/kernel/src/libs/Makefile b/kernel/src/libs/Makefile index a41cad46..8a0b85bc 100644 --- a/kernel/src/libs/Makefile +++ b/kernel/src/libs/Makefile @@ -1,7 +1,7 @@ CFLAGS += -I . -kernel_lib_subdirs:= libUI sys libELF rust_helloworld +kernel_lib_subdirs:= libUI sys libELF kernel_lib_objs:= $(shell find ./*.c) diff --git a/kernel/src/libs/rust_helloworld/Makefile b/kernel/src/libs/rust_helloworld/Makefile deleted file mode 100644 index fc8dc6dd..00000000 --- a/kernel/src/libs/rust_helloworld/Makefile +++ /dev/null @@ -1,13 +0,0 @@ - -rust_helloworld_objs:= - -ifneq ("$(RUSTC)", "") - rust_helloworld_objs += helloworld.o -endif - -all: $(rust_helloworld_objs) - -helloworld.o: helloworld.rs - @echo Compile helloworld.o - @echo rustc=$(which rustc) - $(shell $(RUSTC) --crate-type staticlib --target x86_64-unknown-none -o helloworld.o helloworld.rs) \ No newline at end of file diff --git a/kernel/src/libs/rust_helloworld/helloworld.rs b/kernel/src/libs/rust_helloworld/helloworld.rs deleted file mode 100644 index fe6d167f..00000000 --- a/kernel/src/libs/rust_helloworld/helloworld.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![no_std] -#![no_main] - -use core::panic::PanicInfo; - -#[no_mangle] -pub extern "C" fn rust_helloworld_a_plus_b(a: i32, b: i32) -> i32 { - return a+b; -} - -/// 这个函数将在panic时被调用 -#[panic_handler] -fn panic(_info: &PanicInfo) -> ! { - loop {} -} - -// rustc --crate-type staticlib --target x86_64-unknown-none -o helloworld.o helloworld.rs \ No newline at end of file