feat: optimize linker output on linux

This commit is contained in:
Edgar 2024-02-19 09:53:57 +01:00
parent d924305578
commit 4a5ca4a494
No known key found for this signature in database
GPG key ID: 70ADAE8F35904387
2 changed files with 2 additions and 1 deletions

View file

@ -34,6 +34,7 @@ pub fn link_shared_lib(
"-L/lib/../lib64", "-L/lib/../lib64",
"-L/usr/lib/../lib64", "-L/usr/lib/../lib64",
"-lc", "-lc",
"-O1",
&input_path.display().to_string(), &input_path.display().to_string(),
] ]
} }
@ -102,6 +103,7 @@ pub fn link_binary(
"-zrelro", "-zrelro",
"--no-as-needed", "--no-as-needed",
"-lc", "-lc",
"-O1",
crtn, crtn,
&input_path.display().to_string(), &input_path.display().to_string(),
] ]

View file

@ -20,7 +20,6 @@ mod common;
#[test_case(TEST_IF_NO_ELSE, "TEST_IF_NO_ELSE", false, 1, &[] ; "TEST_IF_NO_ELSE")] #[test_case(TEST_IF_NO_ELSE, "TEST_IF_NO_ELSE", false, 1, &[] ; "TEST_IF_NO_ELSE")]
#[test_case(TEST_IF_NO_ELSE, "TEST_IF_NO_ELSE", false, 2, &["a"] ; "TEST_IF_NO_ELSE args")] #[test_case(TEST_IF_NO_ELSE, "TEST_IF_NO_ELSE", false, 2, &["a"] ; "TEST_IF_NO_ELSE args")]
fn example_tests(source: &str, name: &str, is_library: bool, status_code: i32, args: &[&str]) { fn example_tests(source: &str, name: &str, is_library: bool, status_code: i32, args: &[&str]) {
dbg!(source);
let program = compile_program(source, name, is_library).unwrap(); let program = compile_program(source, name, is_library).unwrap();
assert!(program.binary_file.exists(), "program not compiled"); assert!(program.binary_file.exists(), "program not compiled");