waku-org / nwaku

Waku node and protocol.
Other
201 stars 53 forks source link

bug: unable to build on arm64 due to msse3 feature #1607

Closed jakubgs closed 1 year ago

jakubgs commented 1 year ago

Problem

Builds on arm64 fail with:

gcc: error: unrecognized command line option '-msse3'
stack trace: (most recent call last)
/nix/store/86y677haw24vwq0idczq6y340fhyrfss-nim-unwrapped-1.6.10/nim/lib/system/nimscript.nim(429, 18)
/build/source/waku.nimble(69, 15) wakunode2Task
/build/source/waku.nimble(35, 8) buildBinary
/nix/store/86y677haw24vwq0idczq6y340fhyrfss-nim-unwrapped-1.6.10/nim/lib/system/nimscript.nim(273, 7) exec
/nix/store/86y677haw24vwq0idczq6y340fhyrfss-nim-unwrapped-1.6.10/nim/lib/system/nimscript.nim:273:7 Error: unhandled exception: FAILED: nim c --out:build/wakunode2 -d:chronicles_log_level=TRACE -d:disableMarchNative --verbosity:0 --hints:off -d:git_version="v0.15.0" -d:release apps/wakunode2/wakunode2.nim [OSError]
make: *** [Makefile:144: wakunode2] Error 1
gcc: error: unrecognized command line option '-msse3'

Which happens due to: https://github.com/waku-org/nwaku/blob/08b21804410d0f7127c061528ec235ae13fce450/config.nims#L21-L27 Since it's not the smartest idea to force a CPU feature on a portable build.

Impact

Current master as well as all releases cannot be built on arm64 machines without msse3 feature.

To reproduce

  1. Use an arm64 machine
  2. Run make wakunode2
  3. See the gcc: error: unrecognized command line option '-msse3' error

Expected behavior

It buidls.

Additional context

Found while working on entry for nixpkgs:

Here's features from my ARM Cortex-A9 CPU in my NanoPC-T4:

 > cat /proc/cpuinfo | grep features | head -n1
Features    : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
jm-clius commented 1 year ago

Thanks. Adding nimbus config.nims here as reference: https://github.com/status-im/nimbus-eth2/blob/stable/config.nims#L93-L123