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

[irods/irods#7592] Fix centos 7 build against libstdc++ with new externals (4-3-stable) #478

Merged
merged 1 commit into from
May 13, 2024

Conversation

SwooshyCueb
Copy link
Member

4-3-stable version of #477

In service of irods/irods#7592

With the updated externals from irods/externals#246, building ierror, ienv, and ipwd against libstdc++ fails on Centos 7 with the following error:

/opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/../../../../bin/ld: /opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/libstdc++_nonshared.a(system_error48.o): undefined reference to symbol '__cxa_free_exception@@CXXABI_1.3'
/opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/../../../../bin/ld: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)

I'm not sure what changed to cause this to happen, but passing --no-as-needed to the linker fixes it.

This PR does not need to wait on any other PRs before being merged.

Copy link
Contributor

@alanking alanking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks identical.

Copy link
Collaborator

@korydraughn korydraughn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you land on --no-as-needed being the solution?

CMakeLists.txt Show resolved Hide resolved
@SwooshyCueb
Copy link
Member Author

How did you land on --no-as-needed being the solution?

The symbol that the linker was complaining about was one from libstdc++, which the clang frontend puts toward the end of the arguments passed to the linker. I figured the linker was getting confused and tossing away some component of libstdc++ it's not supposed to, and --no-as-needed was the logical choice to make it not do that.

@korydraughn
Copy link
Collaborator

Got it. Thanks.

Copy link
Collaborator

@korydraughn korydraughn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pound it.

Building ierror, ienv, and ipwd fails on Centos 7 with the following error:
```
/opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/../../../../bin/ld: /opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/libstdc++_nonshared.a(system_error48.o): undefined reference to symbol '__cxa_free_exception@@CXXABI_1.3'
/opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/../../../../bin/ld: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
```

I'm not sure what changed to cause this to happen, but passing --no-as-needed to the linker fixes it.
@SwooshyCueb
Copy link
Member Author

#'d

@alanking alanking merged commit b60328a into irods:4-3-stable May 13, 2024
1 check failed
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.

None yet

3 participants