C++ in Early Boot
summary
Adds C++ support to U-Boot for an NXP i.MX ARM target to change the boot prompt; compiles with a cross‑compiler and modified Makefiles, links against ETL instead of libstdc++, implements missing runtime bits (abort, __dso_handle, __cxa_guard, static constructor invocation via custom placement new), and hacks around missing C library pieces. Encountered about 1,200 compilation errors from including <string>, needed a newer GCC, and increased early‑stage code by ~2–3 KB against a 4 KB loader limit. It works but costs significant maintenance and risk.
AI-written summary · about
chapters (10)
- 0:00Introduction and motivation
- 1:09Survey of C++ in boot solutions
- 9:03Adding C++ to U-Boot
- 11:37Standard library challenges
- 15:58Compiler and runtime issues
- 21:41Linking and ABI requirements
- 24:17Static initialization and threads
- 27:32Cost of C++ in early boot
- 31:10Key takeaways and trade-offs
- 35:03Q&A and conclusion
