Skip to content

Commit 7473c3b

Browse files
authored
Merge pull request #26 from dpaoliello/exexport
Don't raise an error when using non-Arm64EC mangled names if EXPORTAS is set
2 parents a616e9c + 70f5b35 commit 7473c3b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ar_archive_writer"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
edition = "2024"
55
license = "Apache-2.0 WITH LLVM-exception"
66
description = "A writer for object file ar archives"

src/coff_import_file.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,11 @@ pub fn write_import_library<W: Write + Seek>(
994994
}
995995
name = Cow::Owned(mangled_name);
996996
}
997+
Err(_) if !e.noname && export_name.is_none() => {
998+
return Err(Error::other(format!(
999+
"Functions on Arm64EC must use the Arm64EC mangling scheme, but the function \"{name}\" does not. Either use the Arm64EC mangled name or set the `export_name`."
1000+
)));
1001+
}
9971002
Ok(None) if !e.noname && export_name.is_none() => {
9981003
let demangled_name = get_arm64ec_demangled_function_name(&name)
9991004
.ok_or_else(|| {
@@ -1002,12 +1007,7 @@ pub fn write_import_library<W: Write + Seek>(
10021007
name_type = ImportNameType::NameExportas;
10031008
export_name = Some(Cow::Owned(demangled_name));
10041009
}
1005-
Ok(None) => {}
1006-
Err(_) => {
1007-
return Err(Error::other(format!(
1008-
"Functions on Arm64EC must use the Arm64EC mangling scheme, but the function \"{name}\" does not."
1009-
)));
1010-
}
1010+
_ => {}
10111011
}
10121012
}
10131013

0 commit comments

Comments
 (0)