Skip to content

4.0.0 can not be built with LTO #13297

@dvzrv

Description

@dvzrv

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Hi! I'm currently trying to build 4.0.0 as a package for Arch Linux. We have switched to LTO by default (can be switched off per package) over the past months. Unfortunately podman does not seem to be compatible with that:

# github.com/containers/podman/v4/cmd/rootlessport
_cgo_callers: relocation target x_cgo_callers not defined
_cgo_init: relocation target x_cgo_init not defined
_cgo_mmap: relocation target x_cgo_mmap not defined
_cgo_munmap: relocation target x_cgo_munmap not defined
_cgo_notify_runtime_init_done: relocation target x_cgo_notify_runtime_init_done not defined
_cgo_sigaction: relocation target x_cgo_sigaction not defined
_cgo_thread_start: relocation target x_cgo_thread_start not defined
net._cgo_3c1cec0c9a4e_C2func_getaddrinfo: relocation target _cgo_3c1cec0c9a4e_C2func_getaddrinfo not defined
net._cgo_3c1cec0c9a4e_Cfunc_freeaddrinfo: relocation target _cgo_3c1cec0c9a4e_Cfunc_freeaddrinfo not defined
net._cgo_3c1cec0c9a4e_Cfunc_gai_strerror: relocation target _cgo_3c1cec0c9a4e_Cfunc_gai_strerror not defined
runtime._cgo_setenv: relocation target x_cgo_setenv not defined
runtime._cgo_unsetenv: relocation target x_cgo_unsetenv not defined
runtime.cgo_yield: relocation target _cgo_yield not defined
.rela: relocation target _cgo_3c1cec0c9a4e_C2func_getaddrinfo not defined
.rela: relocation target _cgo_3c1cec0c9a4e_Cfunc_freeaddrinfo not defined
.rela: relocation target _cgo_3c1cec0c9a4e_Cfunc_gai_strerror not defined
.rela: relocation target _cgo_yield not defined
.rela: relocation target x_cgo_setenv not defined
.rela: relocation target x_cgo_unsetenv not defined
.rela: relocation target x_cgo_init not defined
.rela: relocation target x_cgo_thread_start not defined
/usr/lib/go/pkg/tool/linux_amd64/link: too many errors
unexpected fault address 0x66a19906f000
fatal error: fault

Full build log: podman-4.0.0-build.log

Steps to reproduce the issue:

  export BUILDTAGS='apparmor seccomp systemd'
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath"

  make EXTRA_LDFLAGS='-s -w -linkmode=external'

Here CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS represent our distribution wide build flags (through which LTO is introduced into the build).

Describe the results you received:

The build fails.

Describe the results you expected:

The build succeeds

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

4.0.0

Output of podman info --debug:

n/a

Package info (e.g. output of rpm -q podman or apt list podman):

n/a

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.): Package build context for Arch Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions