Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't Compile with GCC 12.1.0 #4129

Closed
brockelmore opened this issue May 12, 2022 · 3 comments
Closed

Doesn't Compile with GCC 12.1.0 #4129

brockelmore opened this issue May 12, 2022 · 3 comments

Comments

@brockelmore
Copy link

brockelmore commented May 12, 2022

System information

Erigon version: stable

OS & Version: Linux (Linux main 5.17.6-arch1-1 #1 SMP PREEMPT Tue, 10 May 2022 23:00:39 +0000 x86_64 GNU/Linux)

Commit hash : b35e87c

Expected behaviour

make erigon compiles the erigon binary

Actual behaviour

Fails to compile (see backtrace).

Relevant: crawshaw/sqlite#127

Also, note in the makefile github.com/ledgerwatch/erigon/params.GitTag=v2022.05.03 is used instead of the actual git tag, but I don't think this is relevant (but may be something to fix instead of assuming we are building on latest tag?).

Steps to reproduce the behaviour

I believe just using gcc 12.1.0 on linux should trigger this when running make erigon

Backtrace

[brock@main erigon]$ make erigon
Building Erigon
rm -f /home/brock/d2/erigon/build/bin/tg # Remove old binary to prevent confusion where users still use it because of the scripts
CGO_CFLAGS="-g -O2  -DMDBX_FORCE_ASSERTIONS=0 " go build -tags nosqlite -trimpath -ldflags "-X github.com/ledgerwatch/erigon/params.GitCommit=b35e87c84bc218f7af35ccff024f932d09f1051c -X github.com/ledgerwatch/erigon/params.GitBranch=stable -X github.com/ledgerwatch/erigon/params.GitTag=v2022.05.03" -o /home/brock/d2/erigon/build/bin/erigon ./cmd/erigon
# crawshaw.io/sqlite
In file included from ../../go/pkg/mod/crawshaw.io/[email protected]/static.go:19:
../../go/pkg/mod/crawshaw.io/[email protected]/./c/sqlite3.c: In function ‘sqlite3Fts5IndexQuery’:
../../go/pkg/mod/crawshaw.io/[email protected]/./c/sqlite3.c:220863:18: warning: ‘memcpy’ specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
220863 |     if( nToken ) memcpy(&buf.p[1], pToken, nToken);
       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# github.com/torquem-ch/mdbx-go/mdbx
In file included from mdbx.c:1036:
In function ‘atomic_store64’,
    inlined from ‘mdbx_find_oldest.isra’ at mdbx.c:9184:12:
mdbx.c:4279:3: error: ‘__atomic_store_8’ writing 8 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
 4279 |   atomic_store_explicit(MDBX_c11a_rw(uint64_t, p), value, mo_c11_store(order));
      |   ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:48: erigon] Error 2
@AskAlexSharov
Copy link
Collaborator

@AskAlexSharov
Copy link
Collaborator

I think it's fixed in latest devel

@brockelmore
Copy link
Author

confirmed, built today 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants