583a02e398
Version 2.1.x has introduced a cmake-based build, and upstream strongly
recomends using it over the legacy Makefiles, which will ultimately be
retired.
So we do the switch, which cause quite some noise in the .mk file, but
at the same time allows for a bit of cleanup in the build process, as we
can now use the cmake-package infra.
Mosquitto now wants to peek into the malloc() internals for memory
tracking, and that only works on systems with an MMU (uClibc-ng does not
expose it for noMMU builds, as it's part of its malloc-standard
implementation).
Static-only builds are broken, even when only building the library. This
seems beyond a simple repair, so just require shared libs now (since
we're requiring an MMU as well, requiring shared libs is not too much of
an additional burden).
cJSON is now a required dependency, used in common parts of the code
(not just for the plugins).
There are a few options that we forcibly disable; they'll get addressed
in followup patches.
There are still a few build failures that are difficult to account for
(except):
$ printf 'BR2_PACKAGE_MOSQUITTO=y\n' >mosq.cfg
$ ./utils/docker-run ./utils/test-pkg -d $(pwd)/run-tests -c mosq.cfg -p mosquitto
br-arm-full-static [5/6]: FAILED
=> old uClibc-ng, would need __GNU_SOURCE (with dunder) to define
getrandom(); no longer needed since uClibc-ng 1.0.50; would need
openssl otherwise
bootlin-aarch64-glibc-old [6/6]: FAILED
=> really old glibc, missing getrandom(); would need openssl
Drop our existing patches, they've either been applied upstream, or are
no longer needed. Add new patches to fix various build issues
(submission upstream pending the signature of the CLA..,).
Thanks a lot to Titouan for providing his initial work on the update!
Some of his findings ended up in this patch. 👍
Note: by lack of a trusted path back to the PGP key that signed the
archive, the comment was dropped, as checking a signature without a
trust-chain does not make much sense...
Co-developped-by: Titouan Christophe <titouan.christophe@mind.be>
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Titouan Christophe <titouan.christophe@mind.be>
[Romain: remove "mosquitto broker" comment for static builds]
Signed-off-by: Romain Naour <romain.naour@smile.fr>
137 lines
4.0 KiB
Diff
137 lines
4.0 KiB
Diff
From cef817f226637fe3ca07a0e154fcdb9bd7759682 Mon Sep 17 00:00:00 2001
|
|
From: "Roger A. Light" <roger@atchoo.org>
|
|
Date: Fri, 13 Feb 2026 11:21:28 +0000
|
|
Subject: [PATCH] Fix missing SONAME.
|
|
|
|
Closes #3483. Thanks to Matt Turner.
|
|
|
|
Upstream: https://github.com/eclipse-mosquitto/mosquitto/commit/64ccdc712df212b370858acff881ed884c97b715
|
|
[yann.morin@orange.com: drop the Changelog.txt entry]
|
|
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
|
|
---
|
|
libcommon/Makefile | 2 +-
|
|
libcommon/linker.version | 98 ++++++++++++++++++++++++++++++++++++++++
|
|
2 files changed, 99 insertions(+), 1 deletion(-)
|
|
create mode 100644 libcommon/linker.version
|
|
|
|
diff --git a/libcommon/Makefile b/libcommon/Makefile
|
|
index d0a467af..e45e45cb 100644
|
|
--- a/libcommon/Makefile
|
|
+++ b/libcommon/Makefile
|
|
@@ -3,7 +3,7 @@ include ${R}/config.mk
|
|
|
|
LOCAL_CFLAGS+=-fPIC
|
|
LOCAL_CPPFLAGS+=
|
|
-LOCAL_LDFLAGS+=-fPIC
|
|
+LOCAL_LDFLAGS+=-Wl,--version-script=linker.version -Wl,-soname,libmosquitto_common.so.$(SOVERSION) -fPIC
|
|
LOCAL_LIBADD+=-lcjson
|
|
|
|
ifeq ($(WITH_MEMORY_TRACKING),yes)
|
|
diff --git a/libcommon/linker.version b/libcommon/linker.version
|
|
new file mode 100644
|
|
index 00000000..583d9663
|
|
--- /dev/null
|
|
+++ b/libcommon/linker.version
|
|
@@ -0,0 +1,98 @@
|
|
+/* Linker version script - currently used here primarily to control which
|
|
+ * symbols are exported.
|
|
+ */
|
|
+
|
|
+MOSQ_2.1 {
|
|
+ global:
|
|
+ libcommon_printf;
|
|
+ mosquitto_base64_decode;
|
|
+ mosquitto_base64_encode;
|
|
+ mosquitto_calloc;
|
|
+ mosquitto_connack_string;
|
|
+ mosquitto_fgets;
|
|
+ mosquitto_fopen;
|
|
+ mosquitto_free;
|
|
+ mosquitto_free;
|
|
+ mosquitto_getrandom;
|
|
+ mosquitto_malloc;
|
|
+ mosquitto_malloc;
|
|
+ mosquitto_max_memory_used;
|
|
+ mosquitto_memory_set_limit;
|
|
+ mosquitto_memory_used;
|
|
+ mosquitto_properties_to_json;
|
|
+ mosquitto_property_next;
|
|
+ mosquitto_property_read_binary;
|
|
+ mosquitto_property_read_byte;
|
|
+ mosquitto_property_read_int16;
|
|
+ mosquitto_property_read_int32;
|
|
+ mosquitto_property_read_string;
|
|
+ mosquitto_property_read_string_pair;
|
|
+ mosquitto_property_read_varint;
|
|
+ mosquitto_property_add_binary;
|
|
+ mosquitto_property_add_byte;
|
|
+ mosquitto_property_add_int16;
|
|
+ mosquitto_property_add_int32;
|
|
+ mosquitto_property_add_string;
|
|
+ mosquitto_property_add_string_pair;
|
|
+ mosquitto_property_add_varint;
|
|
+ mosquitto_property_binary_value;
|
|
+ mosquitto_property_binary_value_length;
|
|
+ mosquitto_property_byte_value;
|
|
+ mosquitto_property_check_all;
|
|
+ mosquitto_property_check_command;
|
|
+ mosquitto_property_copy_all;
|
|
+ mosquitto_property_free;
|
|
+ mosquitto_property_free_all;
|
|
+ mosquitto_property_get_length;
|
|
+ mosquitto_property_get_length_all;
|
|
+ mosquitto_property_get_remaining_length;
|
|
+ mosquitto_property_identifier;
|
|
+ mosquitto_property_identifier_to_string;
|
|
+ mosquitto_property_int16_value;
|
|
+ mosquitto_property_int32_value;
|
|
+ mosquitto_property_remove;
|
|
+ mosquitto_property_string_name;
|
|
+ mosquitto_property_string_name_length;
|
|
+ mosquitto_property_string_value;
|
|
+ mosquitto_property_string_value_length;
|
|
+ mosquitto_property_type;
|
|
+ mosquitto_property_varint_value;
|
|
+ mosquitto_pub_topic_check;
|
|
+ mosquitto_pub_topic_check2;
|
|
+ mosquitto_pw_cleanup;
|
|
+ mosquitto_pw_decode;
|
|
+ mosquitto_pw_get_encoded;
|
|
+ mosquitto_pw_hash_encoded;
|
|
+ mosquitto_pw_is_valid;
|
|
+ mosquitto_pw_new;
|
|
+ mosquitto_pw_set_param;
|
|
+ mosquitto_pw_set_valid;
|
|
+ mosquitto_pw_verify;
|
|
+ mosquitto_read_file;
|
|
+ mosquitto_realloc;
|
|
+ mosquitto_realloc;
|
|
+ mosquitto_reason_string;
|
|
+ mosquitto_strdup;
|
|
+ mosquitto_strerror;
|
|
+ mosquitto_string_to_command;
|
|
+ mosquitto_string_to_property_info;
|
|
+ mosquitto_strndup;
|
|
+ mosquitto_sub_matches_acl;
|
|
+ mosquitto_sub_matches_acl_with_pattern;
|
|
+ mosquitto_sub_topic_check;
|
|
+ mosquitto_sub_topic_check2;
|
|
+ mosquitto_sub_topic_tokenise;
|
|
+ mosquitto_sub_topic_tokens_free;
|
|
+ mosquitto_time;
|
|
+ mosquitto_time_cmp;
|
|
+ mosquitto_time_init;
|
|
+ mosquitto_time_ns;
|
|
+ mosquitto_topic_matches_sub;
|
|
+ mosquitto_topic_matches_sub2;
|
|
+ mosquitto_topic_matches_sub_with_pattern;
|
|
+ mosquitto_trimblanks;
|
|
+ mosquitto_validate_utf8;
|
|
+ mosquitto_varint_bytes;
|
|
+ mosquitto_write_file;
|
|
+ local: *;
|
|
+};
|
|
--
|
|
2.34.1
|
|
|