From 3955be8d11e65620b58e753711a7b7b22a53eb85 Mon Sep 17 00:00:00 2001 From: Toni Date: Fri, 30 May 2025 19:22:05 +0200 Subject: [PATCH] musl --- .gitignore | 3 ++- src/main.rs | 13 +++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 0947030..39c4888 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target /out* -/TODO \ No newline at end of file +/TODO +/musl-* \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index b48144b..a744621 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,16 +36,9 @@ fn compile_file(path: String) -> Result<(), Box> { .args(["-f", "elf64", "-o", "out.o", "out.s"]) .status()?; - Command::new("ld") - .args([ - "-dynamic-linker", - "/lib64/ld-linux-x86-64.so.2", - "-lc", - "/usr/lib/x86_64-linux-gnu/crt1.o", - "-o", - "out", - "out.o", - ]) + // TODO: drop libc entirely + Command::new("./musl-1.2.4/root/bin/musl-gcc") + .args(["-static", "-o", "out", "out.o"]) .status()?; Ok(())