diff mbox series

[oe,meta-networking,17/20] civetweb: Fix paths to librt and libm, use -l linker option

Message ID 20180624191845.31082-17-raj.khem@gmail.com
State Accepted
Commit badb14da1691cd14f5ba7ca54631bda30ed26194
Headers show
Series [oe,meta-oe,01/20] pcmciautils: add (from oe-core) | expand

Commit Message

Khem Raj June 24, 2018, 7:18 p.m. UTC
Fixes build where it pokes for libraries on host system

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...-librt-and-libm-during-native-compil.patch | 42 -------------------
 ...t-Link-librt-and-libm-using-l-option.patch | 40 ++++++++++++++++++
 .../civetweb/civetweb_git.bb                  | 10 ++---
 3 files changed, 45 insertions(+), 47 deletions(-)
 delete mode 100644 meta-networking/recipes-connectivity/civetweb/civetweb/0001-Test-Fix-missing-librt-and-libm-during-native-compil.patch
 create mode 100644 meta-networking/recipes-connectivity/civetweb/civetweb/0001-Unittest-Link-librt-and-libm-using-l-option.patch

-- 
2.18.0

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Test-Fix-missing-librt-and-libm-during-native-compil.patch b/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Test-Fix-missing-librt-and-libm-during-native-compil.patch
deleted file mode 100644
index 401cf39ad8..0000000000
--- a/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Test-Fix-missing-librt-and-libm-during-native-compil.patch
+++ /dev/null
@@ -1,42 +0,0 @@ 
-From cd93e2c538cecb3192fd24c0fbd6e834d0c47eec Mon Sep 17 00:00:00 2001
-From: Krzysztof Kozlowski <krzk@kernel.org>
-Date: Wed, 18 Apr 2018 14:11:52 +0200
-Subject: [PATCH] Unittest: Fix missing librt and libm during native compilation
-
-civetweb looks for librt and libm in weird places and for native build
-this fails:
-
-    | ../third_party/lib/libcheck.a(check.c.o): In function `tcase_create':
-    | build/tmp/work/x86_64-linux/civetweb-native/1.10-r0/build/third_party/src/check-unit-test-framework/src/check.c:145: undefined reference to `floor'
-    | build/tmp/work/x86_64-linux/civetweb-native/1.10-r0/build/third_party/src/check-unit-test-framework/src/check.c:148: undefined reference to `floor'
-
-These are needed dependencies so try regular system linkage in such
-case.
-
-Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
----
- unittest/CMakeLists.txt | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt
-index f34b2e0e4ce4..05d25702178c 100644
---- a/unittest/CMakeLists.txt
-+++ b/unittest/CMakeLists.txt
-@@ -60,10 +60,14 @@ endif()
- find_package(LibM)
- if (LIBM_FOUND)
-   set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBM::LIBM")
-+else()
-+  set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lm")
- endif()
- find_package(LibRt)
- if (LIBRT_FOUND)
-   set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBRT::LIBRT")
-+else()
-+  set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lrt")
- endif()
- 
- # Build the C unit tests
--- 
-2.7.4
-
diff --git a/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Unittest-Link-librt-and-libm-using-l-option.patch b/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Unittest-Link-librt-and-libm-using-l-option.patch
new file mode 100644
index 0000000000..eecbc14682
--- /dev/null
+++ b/meta-networking/recipes-connectivity/civetweb/civetweb/0001-Unittest-Link-librt-and-libm-using-l-option.patch
@@ -0,0 +1,40 @@ 
+From 21e9a4bb214648ffd43c66b535fbf096bfcc9f4f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 24 Jun 2018 00:04:37 -0700
+Subject: [PATCH] Unittest: Link librt and libm using -l option
+
+cmake'ry forces full path to .so files when found using
+find_package and since we have proper sysrooted toolchain
+-lm and -lrt is all we need
+
+Upstream-Status: Inappropriate [Cross compile specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ unittest/CMakeLists.txt | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt
+index c4cdf229..e1b63caf 100644
+--- a/unittest/CMakeLists.txt
++++ b/unittest/CMakeLists.txt
+@@ -57,14 +57,8 @@ elseif (WIN32)
+ else()
+   set(CHECK_LIBRARIES "${CHECK_INSTALL_DIR}/lib/libcheck.a")
+ endif()
+-find_package(LibM)
+-if (LIBM_FOUND)
+-  set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBM::LIBM")
+-endif()
+-find_package(LibRt)
+-if (LIBRT_FOUND)
+-  set(CHECK_LIBRARIES "${CHECK_LIBRARIES};LIBRT::LIBRT")
+-endif()
++set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lm")
++set(CHECK_LIBRARIES "${CHECK_LIBRARIES};-lrt")
+ 
+ # Build the C unit tests
+ add_library(shared-c-unit-tests STATIC shared.c)
+-- 
+2.18.0
+
diff --git a/meta-networking/recipes-connectivity/civetweb/civetweb_git.bb b/meta-networking/recipes-connectivity/civetweb/civetweb_git.bb
index 45d6ec8864..471a665099 100644
--- a/meta-networking/recipes-connectivity/civetweb/civetweb_git.bb
+++ b/meta-networking/recipes-connectivity/civetweb/civetweb_git.bb
@@ -4,12 +4,12 @@  HOMEPAGE = "https://github.com/civetweb/civetweb"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE.md;md5=6f28fdcba0dda735eed62bac6a397562"
 
-SRCREV = "b8148afe8fa44c64f75e69655c4fdc9095565568"
+SRCREV = "19f31ba8dd8443e86c7028a4b4c37f4b299aa68c"
 PV = "1.10+git${SRCPV}"
-SRC_URI = "git://github.com/civetweb/civetweb.git"
-SRC_URI_append_class-native = " \
-    file://0001-Test-Fix-missing-librt-and-libm-during-native-compil.patch \
-"
+SRC_URI = "git://github.com/civetweb/civetweb.git \
+           file://0001-Unittest-Link-librt-and-libm-using-l-option.patch \
+          "
+
 S = "${WORKDIR}/git"
 
 # civetweb supports building with make or cmake (although cmake lacks few features)