Skip to content

Commit 9dfe061

Browse files
fix: aarch64_be issues iwthin compilation
1 parent 030ce32 commit 9dfe061

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

crates/intrinsic-test/src/arm/functions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn compile_c_arm(
185185
* does not work as it gets caught up with `#include_next <stdlib.h>`
186186
* not existing...
187187
*/
188-
if target == "aarch64_be-unknown-linux-gnu" {
188+
if target.contains("aarch64_be") {
189189
command = command
190190
.set_linker(
191191
cxx_toolchain_dir.unwrap_or("").to_string() + "/bin/aarch64_be-none-linux-gnu-g++",

crates/intrinsic-test/src/common/compile_c.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ impl CompilationCommandBuilder {
8585

8686
pub fn set_linker(mut self, linker: String) -> Self {
8787
self.linker = Some(linker);
88-
self.output += ".o";
8988
self
9089
}
9190

@@ -106,12 +105,14 @@ impl CompilationCommandBuilder {
106105
let flags = std::env::var("CPPFLAGS").unwrap_or("".into());
107106
let project_root = self.project_root.unwrap_or(String::new());
108107
let project_root_str = project_root.as_str();
108+
let mut output = self.output.clone();
109+
if self.linker.is_some() { output += ".o" };
109110
let mut command = format!(
110111
"{} {flags} -march={arch_flags} \
111112
-O{} \
112113
-o {project_root}/{} \
113114
{project_root}/{}.cpp",
114-
self.compiler, self.optimization, self.output, self.input,
115+
self.compiler, self.optimization, output, self.input,
115116
);
116117

117118
command = command + " " + self.extra_flags.join(" ").as_str();
@@ -133,19 +134,20 @@ impl CompilationCommandBuilder {
133134
+ include_args.as_str()
134135
+ " && "
135136
+ linker
137+
+ " "
136138
+ project_root_str
137139
+ "/"
138-
+ self.output.as_str()
140+
+ &output
139141
+ " -o "
140142
+ project_root_str
141143
+ "/"
142-
+ self.output.strip_suffix(".o").unwrap()
144+
+ &self.output
143145
+ " && rm "
144146
+ project_root_str
145147
+ "/"
146-
+ self.output.as_str();
148+
+ &output;
147149
}
148-
150+
println!("{}\n", command);
149151
command
150152
}
151153
}

crates/intrinsic-test/src/common/gen_rust.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ license = "{license}"
4646
edition = "2018"
4747
[workspace]
4848
[dependencies]
49-
core_arch = {{ path = "../crates/core_arch" }}
49+
core_arch = {{ path = "../../core_arch" }}
5050
{binaries}"#,
5151
version = env!("CARGO_PKG_VERSION"),
5252
authors = env!("CARGO_PKG_AUTHORS")

crates/intrinsic-test/src/common/intrinsic_helpers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ pub trait IntrinsicTypeDefinition: BaseIntrinsicTypeDefinition {
356356
#[macro_export]
357357
macro_rules! base_intrinsictype_trait_def_macro {
358358
($T:ident) => {
359-
use crate::common::intrinsic_types::IntrinsicType;
359+
use crate::common::intrinsic_helpers::IntrinsicType;
360360

361361
#[derive(Debug, Clone, PartialEq)]
362362
pub struct $T(pub IntrinsicType);

0 commit comments

Comments
 (0)