@@ -26,7 +26,7 @@ use std::{
2626 env,
2727 ffi:: OsString ,
2828 fs,
29- io:: { self , Write } ,
29+ io:: Write ,
3030 path:: { Path , PathBuf } ,
3131} ;
3232
@@ -239,10 +239,6 @@ fn generate_guest_img_loading_functions(
239239
240240fn main ( ) -> anyhow:: Result < ( ) > {
241241 let arch = std:: env:: var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap ( ) ;
242- let mut smp = None ;
243- if let Ok ( s) = std:: env:: var ( "AXVISOR_SMP" ) {
244- smp = Some ( s. parse :: < usize > ( ) . unwrap_or ( 1 ) ) ;
245- }
246242
247243 // let platform = env::var("AX_PLATFORM").unwrap_or("".to_string());
248244
@@ -256,10 +252,6 @@ fn main() -> anyhow::Result<()> {
256252
257253 println ! ( "cargo:rustc-cfg=platform=\" {platform}\" " ) ;
258254
259- // if platform != "dummy" {
260- // gen_linker_script(&arch, platform.as_str(), smp.unwrap_or(1)).unwrap();
261- // }
262-
263255 let config_files = get_configs ( ) ;
264256 let mut output_file = open_output_file ( ) ;
265257
@@ -298,28 +290,3 @@ fn main() -> anyhow::Result<()> {
298290 }
299291 Ok ( ( ) )
300292}
301-
302- fn gen_linker_script ( arch : & str , _platform : & str , smp : usize ) -> io:: Result < ( ) > {
303- let fname = "link.x" ;
304- let output_arch = if arch == "x86_64" {
305- "i386:x86-64"
306- } else if arch. contains ( "riscv" ) {
307- "riscv" // OUTPUT_ARCH of both riscv32/riscv64 is "riscv"
308- } else {
309- arch
310- } ;
311- let ld_content = std:: fs:: read_to_string ( "../scripts/lds/linker.lds.S" ) ?;
312- let ld_content = ld_content. replace ( "%ARCH%" , output_arch) ;
313- let ld_content = ld_content. replace ( "%KERNEL_BASE%" , & format ! ( "{:#x}" , 0xffff800000200000usize ) ) ;
314- let ld_content = ld_content. replace ( "%SMP%" , & format ! ( "{smp}" , ) ) ;
315-
316- let out_dir = std:: env:: var ( "OUT_DIR" ) . unwrap ( ) ;
317- println ! ( "cargo:rerun-if-changed=../scripts/lds/linker.lds.S" ) ;
318- println ! ( "cargo:rustc-link-search={out_dir}" ) ;
319-
320- let out_path = Path :: new ( & out_dir) . join ( fname) ;
321-
322- println ! ( "writing linker script to {}" , out_path. display( ) ) ;
323- // std::fs::write(out_path, ld_content)?;
324- Ok ( ( ) )
325- }
0 commit comments