Resurrect HelloBaremetal - #9296
Merged
alexreinking merged 2 commits intoAug 8, 2026
Merged
Conversation
alexreinking
marked this pull request as ready for review
August 6, 2026 20:40
alexreinking
force-pushed
the
alexreinking/apps-baremetal
branch
from
August 7, 2026 07:45
4d40a7d to
ae35237
Compare
alexreinking
force-pushed
the
alexreinking/apps-baremetal
branch
2 times, most recently
from
August 7, 2026 12:27
7100ef1 to
b835d26
Compare
abadams
approved these changes
Aug 7, 2026
The referenced README_cmake.md doesn't exist; the cross-compiling section it pointed to lives in doc/HalideCMakePackage.md. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…om apps/CMakeLists.txt, add CI
Audited all three documented cross-compilation methods
(cmake-twice/cmake-super_build/cmake-external_project) plus each one's
"host target" build mode, and verified every one of them for real:
actual cross-compile with the arm-none-eabi toolchain, actual run under
QEMU with semihosting, not just a host build check. Along the way:
- CMAKE_PREFIX_PATH wasn't forwarded into cmake-super_build's and
cmake-external_project's ExternalProject_Add sub-builds, breaking the
documented host-target build for both.
- The NEON-enable trampoline and a getentropy syscall stub (needed
because Ubuntu 24.04's arm-none-eabi-gcc/newlib pulls in
std::random_device support transitively through libstdc++'s
exception/COW-string machinery -- itself pulled in by ordinary
std::set/std::string use in halide_image_io.h -- which rdimon.specs
doesn't implement) are now a single cmake/noosrt.s, built once by the
toolchain file itself and linked into every executable automatically
via CMAKE_<LANG>_STANDARD_LIBRARIES, the same mechanism the toolchain
already uses for libgcc/libc. The BAREMETAL variable and the
per-project if(BAREMETAL) blocks that used to wire this in are gone.
- run_baremetal.sh quoted "${QEMU_MACHINE_ARGS}" as a single string
instead of expanding it as separate arguments, so QEMU always
rejected it as one bogus option -- this script never actually worked.
- cmake-twice and cmake-external_project no longer need their
GEN_PACKAGE/GEN_EXE override plumbing (upstream's own default naming
is sufficient); cmake-super_build keeps it as the one demo of that
flexibility.
- Each run.sh was a one-line wrapper around run_baremetal.sh; replaced
with a real CTest test (add_test + PASS_REGULAR_EXPRESSION
"Success!"), guarded by CMAKE_CROSSCOMPILING so it only registers for
the actual cross-compile, not the host-target build.
- Removed the top-level apps/HelloBaremetal/CMakeLists.txt: it only
existed to be add_subdirectory()'d via the old
add_app(HelloBaremetal), which is now gone.
Disconnects HelloBaremetal from apps/CMakeLists.txt (matching
HelloAndroid/HelloAndroidCamera2/HelloWasm) and adds a dedicated
baremetal-apps job to testing-linux.yml that installs an arm-none-eabi
toolchain and QEMU, then actually builds and runs all three methods
under semihosting via ctest.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
alexreinking
force-pushed
the
alexreinking/apps-baremetal
branch
from
August 8, 2026 02:05
b835d26 to
13a1ae6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alexreinking/apps-android #9296 +/- ##
=============================================================
+ Coverage 69.98% 70.01% +0.03%
=============================================================
Files 258 258
Lines 77353 77353
Branches 18837 18837
=============================================================
+ Hits 54137 54162 +25
+ Misses 17648 17630 -18
+ Partials 5568 5561 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The HelloBaremetal builds had bit-rotted and the code was insufficiently tested.
This fixes the builds, changes the runtime to Ubuntu's ARM toolchain, and adds a dedicated baremetal-apps job to testing-linux.yml. It installs an arm-none-eabi toolchain and QEMU, then actually builds and runs all three methods under semihosting via ctest.
Breaking changes
None
Checklist
Stack created with GitHub Stacks CLI • Give Feedback 💬