mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 08:06:32 +00:00
* refacotr: remove all c files Use Rust to implement the symbol table generator. Delete unused header files and c files Adjust the makefile in the debug directory Signed-off-by: Godones <chenlinfeng25@outlook.com> * fix: remove extern "C" rs_* functions move gen_kallsyms.rs to build-scripts Signed-off-by: Godones <chenlinfeng25@outlook.com>
27 lines
804 B
Rust
27 lines
804 B
Rust
use super::CFilesArch;
|
||
use std::{collections::HashSet, path::PathBuf};
|
||
|
||
pub(super) struct RiscV64CFilesArch;
|
||
|
||
impl CFilesArch for RiscV64CFilesArch {
|
||
fn setup_defines(&self, c: &mut cc::Build) {
|
||
c.define("__riscv64__", None);
|
||
c.define("__riscv", None);
|
||
}
|
||
|
||
fn setup_files(&self, _c: &mut cc::Build, files: &mut HashSet<PathBuf>) {
|
||
files.insert(PathBuf::from("src/arch/riscv64/asm/head.S"));
|
||
}
|
||
|
||
fn setup_global_flags(&self, c: &mut cc::Build) {
|
||
// 在这里设置编译器,不然的话vscode的rust-analyzer会报错
|
||
c.compiler("riscv64-unknown-elf-gcc");
|
||
// // c.flag("-march=rv64imafdc");
|
||
// c.no_default_flags(true);
|
||
c.flag("-mcmodel=medany");
|
||
|
||
c.flag("-mabi=lp64d");
|
||
c.flag("-march=rv64gc");
|
||
}
|
||
}
|