about summary refs log tree commit diff
path: root/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs
diff options
context:
space:
mode:
authorMadhav Madhusoodanan <f20200049@pilani.bits-pilani.ac.in>2025-05-04 23:15:35 +0530
committerAmanieu d'Antras <amanieu@gmail.com>2025-05-27 23:27:38 +0000
commitc01c6ceb876f08b931ee9aa47471d506c11aa994 (patch)
tree69cee5cf18414f8ba104a37c50974027189fcfdc /library/stdarch/crates/intrinsic-test/src/common/compile_c.rs
parent9b4768921f2d21f564b9dd28ca7510c1f5fa4d5a (diff)
downloadrust-c01c6ceb876f08b931ee9aa47471d506c11aa994.tar.gz
rust-c01c6ceb876f08b931ee9aa47471d506c11aa994.zip
fix: aarch64_be issues wthin compilation
Diffstat (limited to 'library/stdarch/crates/intrinsic-test/src/common/compile_c.rs')
-rw-r--r--library/stdarch/crates/intrinsic-test/src/common/compile_c.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs b/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs
index b38e8b1499a..5fe700695b6 100644
--- a/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs
+++ b/library/stdarch/crates/intrinsic-test/src/common/compile_c.rs
@@ -85,7 +85,6 @@ impl CompilationCommandBuilder {
 
     pub fn set_linker(mut self, linker: String) -> Self {
         self.linker = Some(linker);
-        self.output += ".o";
         self
     }
 
@@ -106,12 +105,16 @@ impl CompilationCommandBuilder {
         let flags = std::env::var("CPPFLAGS").unwrap_or("".into());
         let project_root = self.project_root.unwrap_or(String::new());
         let project_root_str = project_root.as_str();
+        let mut output = self.output.clone();
+        if self.linker.is_some() {
+            output += ".o"
+        };
         let mut command = format!(
             "{} {flags} -march={arch_flags} \
             -O{} \
             -o {project_root}/{} \
             {project_root}/{}.cpp",
-            self.compiler, self.optimization, self.output, self.input,
+            self.compiler, self.optimization, output, self.input,
         );
 
         command = command + " " + self.extra_flags.join(" ").as_str();
@@ -133,19 +136,19 @@ impl CompilationCommandBuilder {
                 + include_args.as_str()
                 + " && "
                 + linker
+                + " "
                 + project_root_str
                 + "/"
-                + self.output.as_str()
+                + &output
                 + " -o "
                 + project_root_str
                 + "/"
-                + self.output.strip_suffix(".o").unwrap()
+                + &self.output
                 + " && rm "
                 + project_root_str
                 + "/"
-                + self.output.as_str();
+                + &output;
         }
-
         command
     }
 }