mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Merge branch 'master' of https://github.com/odin-lang/Odin
This commit is contained in:
+10
-2
@@ -2035,6 +2035,9 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
|||||||
bc->link_flags = str_lit("/machine:x86 ");
|
bc->link_flags = str_lit("/machine:x86 ");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else if (bc->metrics.os == TargetOs_darwin) {
|
||||||
|
bc->link_flags = concatenate3_strings(permanent_allocator(),
|
||||||
|
str_lit("-target "), bc->metrics.target_triplet, str_lit(" "));
|
||||||
} else if (is_arch_wasm()) {
|
} else if (is_arch_wasm()) {
|
||||||
gbString link_flags = gb_string_make(heap_allocator(), " ");
|
gbString link_flags = gb_string_make(heap_allocator(), " ");
|
||||||
// link_flags = gb_string_appendc(link_flags, "--export-all ");
|
// link_flags = gb_string_appendc(link_flags, "--export-all ");
|
||||||
@@ -2052,8 +2055,13 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
|||||||
// Disallow on wasm
|
// Disallow on wasm
|
||||||
bc->use_separate_modules = false;
|
bc->use_separate_modules = false;
|
||||||
} else {
|
} else {
|
||||||
bc->link_flags = concatenate3_strings(permanent_allocator(),
|
// NOTE: for targets other than darwin, we don't specify a `-target` link flag.
|
||||||
str_lit("-target "), bc->metrics.target_triplet, str_lit(" "));
|
// This is because we don't support cross-linking and clang is better at figuring
|
||||||
|
// out what the actual target for linking is,
|
||||||
|
// for example, on x86/alpine/musl it HAS to be `x86_64-alpine-linux-musl` to link correctly.
|
||||||
|
//
|
||||||
|
// Note that codegen will still target the triplet we specify, but the intricate details of
|
||||||
|
// a target shouldn't matter as much to codegen (if it does at all) as it does to linking.
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: needs to be done after adding the -target flag to the linker flags so the linker
|
// NOTE: needs to be done after adding the -target flag to the linker flags so the linker
|
||||||
|
|||||||
Reference in New Issue
Block a user