mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
cross-compile hello world (it runs in wine!)
This commit is contained in:
parent
8ca7ee1e14
commit
428b1edf5d
1 changed files with 16 additions and 9 deletions
|
@ -138,16 +138,24 @@ pub fn build_zig_host_native(
|
|||
"str",
|
||||
zig_str_path,
|
||||
"--pkg-end",
|
||||
// include the zig runtime
|
||||
"-fcompiler-rt",
|
||||
// include libc
|
||||
"--library",
|
||||
"c",
|
||||
"-lc",
|
||||
// cross-compile?
|
||||
"-target",
|
||||
target,
|
||||
]);
|
||||
|
||||
// some examples need the compiler-rt in the app object file.
|
||||
// but including it on windows causes weird crashes, at least
|
||||
// when we use zig 0.9. It looks like zig 0.10 is going to fix
|
||||
// this problem for us, so this is a temporary workaround
|
||||
if !target.contains("windows") {
|
||||
command.args(&[
|
||||
// include the zig runtime
|
||||
"-fcompiler-rt",
|
||||
]);
|
||||
}
|
||||
|
||||
// valgrind does not yet support avx512 instructions, see #1963.
|
||||
if env::var("NO_AVX512").is_ok() {
|
||||
command.args(&["-mcpu", "x86_64"]);
|
||||
|
@ -1188,13 +1196,12 @@ fn link_windows(
|
|||
.args(&["build-exe"])
|
||||
.args(input_paths)
|
||||
.args([
|
||||
"-lc",
|
||||
&format!("-femit-bin={}", output_path.to_str().unwrap()),
|
||||
"-target",
|
||||
"x86_64-windows-gnu",
|
||||
"--strip",
|
||||
"-O",
|
||||
"Debug",
|
||||
"--subsystem",
|
||||
"console",
|
||||
"-lc",
|
||||
&format!("-femit-bin={}", output_path.to_str().unwrap()),
|
||||
])
|
||||
.spawn()?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue