On Mon, Aug 16, 2021 at 9:51 AM Sebastian Huber <sebastian.hu...@embedded-brains.de> wrote: > > On 16/08/2021 14:33, Martin Liška wrote: > > On 8/12/21 4:31 PM, Sebastian Huber wrote: > >> This would be suitable for me, however, I am not sure if you want such > >> a customization feature just for a niche operating system. > > > > I don't see a reason why not. > > Please send a patch. > > Ok, good. I will try to figure out what can be done. One problem is that > tsystem.h is included before tm.h. Independent of this Joseph S. Myers > said in the recent patch review with respect to the gcov_type size that > removing tm.h from the target libraries is a development goal. > > I guess we have a couple of options. > > 1. Detect the presence of __assert_func and add the result to tconfig.h. > This can't be a link time check, since libgcc is build before Newlib. > > 2. Use __builtin_trap() instead of abort() if inhibit_libc is defined.
I still think this seems the most straightforward approach. > The trap builtin is target-specific. Making this system-specific (in > this case RTEMS) could be an issue. Is that necessary? Are there interesting targets that don't have a trap insn? > 3. Add a new target hook for the gcc_assert() failure. This has the same > problem as 2. with respect to customization by system and not architecture. > > 4. Disable gcc_assert() if inhibit_libc is defined. > > 5. Use builtin __rtems__ define in tsystem.h as a hack. 6. Suppress ENABLE_RUNTIME_CHECKING when inhibit_libc. Jason