Hi everyone,
Following up on my introduction, I’ve been digging into the “Add support for C11 Annex K Bounds Checking Functions” project (issue #28).
The issue mentioned that the first step is to evaluate the library and get it to build on RTEMS. Before trying to write the RSB automation scripts, I wanted to make sure I could actually cross-compile safeclib manually.
I spent the last few days working on this for the sparc-rtems7-erc32 BSP, and I managed to successfully build the static library (libsafec.a). I’ve uploaded my build logs and the patch files to my GitHub here: GitHub - YASHBHIWANIA/rtems-safeclib-poc: Proof of Concept manual build of safeclib for RTEMS 7
It wasn’t a straightforward build, but here are the main things I figured out:
- The Autotools Config issue: The configure scripts were failing because they couldn’t find the RTEMS
confdefs.h. I fixed this by passing a pre-compiledrtems_config.ointo the linker flags during configuration. - Floating Point errors: I had to run configure with
--disable-floatbecause of someisinflerrors that seemed incompatible with the current Newlib math library. - Code fixes: I found a couple of small bugs in the upstream code (a missing label in
vswprintf_s.cand an unused variable insnwprintf_s.c) that broke the build when using-Werror. I patched these locally to get it working.
Next Steps: Now that I have a proven build method and the correct CFLAGS/LDFLAGS, I plan to start drafting my GSoC proposal. My focus will be translating these manual steps into a reproducible RSB Recipe and integrating the __STDC_LIB_EXT1__ guards as requested.
Any feedback would be very awesome!
Best regards, Yash Bhiwania