From c03b74224a01016bb64f1e458870d95e86bdc87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Sun, 29 Oct 2023 11:04:52 +0100 Subject: [PATCH] erigon: fix SIGILL error due to missing CGO_CFLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently Erigon binary fails to start on some systems with: ``` > erigon --version Caught SIGILL in blst_cgo_init, consult /bindinds/go/README.md. ``` The reason for that are missing `CGO_CFLAGS` that can be seen here: https://github.com/ledgerwatch/erigon/blob/v2.53.2/Makefile#L26 For more information on this see this `bsc` issue: https://github.com/bnb-chain/bsc/issues/1521 Signed-off-by: Jakub SokoĊ‚owski --- pkgs/applications/blockchains/erigon/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/applications/blockchains/erigon/default.nix b/pkgs/applications/blockchains/erigon/default.nix index 23a6373a2a71..86c0d53fcf82 100644 --- a/pkgs/applications/blockchains/erigon/default.nix +++ b/pkgs/applications/blockchains/erigon/default.nix @@ -22,6 +22,11 @@ buildGoModule { # cc1: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security] hardeningDisable = [ "format" ]; + # Fix error: 'Caught SIGILL in blst_cgo_init' + # https://github.com/bnb-chain/bsc/issues/1521 + CGO_CFLAGS = "-O -D__BLST_PORTABLE__"; + CGO_CFLAGS_ALLOW = "-O -D__BLST_PORTABLE__"; + subPackages = [ "cmd/erigon" "cmd/evm"