So I managed to successfully run MySensorsGW in a RPI4 with 64bit OS, based on the theoretical premise that a 32bit binary can run in a 64bit system.
My project idea is to have a central device running my house automation. For that, I use and RPI4 4GB with IoT stack witch is a set of docker images each one with a specific function. This way, I'll be running MQTT Mosquito, NodeRed, zigbee2MQTT, inFluxDB and Graphana, each one in its own docker container. IoT stack also includes other images like transmission torrent, nextcloud, PiHole, etc. I might also use some of it later on.
Anyway, all of this requires a lot of effort from the little RPI4 so it is important to be able to use all of its resources. Using a 64bit OS is one way to have a more performant system and to be able to address all the RAM (4GB in my case).
So, having mysgw in this RPI was crucial to maintain a small footprint. It would be great to have the MySensors GW as a docker container as well, but for now this workaround would have to sufice.
Compiling mswg in RPI 64bit OS is not working (as per the above), but compiling it in a 32bit RPI OS and then copying a couple of files to the RPI 64bit OS it works, at least in my case. My msgw is configured as a MQTT GW, so if yours is different, your millenage may vary.
./configure --my-gateway=mqtt --my-controller-ip-address=192.168.2.180 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=MySensorsGW --my-transport=rfm69 --my-signing=software --my-signing-request-signatures --my-rfm69-frequency=433 --my-is-rfm69hw --my-signing-debug --my-rfm69-encryption-enabled --my-mqtt-user=mysensorsuser --my-mqtt-password=mysensorspassword
(Now I can change the --my-controller-ip-address to 127.0.0.1. This way, if for some reason I want to change the controller IP address, I'll not need to re-compile)
Anyway, so the process is basically compiling everything in the 32bit RPI OS, (configure, make, sudo make install), configure the /etc/sensors.conf accordingly and then coping these files to the same path in the 64bit RPI OS:
/usr/lib/arm-linux-gnueabihf/libstdc++.so.6
/etc/mysensors.conf
/etc/systemd/system/mysgw.service
/usr/local/bin/mysgw
Run it as normal:
sudo systemctl start mysgw.service
Enjoy
Dec 04 12:34:57 INFO Starting gateway...
Dec 04 12:34:57 INFO Protocol version - 2.3.2
Dec 04 12:34:57 DEBUG MCO:BGN:INIT GW,CP=RPNGLS-X,FQ=NA,REL=255,VER=2.3.2
Dec 04 12:34:57 DEBUG SGN:PER:OK
Dec 04 12:34:57 DEBUG SGN:INI:BND OK
Dec 04 12:34:57 DEBUG TSF:LRT:OK
Dec 04 12:34:57 DEBUG TSM:INIT
Dec 04 12:34:57 DEBUG TSF:WUR:MS=0
Dec 04 12:34:57 DEBUG TSM:INIT:TSP OK
Dec 04 12:34:57 DEBUG TSM:INIT:GW MODE
Dec 04 12:34:57 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
Dec 04 12:34:57 DEBUG MCO:REG:NOT NEEDED
Dec 04 12:34:57 DEBUG MCO:BGN:STP
Dec 04 12:34:57 DEBUG MCO:BGN:INIT OK,TSP=1
Dec 04 12:34:57 DEBUG GWT:RMQ:CONNECTING...
Dec 04 12:34:57 DEBUG connected to 192.168.2.180
Dec 04 12:34:57 DEBUG GWT:RMQ:OK
Dec 04 12:34:57 DEBUG GWT:TPS:TOPIC=mysensors-out/0/255/0/0/18,MSG SENT
Dec 04 12:34:57 DEBUG TSM:READY:NWD REQ
Dec 04 12:34:57 DEBUG SGN:SGN:NREQ=255
Dec 04 12:34:57 DEBUG ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
Dec 04 12:44:37 DEBUG TSF:MSG:READ,80-80-255,s=255,c=3,t=7,pt=0,l=0,sg=1:
Dec 04 12:44:37 DEBUG TSF:MSG:BC
Dec 04 12:44:37 DEBUG TSF:MSG:FPAR REQ,ID=80
Dec 04 12:44:37 DEBUG TSF:PNG:SEND,TO=0
Dec 04 12:44:37 DEBUG TSF:CKU:OK
Dec 04 12:44:37 DEBUG TSF:MSG:GWL OK
Dec 04 12:44:37 DEBUG SGN:SKP:MSG CMD=3,TYPE=8
Dec 04 12:44:38 DEBUG TSF:MSG:SEND,0-0-80-80,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
Dec 04 12:44:41 DEBUG TSF:MSG:READ,80-80-0,s=255,c=3,t=24,pt=1,l=1,sg=1:1
Dec 04 12:44:41 DEBUG SGN:SKP:MSG CMD=3,TYPE=24
Dec 04 12:44:41 DEBUG TSF:MSG:PINGED,ID=80,HP=1
Dec 04 12:44:41 DEBUG SGN:SKP:MSG CMD=3,TYPE=25
Dec 04 12:44:41 DEBUG TSF:MSG:SEND,0-0-80-80,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
Dec 04 12:45:40 DEBUG TSF:MSG:READ,80-80-0,s=20,c=3,t=16,pt=0,l=0,sg=1:
Dec 04 12:45:40 DEBUG SGN:SKP:MSG CMD=3,TYPE=16
Dec 04 12:45:40 DEBUG SGN:SKP:MSG CMD=3,TYPE=17
Dec 04 12:45:41 DEBUG TSF:MSG:SEND,0-0-80-80,s=255,c=3,t=17,pt=6,l=25,sg=1,ft=0,st=OK:<NONCE>
Dec 04 12:45:41 DEBUG SGN:NCE:XMT,TO=0
Dec 04 12:45:41 DEBUG TSF:MSG:READ,80-80-0,s=20,c=1,t=0,pt=7,l=5,sg=1:14.0
Dec 04 12:45:41 DEBUG SGN:BND:NONCE=607CD378A13D593F9957DAC6077B64FEDC18063A8A3FC7EA50AAAAAAAAAAAAAA
Dec 04 12:45:41 DEBUG SGN:BND:HMAC=F0DA2FBCD8AED09526D29E9C6AF7873076303A8E6F6F0FAB258BE29031DA29EB
Dec 04 12:45:41 DEBUG SGN:VER:OK
Dec 04 12:45:41 DEBUG GWT:TPS:TOPIC=mysensors-out/80/20/1/0/0,MSG SENT
Dec 04 12:45:42 DEBUG TSF:MSG:READ,80-80-0,s=40,c=3,t=16,pt=0,l=0,sg=1:
Dec 04 12:45:42 DEBUG SGN:SKP:MSG CMD=3,TYPE=16
Dec 04 12:45:42 DEBUG SGN:SKP:MSG CMD=3,TYPE=17
Dec 04 12:45:42 DEBUG TSF:MSG:SEND,0-0-80-80,s=255,c=3,t=17,pt=6,l=25,sg=1,ft=0,st=OK:<NONCE>
Dec 04 12:45:42 DEBUG SGN:NCE:XMT,TO=0
Dec 04 12:45:43 DEBUG TSF:MSG:READ,80-80-0,s=40,c=1,t=1,pt=7,l=5,sg=1:64.0
Dec 04 12:45:43 DEBUG SGN:BND:NONCE=AB465A4A24BDDF89CC30C3F30F4F4B519ECDDC2843FF725874AAAAAAAAAAAAAA
Dec 04 12:45:43 DEBUG SGN:BND:HMAC=62C90515061BA556B4CF4F7ECB3FE224E54BE1ED8A2522AB8E8A1FA192B738C4
Dec 04 12:45:43 DEBUG SGN:VER:OK
Dec 04 12:45:43 DEBUG GWT:TPS:TOPIC=mysensors-out/80/40/1/0/1,MSG SENT
pi@raspberrypi:~/MySensors $ uname -a
Linux raspberrypi 5.4.79-v8+ #1373 SMP PREEMPT Mon Nov 23 13:32:41 GMT 2020 aarch64 GNU/Linux
Cheers