duhow/wibox

MQTT

segator opened this issue · 4 comments

I notice you have set on some scripts mqtt usage, but the bin is not included on the git repo

duhow commented

That's right, I still need to write scripts for having a clean way to build applications.
As the system uses old libraries and we cannot write to rootfs mtd3 I have to run an old version of components.
For instance, Sofia is build with:
gcc version 4.6.1 (crosstool-NG 1.18.0) ) 2018-02-11 09:53:00
There are some references to buildroot-2013.05.

Libraries available:

  • ld-uClibc-0.9.33.2.so
  • libstdc++.so.6.0.16
  • GLIBCXX_3.4.16
  • OpenSSL 1.1.0g 2 Nov 2017
compiler: arm-goke-linux-uclibcgnueabi-gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE
-DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM
-DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" 
  • zlib 1.2.7
duhow commented

Based on https://gist.github.com/likeablob/20238a1d19c7564501fa56bc1db8f754 (still WIP):

apt update
apt install -y sudo tar xz-utils unzip bzip2 build-essential bison flex texinfo help2man file gawk libtool libtool-bin libncurses-dev wget curl
wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.24.0.tar.xz
tar xvf crosstool-ng-1.24.0.tar.bz2
cd crosstool-ng-1.24.0
make && sudo make install
mkdir ct-ng-arm-goke-linux-uclibcgnueabi
cd ct-ng-arm-goke-linux-uclibcgnueabi
ct-ng arm-unknown-linux-uclibcgnueabi
ct-ng menuconfig

# Toolchain options ---> Tuple's vendor string ---> "goke"
# Operating System ---> Version of linux ---> 3.4.113
# C compiler ---> Version of gcc ---> 4.9.4

useradd build
usermod -d $PWD build
sudo chmod a+rw * .
sudo -u build ct-ng build

ls ~/x-tools/arm-goke-linux-uclibcgnueabi/ # verify installed
duhow commented

After patching with above fix

--- lib/dummypthread.h	2021-06-09 16:06:23.000000000 +0200
+++ lib/dummypthread.h	2021-12-30 11:56:21.898242877 +0100
@@ -4,7 +4,7 @@
 #define pthread_create(A, B, C, D)
 #define pthread_join(A, B)
 #define pthread_cancel(A)
-#define pthread_testcancel()
+#define pthread_testcancel(void)
 
 #define pthread_mutex_init(A, B)
 #define pthread_mutex_destroy(A)

and with ongoing toolchain in #7 , I'm able to build mosquitto with:

make WITH_THREADING=no WITH_TLS=no WITH_CJSON=no WITH_BRIDGE=no WITH_PERSISTENCE=no \
     WITH_MEMORY_TRACKING=no WITH_DOCS=no WITH_STRIP=yes WITH_STATIC_LIBRARIES=yes \
     WITH_SHARED_LIBRARIES=no CFLAGS="-Wall -Os" CROSS_COMPILE=arm-goke-linux-uclibcgnueabi-