Build with GCC12 fails
- Dominant language
- Go
- Stars
- 17.1k
- Forks
- 3.2k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 11
Description
### Checklist
- [X] This is a bug report, not a question. Ask questions on [discuss.ipfs.io](https://discuss.ipfs.io).
- [X] I have searched on the [issue tracker](https://github.com/ipfs/go-ipfs/issues?q=is%3Aissue) for my bug.
- [X] I am running the latest [go-ipfs version](https://dist.ipfs.io/#go-ipfs) or have an issue updating.
### Installation method
built from source
### Version
```Text
Tried to build a72753bad from source.
```
### Config
```json
Does not apply
```
### Description
I've installed the new gcc12 which supposedly supports go in version 1.18.
[But apart from a bug which avoids printing out the right version number](https://bugs.archlinux.org/task/74739) - which I worked around by a simple echo script giving out the correct version string - it doesn't build:
```
patch -Np1 -i ../rb.patch
# make sure GOPATH is set to writeable
chmod u+w -R "$GOPATH"
export CGO_LDFLAGS="$LDFLAGS"
export CGO_CFLAGS="$CFLAGS"
export CGO_CPPFLAGS="$CPPFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export GOFLAGS="-buildmode=pie -trimpath -modcacherw"
# dirty fix go1.18
sed -i -r 's,^go 1\.[0-9]+,go 1.18,' go.mod
go mod tidy
go mod vendor
make nofuse
```
With [rb.patch](https://raw.githubusercontent.com/archlinux/svntogit-community/feb2e1fc8ddccae7f4e366e2aa610bc03fb3b4e8/go-ipfs/repos/community-x86_64/rb.patch), see https://github.com/ipfs/go-ipfs/pull/8213#issuecomment-881866789.
Building with the normal go compiler works fine.
Contributor guide
Assessment
This issue has not been assessed yet.