Fix ORT linking for macOS cross-builds.
This commit is contained in:
@@ -24,6 +24,12 @@ const LC_REEXPORT_DYLIB: u32 = 0x8000_001f;
|
||||
const LC_LAZY_LOAD_DYLIB: u32 = 0x20;
|
||||
const LC_LOAD_UPWARD_DYLIB: u32 = 0x8000_0023;
|
||||
|
||||
pub(crate) fn prepare_macos_linker_alias(directory: &Path) -> Result<(), Box<dyn Error>> {
|
||||
fs::create_dir_all(directory)?;
|
||||
fs::write(directory.join("libclang_rt.osx.a"), b"!<arch>\n")?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
enum Platform {
|
||||
MacOs,
|
||||
@@ -460,6 +466,17 @@ mod tests {
|
||||
assert_eq!(dmg_sectors(1).unwrap(), 131_072);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn macos_cross_linker_alias_is_an_empty_static_archive() {
|
||||
let temp = tempdir().unwrap();
|
||||
prepare_macos_linker_alias(temp.path()).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
fs::read(temp.path().join("libclang_rt.osx.a")).unwrap(),
|
||||
b"!<arch>\n"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn windows_package_contains_the_app_without_dynamic_std() {
|
||||
let temp = tempdir().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user