Commit 0332ce85 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

rust: Workaround gcc/clang differences with soft fp

GCC automatically defines a `__SOFTFP__` define on targets that are
using software floating point.  The clang compiler does not do this by
default, so check this, and define it.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent a57ceb78
Loading
Loading
Loading
Loading
+9 −0
Changes for lib/rust/zephyr-sys/wrapper.h: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -21,5 +21,14 @@ extern int errno;
/* First, make sure we have all of our config settings. */
#include <zephyr/autoconf.h>

/* Gcc defines __SOFT_FP__ when the target uses software floating point, and the CMSIS headers get
 * confused without this.
 */
#if defined(CONFIG_CPU_CORTEX_M)
#if !defined(CONFIG_FP_HARDABI) && !defined(FORCE_FP_HARDABI) && !defined(__SOFTFP__)
#define __SOFTFP__
#endif
#endif

#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>