* [Buildroot] [PATCH v2 0/3] Update package mosquitto
@ 2019-08-03 9:38 Titouan Christophe
2019-08-03 9:38 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Titouan Christophe @ 2019-08-03 9:38 UTC (permalink / raw)
To: buildroot
This patchset extend the mosquitto integration with Buildroot's
build system and systemd, thanks to configuration options that have
been introduced in mosquitto 1.5. Finally, it updates the help text
in Config.in and add myself to the DEVELOPERS.
Changes in v2:
- Explicit dependency on systemd when enabled
- Broker needs dylibs
- Update help text and DEVELOPERS
Titouan Christophe (3):
package/mosquitto: allow to build as static lib
package/mosquitto: extend systemd integration
package/mosquitto: update help text in Config.in
DEVELOPERS | 1 +
package/mosquitto/Config.in | 31 +++++++++++++++++------------
package/mosquitto/mosquitto.mk | 19 +++++++++++++++++-
package/mosquitto/mosquitto.service | 10 ----------
4 files changed, 37 insertions(+), 24 deletions(-)
delete mode 100644 package/mosquitto/mosquitto.service
--
2.21.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
2019-08-03 9:38 [Buildroot] [PATCH v2 0/3] Update package mosquitto Titouan Christophe
@ 2019-08-03 9:38 ` Titouan Christophe
2019-08-03 11:13 ` Peter Korsgaard
2019-08-03 9:38 ` [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration Titouan Christophe
2019-08-03 9:38 ` [Buildroot] [PATCH 3/3] package/mosquitto: update help text in Config.in Titouan Christophe
2 siblings, 1 reply; 14+ messages in thread
From: Titouan Christophe @ 2019-08-03 9:38 UTC (permalink / raw)
To: buildroot
Since version 1.5, it is possible to build mosquitto as a static lib.
However, the broker still needs a toolchain with support for shared libraries,
because it contains code to dynamically load modules at runtime. This
code makes use of dlfcn.h, which is only available for dylib enabled
systems.
Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
package/mosquitto/Config.in | 9 +++------
package/mosquitto/mosquitto.mk | 12 ++++++++++++
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
index c7373d9a84..8f2561c2d8 100644
--- a/package/mosquitto/Config.in
+++ b/package/mosquitto/Config.in
@@ -1,6 +1,5 @@
config BR2_PACKAGE_MOSQUITTO
bool "mosquitto"
- depends on !BR2_STATIC_LIBS # builds .so
help
Mosquitto is an open source message broker that implements
the MQ Telemetry Transport protocol versions 3.1 and
@@ -16,12 +15,10 @@ config BR2_PACKAGE_MOSQUITTO_BROKER
bool "install the mosquitto broker"
default y
depends on BR2_USE_MMU # fork()
+ depends on !BR2_STATIC_LIBS # include <dlfcn.h>
depends on BR2_PACKAGE_MOSQUITTO
help
Build and install the mosquitto broker onto target.
-comment "mosquitto broker needs a system with MMU"
- depends on BR2_PACKAGE_MOSQUITTO && !BR2_USE_MMU
-
-comment "mosquitto needs a toolchain w/ dynamic library"
- depends on BR2_STATIC_LIBS
+comment "mosquitto broker needs a system with MMU; toolchain w/ dynamic library"
+ depends on BR2_PACKAGE_MOSQUITTO && (!BR2_USE_MMU || BR2_STATIC_LIBS)
diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index a172afcc53..eb39f0af6e 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -17,6 +17,18 @@ MOSQUITTO_MAKE_OPTS = \
WITH_WRAP=no \
WITH_DOCS=no
+ifeq ($(BR2_SHARED_LIBS),y)
+MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no
+else
+MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes
+endif
+
+ifeq ($(BR2_STATIC_LIBS),y)
+MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=no
+else
+MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=yes
+endif
+
# adns uses getaddrinfo_a
ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
MOSQUITTO_MAKE_OPTS += WITH_ADNS=yes
--
2.21.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
2019-08-03 9:38 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
@ 2019-08-03 11:13 ` Peter Korsgaard
0 siblings, 0 replies; 14+ messages in thread
From: Peter Korsgaard @ 2019-08-03 11:13 UTC (permalink / raw)
To: buildroot
>>>>> "Titouan" == Titouan Christophe <titouan.christophe@railnova.eu> writes:
> Since version 1.5, it is possible to build mosquitto as a static lib.
> However, the broker still needs a toolchain with support for shared libraries,
> because it contains code to dynamically load modules at runtime. This
> code makes use of dlfcn.h, which is only available for dylib enabled
> systems.
> Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
> ---
> package/mosquitto/Config.in | 9 +++------
> package/mosquitto/mosquitto.mk | 12 ++++++++++++
> 2 files changed, 15 insertions(+), 6 deletions(-)
> diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
> index c7373d9a84..8f2561c2d8 100644
> --- a/package/mosquitto/Config.in
> +++ b/package/mosquitto/Config.in
> @@ -1,6 +1,5 @@
> config BR2_PACKAGE_MOSQUITTO
> bool "mosquitto"
> - depends on !BR2_STATIC_LIBS # builds .so
> help
> Mosquitto is an open source message broker that implements
> the MQ Telemetry Transport protocol versions 3.1 and
> @@ -16,12 +15,10 @@ config BR2_PACKAGE_MOSQUITTO_BROKER
> bool "install the mosquitto broker"
> default y
> depends on BR2_USE_MMU # fork()
> + depends on !BR2_STATIC_LIBS # include <dlfcn.h>
> depends on BR2_PACKAGE_MOSQUITTO
> help
> Build and install the mosquitto broker onto target.
> -comment "mosquitto broker needs a system with MMU"
> - depends on BR2_PACKAGE_MOSQUITTO && !BR2_USE_MMU
> -
> -comment "mosquitto needs a toolchain w/ dynamic library"
> - depends on BR2_STATIC_LIBS
> +comment "mosquitto broker needs a system with MMU; toolchain w/ dynamic library"
> + depends on BR2_PACKAGE_MOSQUITTO && (!BR2_USE_MMU || BR2_STATIC_LIBS)
Not your fault, but this message should not mention MMU (as the user
cannot change it) and only be displayed if mosquitto && mmu && static.
Committed with that fixed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration
2019-08-03 9:38 [Buildroot] [PATCH v2 0/3] Update package mosquitto Titouan Christophe
2019-08-03 9:38 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
@ 2019-08-03 9:38 ` Titouan Christophe
2019-08-03 11:13 ` Peter Korsgaard
2019-08-03 9:38 ` [Buildroot] [PATCH 3/3] package/mosquitto: update help text in Config.in Titouan Christophe
2 siblings, 1 reply; 14+ messages in thread
From: Titouan Christophe @ 2019-08-03 9:38 UTC (permalink / raw)
To: buildroot
Since version 1.5, mosquitto can be built with explicit support for
systemd. If enabled, libmosquitto will link against libsystemd: when
started, the mosquitto broker notifies systemd that it is ready (ie.
initialized and ready to accept connections), so that services that
depend on the mqtt broker can be started only at that point.
To enable this feature, the systemd service config file needs to change
to Type=notify. Upstream now provides such a file, so we can remove
ours.
Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
package/mosquitto/mosquitto.mk | 7 ++++++-
package/mosquitto/mosquitto.service | 10 ----------
2 files changed, 6 insertions(+), 11 deletions(-)
delete mode 100644 package/mosquitto/mosquitto.service
diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index eb39f0af6e..6de6fc804f 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -29,6 +29,11 @@ else
MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=yes
endif
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+MOSQUITTO_MAKE_OPTS += WITH_SYSTEMD=yes
+MOSQUITTO_DEPENDENCIES += systemd
+endif
+
# adns uses getaddrinfo_a
ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
MOSQUITTO_MAKE_OPTS += WITH_ADNS=yes
@@ -102,7 +107,7 @@ define MOSQUITTO_INSTALL_INIT_SYSV
endef
define MOSQUITTO_INSTALL_INIT_SYSTEMD
- $(INSTALL) -D -m 644 package/mosquitto/mosquitto.service \
+ $(INSTALL) -D -m 644 $(@D)/service/systemd/mosquitto.service.notify \
$(TARGET_DIR)/usr/lib/systemd/system/mosquitto.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -fs ../../../../usr/lib/systemd/system/mosquitto.service \
diff --git a/package/mosquitto/mosquitto.service b/package/mosquitto/mosquitto.service
deleted file mode 100644
index 2d1939d1c7..0000000000
--- a/package/mosquitto/mosquitto.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Mosquitto MQTT broker
-
-[Service]
-ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
-ExecReload=/bin/kill -HUP $MAINPID
-Restart=always
-
-[Install]
-WantedBy=multi-user.target
--
2.21.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration
2019-08-03 9:38 ` [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration Titouan Christophe
@ 2019-08-03 11:13 ` Peter Korsgaard
0 siblings, 0 replies; 14+ messages in thread
From: Peter Korsgaard @ 2019-08-03 11:13 UTC (permalink / raw)
To: buildroot
>>>>> "Titouan" == Titouan Christophe <titouan.christophe@railnova.eu> writes:
> Since version 1.5, mosquitto can be built with explicit support for
> systemd. If enabled, libmosquitto will link against libsystemd: when
> started, the mosquitto broker notifies systemd that it is ready (ie.
> initialized and ready to accept connections), so that services that
> depend on the mqtt broker can be started only at that point.
> To enable this feature, the systemd service config file needs to change
> to Type=notify. Upstream now provides such a file, so we can remove
> ours.
> Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 3/3] package/mosquitto: update help text in Config.in
2019-08-03 9:38 [Buildroot] [PATCH v2 0/3] Update package mosquitto Titouan Christophe
2019-08-03 9:38 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
2019-08-03 9:38 ` [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration Titouan Christophe
@ 2019-08-03 9:38 ` Titouan Christophe
2019-08-03 11:14 ` Peter Korsgaard
2 siblings, 1 reply; 14+ messages in thread
From: Titouan Christophe @ 2019-08-03 9:38 UTC (permalink / raw)
To: buildroot
(and add myself to DEVELOPERS)
Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
DEVELOPERS | 1 +
package/mosquitto/Config.in | 22 +++++++++++++++-------
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/DEVELOPERS b/DEVELOPERS
index 74f52d26fd..a2017ef593 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2247,6 +2247,7 @@ N: Timo Ketola <timo.ketola@exertus.fi>
F: package/fbgrab/
N: Titouan Christophe <titouan.christophe@railnova.eu>
+F: package/mosquitto/
F: package/redis/
N: Trent Piepho <tpiepho@impinj.com>
diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
index 8f2561c2d8..272035f18b 100644
--- a/package/mosquitto/Config.in
+++ b/package/mosquitto/Config.in
@@ -1,13 +1,21 @@
config BR2_PACKAGE_MOSQUITTO
bool "mosquitto"
help
- Mosquitto is an open source message broker that implements
- the MQ Telemetry Transport protocol versions 3.1 and
- 3.1.1. MQTT provides a lightweight method of carrying out
- messaging using a publish/subscribe model. This makes it
- suitable for "machine to machine" messaging such as with low
- power sensors or mobile devices such as phones, embedded
- computers or microcontrollers like the Arduino.
+ Eclipse Mosquitto is an open source (EPL/EDL licensed) message
+ broker that implements the MQTT protocol versions 5.0, 3.1.1
+ and 3.1. Mosquitto is lightweight and is suitable for use on
+ all devices from low power single board computers to full
+ servers.
+
+ The MQTT protocol provides a lightweight method of carrying
+ out messaging using a publish/subscribe model. This makes it
+ suitable for Internet of Things messaging such as with low
+ power sensors or mobile devices such as phones,
+ embedded computers or microcontrollers.
+
+ The Mosquitto project also provides a C library for
+ implementing MQTT clients, and the very popular mosquitto_pub
+ and mosquitto_sub command line MQTT clients.
http://mosquitto.org/
--
2.21.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 0/3] Update package mosquitto
@ 2019-07-18 10:06 Titouan Christophe
2019-07-18 10:06 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
0 siblings, 1 reply; 14+ messages in thread
From: Titouan Christophe @ 2019-07-18 10:06 UTC (permalink / raw)
To: buildroot
This patchset extend the mosquitto integration with Buildroot's
build system and other packages, thanks to configuration options
that have been introduced in mosquitto 1.5; and bump mosquitto
to the latest version (1.6.3).
Interesting new features in mosquitto 1.6 include:
* Explicit support for TLS v1.3 (and drop support for TLS v1.0)
* Support for new mqttv5 protocol
* Remove dependency on libuuid
Titouan Christophe (3):
package/mosquitto: allow to build as static lib
package/mosquitto: Switch systemd unit to Type=notify and depend on
network
package/mosquitto: bump to v1.6.3
package/mosquitto/Config.in | 4 ----
package/mosquitto/mosquitto.hash | 2 +-
package/mosquitto/mosquitto.mk | 19 +++++++++++--------
package/mosquitto/mosquitto.service | 3 +++
4 files changed, 15 insertions(+), 13 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
2019-07-18 10:06 [Buildroot] [PATCH 0/3] Update package mosquitto Titouan Christophe
@ 2019-07-18 10:06 ` Titouan Christophe
2019-08-01 10:23 ` Peter Korsgaard
0 siblings, 1 reply; 14+ messages in thread
From: Titouan Christophe @ 2019-07-18 10:06 UTC (permalink / raw)
To: buildroot
Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
---
package/mosquitto/Config.in | 4 ----
package/mosquitto/mosquitto.mk | 6 ++++++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
index 11b6d7891b..7135e86e69 100644
--- a/package/mosquitto/Config.in
+++ b/package/mosquitto/Config.in
@@ -1,6 +1,5 @@
config BR2_PACKAGE_MOSQUITTO
bool "mosquitto"
- depends on !BR2_STATIC_LIBS # builds .so
help
Mosquitto is an open source message broker that implements
the MQ Telemetry Transport protocol versions 3.1 and
@@ -22,6 +21,3 @@ config BR2_PACKAGE_MOSQUITTO_BROKER
comment "mosquitto broker needs a system with MMU"
depends on BR2_PACKAGE_MOSQUTTO && !BR2_USE_MMU
-
-comment "mosquitto needs a toolchain w/ dynamic library"
- depends on BR2_STATIC_LIBS
diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index 51c0abd0ba..ed72af754a 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -17,6 +17,12 @@ MOSQUITTO_MAKE_OPTS = \
WITH_WRAP=no \
WITH_DOCS=no
+ifeq ($(BR2_STATIC_LIBS),y)
+MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes WITH_SHARED_LIBRARIES=no
+else
+MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes
+endif
+
# adns uses getaddrinfo_a
ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
MOSQUITTO_MAKE_OPTS += WITH_ADNS=yes
--
2.21.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
2019-07-18 10:06 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
@ 2019-08-01 10:23 ` Peter Korsgaard
2019-08-01 10:41 ` Peter Korsgaard
0 siblings, 1 reply; 14+ messages in thread
From: Peter Korsgaard @ 2019-08-01 10:23 UTC (permalink / raw)
To: buildroot
>>>>> "Titouan" == Titouan Christophe <titouan.christophe@railnova.eu> writes:
> Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu>
> ---
> package/mosquitto/Config.in | 4 ----
> package/mosquitto/mosquitto.mk | 6 ++++++
> 2 files changed, 6 insertions(+), 4 deletions(-)
> diff --git a/package/mosquitto/Config.in b/package/mosquitto/Config.in
> index 11b6d7891b..7135e86e69 100644
> --- a/package/mosquitto/Config.in
> +++ b/package/mosquitto/Config.in
> @@ -1,6 +1,5 @@
> config BR2_PACKAGE_MOSQUITTO
> bool "mosquitto"
> - depends on !BR2_STATIC_LIBS # builds .so
> help
> Mosquitto is an open source message broker that implements
> the MQ Telemetry Transport protocol versions 3.1 and
> @@ -22,6 +21,3 @@ config BR2_PACKAGE_MOSQUITTO_BROKER
> comment "mosquitto broker needs a system with MMU"
> depends on BR2_PACKAGE_MOSQUTTO && !BR2_USE_MMU
> -
> -comment "mosquitto needs a toolchain w/ dynamic library"
> - depends on BR2_STATIC_LIBS
> diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
> index 51c0abd0ba..ed72af754a 100644
> --- a/package/mosquitto/mosquitto.mk
> +++ b/package/mosquitto/mosquitto.mk
> @@ -17,6 +17,12 @@ MOSQUITTO_MAKE_OPTS = \
> WITH_WRAP=no \
> WITH_DOCS=no
> +ifeq ($(BR2_STATIC_LIBS),y)
> +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes WITH_SHARED_LIBRARIES=no
> +else
> +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes
> +endif
We actually have 3 variants:
- static only (BR2_STATIC_LIBS)
- shared only (BR2_SHARED_LIBS)
- shared and static (BR2_SHARED_STATIC_LIBS)
So I reworked it to take that into consideration and committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
2019-08-01 10:23 ` Peter Korsgaard
@ 2019-08-01 10:41 ` Peter Korsgaard
2019-08-01 17:09 ` Titouan Christophe
0 siblings, 1 reply; 14+ messages in thread
From: Peter Korsgaard @ 2019-08-01 10:41 UTC (permalink / raw)
To: buildroot
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:
Hi,
>> +ifeq ($(BR2_STATIC_LIBS),y)
>> +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes WITH_SHARED_LIBRARIES=no
>> +else
>> +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes
>> +endif
> We actually have 3 variants:
> - static only (BR2_STATIC_LIBS)
> - shared only (BR2_SHARED_LIBS)
> - shared and static (BR2_SHARED_STATIC_LIBS)
> So I reworked it to take that into consideration and committed, thanks.
Sorry, I will have to take that back. I did a test compilation with a
completely static (BR2_STATIC_LIBS) setup, which failed:
In file included from security.c:25:
lib_load.h:23:11: fatal error: dlfcn.h: No such file or directory
# include <dlfcn.h>
^~~~~~~~~
compilation terminated.
The loadable plugin logic in security.c seems to be built
unconditionally, so that cannot work in a completely static setup.
Care to bring up this issue upstream?
In the mean time I have marked your patch as changes requested. For
reference, the changes I did in mosquitto.mk look like this:
feq ($(BR2_SHARED_LIBS),y)
MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no
else
MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes
endif
ifeq ($(BR2_STATIC_LIBS),y)
MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=no
else
MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=yes
endif
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 14+ messages in thread* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
2019-08-01 10:41 ` Peter Korsgaard
@ 2019-08-01 17:09 ` Titouan Christophe
2019-08-01 17:25 ` Peter Korsgaard
0 siblings, 1 reply; 14+ messages in thread
From: Titouan Christophe @ 2019-08-01 17:09 UTC (permalink / raw)
To: buildroot
Hello Peter,
Thank you for reviewing this series !
On 8/1/19 12:41 PM, Peter Korsgaard wrote:
>>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:
>
> Hi,
>
> >> +ifeq ($(BR2_STATIC_LIBS),y)
> >> +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes WITH_SHARED_LIBRARIES=no
> >> +else
> >> +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes
> >> +endif
>
> > We actually have 3 variants:
>
> > - static only (BR2_STATIC_LIBS)
> > - shared only (BR2_SHARED_LIBS)
> > - shared and static (BR2_SHARED_STATIC_LIBS)
>
> > So I reworked it to take that into consideration and committed, thanks.
>
> Sorry, I will have to take that back. I did a test compilation with a
> completely static (BR2_STATIC_LIBS) setup, which failed:
Could you share the defconfig you have used to obtain that result ?
When I run test-pkg with BR2_PACKAGE_MOSQUITTO=y (and
BR2_PACKAGE_MOSQUITTO_BROKER defaults to y), I see:
"""br-arm-full-static [5/6]: OK""".
>
> In file included from security.c:25:
> lib_load.h:23:11: fatal error: dlfcn.h: No such file or directory
> # include <dlfcn.h>
> ^~~~~~~~~
> compilation terminated.
>
> The loadable plugin logic in security.c seems to be built
> unconditionally, so that cannot work in a completely static setup.
>
> Care to bring up this issue upstream?
As soon as I understand the conditions to reproduce, I will do so.
>
> In the mean time I have marked your patch as changes requested. For
> reference, the changes I did in mosquitto.mk look like this:
>
> feq ($(BR2_SHARED_LIBS),y)
> MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no
> else
> MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes
> endif
>
> ifeq ($(BR2_STATIC_LIBS),y)
> MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=no
> else
> MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=yes
> endif
>
Thanks for sharing !
Best regards,
Titouan
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
2019-08-01 17:09 ` Titouan Christophe
@ 2019-08-01 17:25 ` Peter Korsgaard
2019-08-02 13:18 ` Titouan Christophe
0 siblings, 1 reply; 14+ messages in thread
From: Peter Korsgaard @ 2019-08-01 17:25 UTC (permalink / raw)
To: buildroot
>>>>> "Titouan" == Titouan Christophe <titouan.christophe@railnova.eu> writes:
> Hello Peter,
> Thank you for reviewing this series !
> On 8/1/19 12:41 PM, Peter Korsgaard wrote:
>>>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:
>>
>> Hi,
>>
>> >> +ifeq ($(BR2_STATIC_LIBS),y)
>> >> +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=yes WITH_SHARED_LIBRARIES=no
>> >> +else
>> >> +MOSQUITTO_MAKE_OPTS += WITH_STATIC_LIBRARIES=no WITH_SHARED_LIBRARIES=yes
>> >> +endif
>>
>> > We actually have 3 variants:
>>
>> > - static only (BR2_STATIC_LIBS)
>> > - shared only (BR2_SHARED_LIBS)
>> > - shared and static (BR2_SHARED_STATIC_LIBS)
>>
>> > So I reworked it to take that into consideration and committed, thanks.
>>
>> Sorry, I will have to take that back. I did a test compilation with a
>> completely static (BR2_STATIC_LIBS) setup, which failed:
> Could you share the defconfig you have used to obtain that result ?
It was afaik just the default arm variant with BR2_STATIC_LIBS enabled.
> When I run test-pkg with BR2_PACKAGE_MOSQUITTO=y (and
> BR2_PACKAGE_MOSQUITTO_BROKER defaults to y), I see:
> """br-arm-full-static [5/6]: OK""".
Hmm, very odd. With current git HEAD and this patch 1/3 applied and the
following config:
BR2_arm=y
BR2_STATIC_LIBS=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-static-2019.02-rc1.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_7=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_4=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_PACKAGE_MOSQUITTO=y
(E.G. support/config-fragments/autobuild/br-arm-full-static.config + mosquitto)
I get the expected failure:
In file included from security.c:25:0:
lib_load.h:23:11: fatal error: dlfcn.h: No such file or directory
# include <dlfcn.h>
^~~~~~~~~
compilation terminated.
Makefile:189: recipe for target 'security.o' failed
br-arm-full-static-2019.02-rc1.tar.bz2 does not contain a dlfcn.h file,
so that makes sense.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 14+ messages in thread* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
2019-08-01 17:25 ` Peter Korsgaard
@ 2019-08-02 13:18 ` Titouan Christophe
2019-08-02 15:58 ` Peter Korsgaard
0 siblings, 1 reply; 14+ messages in thread
From: Titouan Christophe @ 2019-08-02 13:18 UTC (permalink / raw)
To: buildroot
Hello,
On 8/1/19 7:25 PM, Peter Korsgaard wrote:
>
> It was afaik just the default arm variant with BR2_STATIC_LIBS enabled.
>
> > When I run test-pkg with BR2_PACKAGE_MOSQUITTO=y (and
> > BR2_PACKAGE_MOSQUITTO_BROKER defaults to y), I see:
> > """br-arm-full-static [5/6]: OK""".
>
> Hmm, very odd. With current git HEAD and this patch 1/3 applied and the
> following config:
>
> BR2_arm=y
> BR2_STATIC_LIBS=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-static-2019.02-rc1.tar.bz2"
> BR2_TOOLCHAIN_EXTERNAL_GCC_7=y
> BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_4=y
> BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
> # BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
> BR2_TOOLCHAIN_EXTERNAL_CXX=y
> BR2_PACKAGE_MOSQUITTO=y
>
Indeed, when doing a regular make (and not test-pkg) with this defconfig
I can reproduce the aforementioned failure.
> (E.G. support/config-fragments/autobuild/br-arm-full-static.config + mosquitto)
>
> I get the expected failure:
>
> In file included from security.c:25:0:
> lib_load.h:23:11: fatal error: dlfcn.h: No such file or directory
> # include <dlfcn.h>
> ^~~~~~~~~
> compilation terminated.
> Makefile:189: recipe for target 'security.o' failed
>
> br-arm-full-static-2019.02-rc1.tar.bz2 does not contain a dlfcn.h file,
> so that makes sense.
>
Now, when looking at mosquitto, I understand that WITH_SHARED_LIBRARY=no
implies that libmosquitto.so won't be created (and linked against).
However, the failure over here is due to some code in the broker which
is intended to dynamically load modules at runtime, no matter if
mosquitto is running inside a statically linked executable or from a dylib.
As such, I suggest then to only make the broker depend on
BR2_SHARED_LIBS, while still allowing the client lib to be built
statically, which in my opinion makes sense for embedded targets.
What do you think ?
Kind regards,
Titouan
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib
2019-08-02 13:18 ` Titouan Christophe
@ 2019-08-02 15:58 ` Peter Korsgaard
0 siblings, 0 replies; 14+ messages in thread
From: Peter Korsgaard @ 2019-08-02 15:58 UTC (permalink / raw)
To: buildroot
>>>>> "Titouan" == Titouan Christophe <titouan.christophe@railnova.eu> writes:
Hi,
> Indeed, when doing a regular make (and not test-pkg) with this
> defconfig I can reproduce the aforementioned failure.
Funky, but OK.
> Now, when looking at mosquitto, I understand that
> WITH_SHARED_LIBRARY=no implies that libmosquitto.so won't be created
> (and linked against).
> However, the failure over here is due to some code in the broker which
> is intended to dynamically load modules at runtime, no matter if
> mosquitto is running inside a statically linked executable or from a
> dylib.
> As such, I suggest then to only make the broker depend on
> BR2_SHARED_LIBS, while still allowing the client lib to be built
> statically, which in my opinion makes sense for embedded targets.
> What do you think ?
Yes, that could work. Will you send a patch for that?
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-08-03 11:14 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-03 9:38 [Buildroot] [PATCH v2 0/3] Update package mosquitto Titouan Christophe
2019-08-03 9:38 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
2019-08-03 11:13 ` Peter Korsgaard
2019-08-03 9:38 ` [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration Titouan Christophe
2019-08-03 11:13 ` Peter Korsgaard
2019-08-03 9:38 ` [Buildroot] [PATCH 3/3] package/mosquitto: update help text in Config.in Titouan Christophe
2019-08-03 11:14 ` Peter Korsgaard
-- strict thread matches above, loose matches on Subject: below --
2019-07-18 10:06 [Buildroot] [PATCH 0/3] Update package mosquitto Titouan Christophe
2019-07-18 10:06 ` [Buildroot] [PATCH 1/3] package/mosquitto: allow to build as static lib Titouan Christophe
2019-08-01 10:23 ` Peter Korsgaard
2019-08-01 10:41 ` Peter Korsgaard
2019-08-01 17:09 ` Titouan Christophe
2019-08-01 17:25 ` Peter Korsgaard
2019-08-02 13:18 ` Titouan Christophe
2019-08-02 15:58 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox