element-hq / element-hq/dendrite
Dendrite fails to build with -flto
- Dominant language
- Go
- Stars
- 965
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
*This issue was originally created by [**@Richard-Rogalski**](https://github.com/Richard-Rogalski) at .*
### Background information
- **Dendrite version or git SHA**: 0.12.0
- **SQLite3 or Postgres?**: not built yet
- **Running in Docker?**: no
- **`go version`**: `go version go1.20.2 linux/ppc64le`, `go version go1.19.6 linux/amd64`
### Description
Dendrite fails to build when `-flto` is present in `CGO_CFLAGS`. It can be reproduced with the following command: `CGO_ENABLED=1 CGO_CFLAGS="-O3 -flto -mcpu=native" CGO_CXXFLAGS="${CGO_CFLAGS}" ./build.sh`. Removing `-flto` results in a successful build.
Contributor guide
Research direction
Start with ./build.sh and reproduce the failure using CGO_ENABLED=1, CGO_CFLAGS="-O3 -flto -mcpu=native", and matching CGO_CXXFLAGS on the reported Go and Linux environments. Trace why -flto prevents the build, then verify that ./build.sh succeeds with the flags still present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100