Skip to content

Commit

Permalink
Workaround vpush/vpop instructions generation for non-FPU ARMv5 target
Browse files Browse the repository at this point in the history
Issue #696 (bdwgc).

When targeting armv5te architecture, clang-19, at least, emits vpush
and vpop instructions for `__builtin_unwind_init()` regardless of
compiler flags like `-mfloat-abi=soft`.  As the target architecture
lacks FPU, the generated code crashes.
The patch prevents `HAVE_BUILTIN_UNWIND_INIT` macro definition for the
case.

* include/private/gcconfig.h [GC_GNUC_PREREQ(2,8) && __clang__
&& __ARM_ARCH_5TE__] (HAVE_BUILTIN_UNWIND_INIT): Do not define; add
comment.
  • Loading branch information
ivmai committed Feb 1, 2025
1 parent 27e2137 commit 3471bdb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/private/gcconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,8 @@ EXTERN_C_BEGIN
&& !(defined(POWERPC) && defined(DARWIN)) /* for MacOS X 10.3.9 */ \
&& !defined(E2K) && !defined(RTEMS) \
&& !defined(__ARMCC_VERSION) /* does not exist in armcc gnu emu */ \
&& !(defined(__clang__) \
&& defined(__ARM_ARCH_5TE__) /* clang-19 emits vpush/vpop */) \
&& (!defined(__clang__) \
|| GC_CLANG_PREREQ(8, 0) /* was no-op in clang-3 at least */)
# define HAVE_BUILTIN_UNWIND_INIT
Expand Down

0 comments on commit 3471bdb

Please sign in to comment.