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

binutils 2.28 causing "module <…> is already defined in <…>" errors with shared libraries #62

Open
mleise opened this issue Jul 6, 2017 · 2 comments

Comments

@mleise
Copy link
Collaborator

mleise commented Jul 6, 2017

We currently have two issues with the linkers in binutils. Since 2.27, the gold linker refuses to work with dmd, but that can be worked around by using ld.bfd (the default) or enabling the old COMDAT hack in DMD, which I'm considering as an option for those using gold to link.
Now with binutils 2.28 we face a new issue. The way the druntime scans shared libraries for modules got broken and you see the error message mentioned in the title when running a Dlang program that loads a DMD generated shared library. The bug report about that was first opened in May and as of now the answer is to compile all code with -fPIC.

For you reading this, it means to append -fPIC to the DFLAGS of the DMD versions you need to work with binutils 2.28. If you only have one, it is in /etc/dmd.conf, if you have multiple versions installed look into /etc/dmd/version.conf. I will change the ebuilds accordingly so that new installs of DMD have -fPIC already in their configuration. Stand by for updates.

@mleise
Copy link
Collaborator Author

mleise commented Jul 6, 2017

Updated the overlay with the -fPIC solution.

@mleise
Copy link
Collaborator Author

mleise commented Oct 2, 2017

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

No branches or pull requests

1 participant