From 11ef10bb5d2b62e83a4929924878705e5e4e55e8 Mon Sep 17 00:00:00 2001 From: MauriceElliott Date: Mon, 13 Jul 2026 23:02:50 +0100 Subject: [PATCH 1/2] fix: reworked the playdate subtarget to fix issues with the requirement for single point precision floats, as well as an issue with function lowering when set to thumb mode only instrunctions. --- src/build_settings.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/build_settings.cpp b/src/build_settings.cpp index d767b4890..366f164e7 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -1960,14 +1960,17 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta break; } } else if (subtarget == Subtarget_Playdate) { - // Playdate uses the cortex-m7 as well and an FPU, requiring thumb instructions and hard floats. - bc->microarch = str_lit("cortex-m7"); - bc->metrics.target_triplet = str_lit("thumbv7em-none-eabihf"); - // Remove MOVW/MOVT instructions as playdate only handles R_ARM_ABS32 relocations. + // Uses generic triplet and arch to avoid issues with the playdates + // single precision float fpu as well as issues with function lowering + // when using the thumbv7em triplet. + bc->metrics.target_triplet = str_lit("arm-unknown-unknown-gnueabihf"); + //no-movt required as playdate doesn't support it + String const playdate_features = str_lit("no-movt,armv7e-m,thumb2,m7,fpregs"); + if(bc->target_features_string.len > 0) { - bc->target_features_string = concatenate_strings(permanent_allocator(), bc->target_features_string, str_lit(",no-movt")); + bc->target_features_string = concatenate3_strings(permanent_allocator(), playdate_features, str_lit(","), bc->target_features_string); } else { - bc->target_features_string = str_lit("no-movt"); + bc->target_features_string = playdate_features; } } From 13763e5ed70164374a688fc573a7b5472c7fb675 Mon Sep 17 00:00:00 2001 From: MauriceElliott Date: Mon, 13 Jul 2026 23:06:32 +0100 Subject: [PATCH 2/2] fixup! fix: reworked the playdate subtarget to fix issues with the requirement for single point precision floats, as well as an issue with function lowering when set to thumb mode only instrunctions. --- src/build_settings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 366f164e7..cefe2f4c7 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -1964,7 +1964,7 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta // single precision float fpu as well as issues with function lowering // when using the thumbv7em triplet. bc->metrics.target_triplet = str_lit("arm-unknown-unknown-gnueabihf"); - //no-movt required as playdate doesn't support it + //no-movt required as playdate only handles R_ARM_ABS32 relocations String const playdate_features = str_lit("no-movt,armv7e-m,thumb2,m7,fpregs"); if(bc->target_features_string.len > 0) {