https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102469
Bug ID: 102469 Summary: gccgo: error: ‘copy’ defined as both imported name and global name, while golang does not produce this error Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: go Assignee: ian at airs dot com Reporter: dilyan.palauzov at aegee dot org CC: cmang at google dot com Target Milestone: --- I download the tip of https://github.com/containers/podman/ , commit b0d1c0fe22da27c88a0e5d . With `go version go1.16.5 gccgo (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1) linux/amd64` calling `make` the error is: ``` 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 With go version go1.16.8 linux/amd64 on the same system, calling `make` produces no warngis. Even when I replace `-ldflags` with `-gccgoflags` the signed/unsigned warning stays, and the `copy` error also stays. If golang does not emit “error: ‘copy’ defined as both imported name and global name”, gccgo shall neither.