* [Buildroot] [PATCH 1/1] package/paho-mqtt-c: fix build on uclibc or musl
@ 2020-04-28 6:34 Fabrice Fontaine
2020-04-29 20:55 ` Thomas Petazzoni
2020-05-10 18:24 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2020-04-28 6:34 UTC (permalink / raw)
To: buildroot
Fixes:
- http://autobuild.buildroot.org/results/4beb96d43180813906578b42875a1c3d4a905ed7
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
...ists.txt-fix-build-on-uclibc-or-musl.patch | 45 +++++++++++++++++++
1 file changed, 45 insertions(+)
create mode 100644 package/paho-mqtt-c/0001-src-CMakeLists.txt-fix-build-on-uclibc-or-musl.patch
diff --git a/package/paho-mqtt-c/0001-src-CMakeLists.txt-fix-build-on-uclibc-or-musl.patch b/package/paho-mqtt-c/0001-src-CMakeLists.txt-fix-build-on-uclibc-or-musl.patch
new file mode 100644
index 0000000000..7989f045b9
--- /dev/null
+++ b/package/paho-mqtt-c/0001-src-CMakeLists.txt-fix-build-on-uclibc-or-musl.patch
@@ -0,0 +1,45 @@
+From 517e8659ab566b15cc409490a432e8935b164de8 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 24 Apr 2020 11:55:41 +0200
+Subject: [PATCH] src/CMakeLists.txt: fix build on uclibc or musl
+
+Build of version 1.3.2 with uclibc or musl fails on:
+
+[ 58%] Linking C shared library libpaho-mqtt3c.so
+/home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/5.5.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: cannot find -lanl
+collect2: error: ld returned 1 exit status
+
+This is due to commit 21ffebcb749fc8bd8578df85550f03f74e571620 which
+added a link to anl which is not available on uclibc or musl.
+
+Fix this by checking if anl is found on the system before using it
+
+Fixes:
+ - http://autobuild.buildroot.org/results/4beb96d43180813906578b42875a1c3d4a905ed7
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Retrieved from:
+https://github.com/eclipse/paho.mqtt.c/commit/517e8659ab566b15cc409490a432e8935b164de8]
+---
+ src/CMakeLists.txt | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index fb367b37..95fd43e7 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -60,7 +60,13 @@ IF (WIN32)
+ SET(LIBS_SYSTEM ws2_32 crypt32 RpcRT4)
+ ELSEIF (UNIX)
+ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+- SET(LIBS_SYSTEM c dl pthread anl rt)
++ SET(LIBS_SYSTEM c dl pthread rt)
++ # anl is only available with glibc so check if it is found before using
++ # it or build will fail on uclibc or musl
++ FIND_LIBRARY(LIB_ANL anl)
++ IF(LIB_ANL)
++ SET(LIBS_SYSTEM "${LIBS_SYSTEM} ${LIB_ANL}")
++ ENDIF()
+ ADD_DEFINITIONS(-D_GNU_SOURCE -fvisibility=hidden)
+ ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Android")
+ SET(LIBS_SYSTEM c dl)
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] package/paho-mqtt-c: fix build on uclibc or musl
2020-04-28 6:34 [Buildroot] [PATCH 1/1] package/paho-mqtt-c: fix build on uclibc or musl Fabrice Fontaine
@ 2020-04-29 20:55 ` Thomas Petazzoni
2020-05-10 18:24 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2020-04-29 20:55 UTC (permalink / raw)
To: buildroot
On Tue, 28 Apr 2020 08:34:17 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> Fixes:
> - http://autobuild.buildroot.org/results/4beb96d43180813906578b42875a1c3d4a905ed7
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> ...ists.txt-fix-build-on-uclibc-or-musl.patch | 45 +++++++++++++++++++
> 1 file changed, 45 insertions(+)
> create mode 100644 package/paho-mqtt-c/0001-src-CMakeLists.txt-fix-build-on-uclibc-or-musl.patch
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] package/paho-mqtt-c: fix build on uclibc or musl
2020-04-28 6:34 [Buildroot] [PATCH 1/1] package/paho-mqtt-c: fix build on uclibc or musl Fabrice Fontaine
2020-04-29 20:55 ` Thomas Petazzoni
@ 2020-05-10 18:24 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2020-05-10 18:24 UTC (permalink / raw)
To: buildroot
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
> Fixes:
> - http://autobuild.buildroot.org/results/4beb96d43180813906578b42875a1c3d4a905ed7
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Committed to 2020.02.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-10 18:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 6:34 [Buildroot] [PATCH 1/1] package/paho-mqtt-c: fix build on uclibc or musl Fabrice Fontaine
2020-04-29 20:55 ` Thomas Petazzoni
2020-05-10 18:24 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.