Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] sqlite: avoid use of unsupported -Ofast CFLAGS
@ 2018-04-13 20:22 Joshua Henderson
  2018-04-15 20:14 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Joshua Henderson @ 2018-04-13 20:22 UTC (permalink / raw)
  To: buildroot

sqlite3 refuses to be built with -ffast-math (a side effect of -Ofast) when it
falls back to implementing its own isnan() function.

sqlite3.c: In function ?sqlite3IsNaN?:
sqlite3.c:28554:3: error: #error SQLite will not work correctly with the -ffast-math option of GCC.

To work around this, when -Ofast is used replace with -O3.

Signed-off-by: Joshua Henderson <joshua.henderson@microchip.com>
---
 package/sqlite/sqlite.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/sqlite/sqlite.mk b/package/sqlite/sqlite.mk
index d0030d4..5ae17e1 100644
--- a/package/sqlite/sqlite.mk
+++ b/package/sqlite/sqlite.mk
@@ -39,7 +39,10 @@ ifeq ($(BR2_PACKAGE_SQLITE_NO_SYNC),y)
 SQLITE_CFLAGS += -DSQLITE_NO_SYNC
 endif
 
-SQLITE_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) $(SQLITE_CFLAGS)"
+# fallback to standard -O3 when -Ofast is present to avoid -ffast-math
+SQLITE_CFLAGS += $(subst -Ofast,-O3,$(TARGET_CFLAGS))
+
+SQLITE_CONF_ENV = CFLAGS="$(SQLITE_CFLAGS)"
 
 ifeq ($(BR2_STATIC_LIBS),y)
 SQLITE_CONF_OPTS += --enable-dynamic-extensions=no
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] sqlite: avoid use of unsupported -Ofast CFLAGS
  2018-04-13 20:22 [Buildroot] [PATCH] sqlite: avoid use of unsupported -Ofast CFLAGS Joshua Henderson
@ 2018-04-15 20:14 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2018-04-15 20:14 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 13 Apr 2018 13:22:34 -0700, Joshua Henderson wrote:
> sqlite3 refuses to be built with -ffast-math (a side effect of -Ofast) when it
> falls back to implementing its own isnan() function.
> 
> sqlite3.c: In function ?sqlite3IsNaN?:
> sqlite3.c:28554:3: error: #error SQLite will not work correctly with the -ffast-math option of GCC.
> 
> To work around this, when -Ofast is used replace with -O3.
> 
> Signed-off-by: Joshua Henderson <joshua.henderson@microchip.com>
> ---
>  package/sqlite/sqlite.mk | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-15 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-13 20:22 [Buildroot] [PATCH] sqlite: avoid use of unsupported -Ofast CFLAGS Joshua Henderson
2018-04-15 20:14 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox