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

go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags #11715

Closed
dilyanpalauzov opened this issue Sep 23, 2021 · 1 comment · Fixed by #11716
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@dilyanpalauzov
Copy link
Contributor

With gccgo, calling make produces:

CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
        -mod=vendor  \
        -ldflags '-X github.com/containers/podman/v3/libpod/define.gitCommit=b0d1c0fe22da27c88a0e5de11de08d63ef861347 -X github.com/containers/podman/v3/libpod/define.buildInfo=1632396554 -X github.com/containers/podman/v3/libpod/config._installPrefix=/usr/local -X github.com/containers/podman/v3/libpod/config._etcDir=/usr/local/etc ' \
        -tags " exclude_graphdriver_btrfs btrfs_noversion selinux systemd  exclude_graphdriver_devicemapper seccomp" \
        -o bin/podman ./cmd/podman
go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
# github.com/containers/storage/pkg/unshare
unshare.c: In function ‘parse_proc_stringlist’:
unshare.c:137:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  137 |         for (n = 0; n < used; n++) {
      |                       ^
unshare.c:148:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  148 |         for (n = 0; n < used; n++) {
      |                       ^
# github.com/containers/podman/v3/libpod
libpod/options.go:81:33: error: ‘copy’ defined as both imported name and global name
   81 |                                 copy(rt.storageConfig.GraphDriverOptions, config.GraphDriverOptions)
      |                                 ^
libpod/container_stat_linux.go:13:49: note: ‘copy’ imported here
   13 |         "github.com/containers/podman/v3/pkg/copy"
      |                                                 ^
make: *** [Makefile:300: bin/podman] Error 2

I would say, the first error is that -ldflags shall be replaced with -gccgoflags

@rhatdan
Copy link
Member

rhatdan commented Sep 23, 2021

Please open a PR to fix.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants