mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-22 15:32:35 +00:00
feat(arm32 cdecl): Added thumb as the triple for cortex-m7. Updated the calling convention for cortex-m7 arm32 micro processors as the soft float register was being used when calling across the C ABI boundary causing guff data to be passed.
This commit is contained in:
@@ -1072,6 +1072,12 @@ gb_internal bool is_arch_wasm(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
gb_internal bool is_cortex_m7(void) {
|
||||
return build_context.metrics.os == TargetOs_freestanding &&
|
||||
build_context.metrics.arch == TargetArch_arm32 &&
|
||||
build_context.microarch == str_lit("cortex-m7");
|
||||
}
|
||||
|
||||
gb_internal bool is_arch_x86(void) {
|
||||
switch (build_context.metrics.arch) {
|
||||
case TargetArch_i386:
|
||||
@@ -1832,9 +1838,7 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
|
||||
|
||||
bc->metrics = *metrics;
|
||||
|
||||
if (bc->metrics.os == TargetOs_freestanding &&
|
||||
bc->metrics.arch == TargetArch_arm32 &&
|
||||
bc->microarch == str_lit("cortex-m7")) {
|
||||
if (is_cortex_m7()) {
|
||||
bc->metrics.target_triplet = str_lit("thumbv7em-none-eabihf");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user