From 2a385839fe4d37b225e60ff07358d2a7eba90cae Mon Sep 17 00:00:00 2001 From: Brendan Hansknecht Date: Sun, 5 Nov 2023 13:15:22 -0800 Subject: [PATCH] deal with system target --- crates/cli/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index eea6a9c89ae..8cb445379db 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -15,7 +15,7 @@ use roc_gen_dev::AssemblyBackendMode; use roc_gen_llvm::llvm::build::LlvmBackendMode; use roc_load::{FunctionKind, LoadingProblem, Threading}; use roc_packaging::cache::{self, RocCacheDir}; -use roc_target::Target; +use roc_target::{get_target_triple_str, Target}; use std::fs::{self, FileType}; use std::io::{self, Read, Write}; use std::path::{Path, PathBuf}; @@ -156,7 +156,10 @@ fn main() -> io::Result<()> { roc_linker::preprocess_host( &triple, &platform_path.with_file_name("main.roc"), - &platform_path.with_file_name(format!("{}.rh", target)), + // The target triple string must be derived from the triple to convert from the generic + // `system` target to the exact specific target. + &platform_path + .with_file_name(format!("{}.rh", get_target_triple_str(&triple).unwrap())), &stub_lib, &stub_dll_symbols, );