sqlite3: fix uClibc builds

When compiling against uClibc on lede-17.01 it's detected in the linking
phase that '__isnan' is nowhere to be found:

sqlite3-sqlite3.o: In function `serialGet':
sqlite3.c:(.text+0x6364): undefined reference to `__isnan'
sqlite3-sqlite3.o: In function `sqlite3_result_double':
sqlite3.c:(.text+0x10faa): undefined reference to `__isnan'
sqlite3-sqlite3.o: In function `sqlite3VXPrintf':
sqlite3.c:(.text+0x175ca): undefined reference to `__isnan'
sqlite3-sqlite3.o: In function `sqlite3_bind_double':
sqlite3.c:(.text+0x1b0ac): undefined reference to `__isnan'
sqlite3-sqlite3.o: In function `sqlite3VdbeExec':
sqlite3.c:(.text+0x3b77e): undefined reference to `__isnan'
collect2: error: ld returned 1 exit status

To fix this libm needs to be linked in as well in the uClibc case. So
add libm ('-lm') to the TARGET_LDFLAGS accordingly.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper
2018-01-23 20:57:23 +01:00
parent 127daaef07
commit b8e6fc3eb7
+5 -2
View File
@@ -1,5 +1,5 @@
# #
# Copyright (C) 2006-2014 OpenWrt.org # Copyright (C) 2006-2018 OpenWrt.org
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=sqlite PKG_NAME:=sqlite
PKG_VERSION:=3190300 PKG_VERSION:=3190300
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
PKG_HASH:=06129c03dced9f87733a8cba408871bd60673b8f93b920ba8d815efab0a06301 PKG_HASH:=06129c03dced9f87733a8cba408871bd60673b8f93b920ba8d815efab0a06301
@@ -68,6 +68,9 @@ $(call Package/sqlite3/Default/description)
formats. formats.
endef endef
# On uClibc libm needs to be linked in for ISNAN()
TARGET_LDFLAGS += $(if $(CONFIG_USE_UCLIBC),-lm)
TARGET_CFLAGS += $(FPIC) \ TARGET_CFLAGS += $(FPIC) \
-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \ -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
-DHAVE_ISNAN=1 \ -DHAVE_ISNAN=1 \