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

Fix build error on sparc64 caused by using the gold linker #4255

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

gibmat
Copy link
Contributor

@gibmat gibmat commented Jan 10, 2023

When building on a sparc64 machine running Debian sid with gcc 12.2.0, linking fails with the following error:

collect2: fatal error: ld terminated with signal 10 [Bus error] (build log)

It appears to be caused by using the gold linker, although I'm not exactly sure why. None of the other Linux-based Debian architectures exhibit this issue with the gold linker.

I made the proposed change and tested it on one of the GCC Compile Farm sparc64 machines (gcc202), which was then able to successfully compile lxc.

Signed-off-by: Mathias Gibbens <gibmat@debian.org>
@lxc-jenkins
Copy link

This pull request didn't trigger Jenkins as its author isn't in the allow list.

An organization member must perform one of the following:

  • To have this branch tested by Jenkins, use the "ok to test" command.
  • To have a one time test done, use the "test this please" command.

Those commands are simple Github comments of the format: "jenkins: COMMAND"

@stgraber stgraber merged commit a1874c8 into lxc:master Jan 11, 2023
@gibmat gibmat deleted the fix-sparc64-link-error branch January 11, 2023 01:10
@gibmat
Copy link
Contributor Author

gibmat commented Jan 12, 2023

@stgraber I'm not sure where your comment went, as I got the email notification but when I click the link to reply it doesn't show up. So, I'll quote it here and reply below:

@gibmat so your change is actually breaking our own builds now:
https://launchpadlibrarian.net/645662600/buildlog_snap_ubuntu_focal_ppc64el_lxd-latest-edge_BUILDING.txt.gz

Any idea of what to do to make everyone happy?

The only thing I can think of is that the order of the flags is now slightly different:

-Wl,-z,now -Wl,-fuse-ld=gold -fstack-protector -fstack-protector-strong -Wl,--warn-common

vs

-Wl,-z,now -fstack-protector -fstack-protector-strong -Wl,-fuse-ld=gold -Wl,--warn-common

Other than that there shouldn't be any difference for any architectures other than sparc64. Locally I also did an amd64 build with those changes prior to submitting the pull request, but didn't test other architectures.

I'm not very familiar with meson; is there some sort of list.remove(item) that might be used to remove the gold linker flag conditionally just for sparc64?

@stgraber
Copy link
Member

I deleted the comment almost immediately because we were dealing with ppc64el and not sparc64 so couldn't have been your change. In the end, it was a linker bug. A simple rebuild got us past it.

@gibmat
Copy link
Contributor Author

gibmat commented Jan 13, 2023

😌 Phew -- not my fault! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants