josh-thurston / easyBEATS

Beats for Raspberry Pi / ARM
Apache License 2.0
84 stars 27 forks source link

32-bit build on a 64-bit Raspberry Pi #19

Open kfxkaplan opened 10 months ago

kfxkaplan commented 10 months ago

Hello,

I tried building this on my 64-bit Raspberry Pi (uname -m returns aarch64), but the output of the build process for Filbert is 32-bit.

pi@raspberry-0b90d8:/tmp/beats/filebeat $ file filebeat
filebeat: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=153b309e061257da03ad06dbbf5e3b2f94058e4f, for GNU/Linux 3.2.0, stripped
pi@raspberry-0b90d8:/tmp/beats/filebeat $ ./filebeat
Failed to initialize: trying to run 32Bit binary on 64Bit system

It does work fine on my 32-bit armv7l Pis, but I also need a 64-bit build. Are there any settings I can change to make this work?

Thanks

josh-thurston commented 10 months ago

I dont know off the top of my head.  It has been a while since i have done any work on this project.  I will see if I can look into this and figure out an answer for you.Sent from my iPadOn Oct 26, 2023, at 6:40 AM, kfxkaplan @.> wrote: Hello, I tried building this on my 64-bit Raspberry Pi (uname -m returns aarch64), but the output of the build process for Filbert is 32-bit. @.:/tmp/beats/filebeat $ file filebeat filebeat: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=153b309e061257da03ad06dbbf5e3b2f94058e4f, for GNU/Linux 3.2.0, stripped @.***:/tmp/beats/filebeat $ ./filebeat Failed to initialize: trying to run 32Bit binary on 64Bit system

It does work fine on my 32-bit armv7l Pis, but I also need a 64-bit build. Are there any settings I can change to make this work? Thanks

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

kfxkaplan commented 10 months ago

Hi Josh,

Thanks for the quick response! So far in my debugging I've found that you defaulted to the armv6l version of go. I tried modifying it to use the arm64 version instead, and got the following error:

Compiling Beats...
Compiling filebeat
# runtime/cgo
In file included from _cgo_export.c:4:
cgo-gcc-export-header-prolog:31:14: error: size of array ‘_check_for_64_bit_pointer_matching_GoInt’ is negative
Error: error compiling magefiles

Hope this helps

kfxkaplan commented 10 months ago

Ok, turns out my pi was 64-bit kernel but 32-bit OS. I downgraded kernel (via arm_64bit=0 in /boot/config.txt) and now the regular build works again. You can close this ticket, thanks.