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

Build error with v1.2.4 #1667

Closed
shiziwen opened this issue Jun 2, 2023 · 8 comments
Closed

Build error with v1.2.4 #1667

shiziwen opened this issue Jun 2, 2023 · 8 comments

Comments

@shiziwen
Copy link

shiziwen commented Jun 2, 2023

Hi, when I build v1.2.4 using 'make geth', I got the following errors:

env GO111MODULE=on go run build/ci.go install ./cmd/geth
>>> /usr/lib/golang/bin/go build -ldflags -X main.gitCommit=3c5f54fc805994b0b60b50dbd59e4424df25f17a -X main.gitDate= -extldflags -Wl,-z,stack-size=0x800000 -trimpath -v -o /data/codes/bsc/build/bin/geth ./cmd/geth
github.com/supranational/blst/bindings/go
# github.com/supranational/blst/bindings/go
/home/java-tron/go/pkg/mod/github.com/supranational/[email protected]/bindings/go/blst.go: In function 'go_pairing_init':
/home/java-tron/go/pkg/mod/github.com/supranational/[email protected]/bindings/go/blst.go:44:10: error: 'for' loop initial declarations are only allowed in C99 mode
 //         for(size_t i = 0; i < DST_len; i++) dst[i] = DST[i];
          ^
/home/java-tron/go/pkg/mod/github.com/supranational/[email protected]/bindings/go/blst.go:44:10: note: use option -std=c99 or -std=gnu99 to compile your code
util.go:46: exit status 2
exit status 1
make: *** [geth] Error 1

My go version is go version go1.19.6 linux/amd64

and I can build v1.1.22 successfully.

@MatusKysel
Copy link
Contributor

MatusKysel commented Jun 2, 2023

could you provide your gcc/clang version? I would say you have very old version of compiler installed, maybe try to update it

@shiziwen
Copy link
Author

shiziwen commented Jun 3, 2023

could you provide your gcc/clang version? I would say you have very old version of compiler installed, maybe try to update it

Hi, my gcc version is:

gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

But I can build v1.1.22 successfully.

@MatusKysel
Copy link
Contributor

We updated dependencies so now you should have newer version of GCC or you can try setting export CCFLAGS=-std99

@shiziwen
Copy link
Author

shiziwen commented Jun 3, 2023

Hi, which gcc version do I need?

And after I set export CCFLAGS=-std99 , I also got the error msg:

env GO111MODULE=on go run build/ci.go install ./cmd/geth
>>> /usr/lib/golang/bin/go build -ldflags -X main.gitCommit=3c5f54fc805994b0b60b50dbd59e4424df25f17a -X main.gitDate= -extldflags -Wl,-z,stack-size=0x800000 -trimpath -v -o /data/codes/bsc/build/bin/geth ./cmd/geth
github.com/supranational/blst/bindings/go
# github.com/supranational/blst/bindings/go
/home/java-tron/go/pkg/mod/github.com/supranational/[email protected]/bindings/go/blst.go: In function 'go_pairing_init':
/home/java-tron/go/pkg/mod/github.com/supranational/[email protected]/bindings/go/blst.go:44:10: error: 'for' loop initial declarations are only allowed in C99 mode
 //         for(size_t i = 0; i < DST_len; i++) dst[i] = DST[i];
          ^
/home/java-tron/go/pkg/mod/github.com/supranational/[email protected]/bindings/go/blst.go:44:10: note: use option -std=c99 or -std=gnu99 to compile your code
util.go:46: exit status 2
exit status 1
make: *** [geth] Error 1

@MatusKysel
Copy link
Contributor

Try it again with export CFLAGS="-std=c99" and if this doesn't work try to get GCC 5 or higher

@MatusKysel
Copy link
Contributor

@shiziwen any update?

@shiziwen
Copy link
Author

shiziwen commented Jun 9, 2023

export CFLAGS="-std=c99"

I have tried this env parameter, but it didn't work.

I will try to upgrade the gcc to version 5.

@shiziwen
Copy link
Author

shiziwen commented Jun 9, 2023

@MatusKysel
Hi, after I upgrade the gcc version, it works, thanks.

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