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
Static linking against libstdc++ in Binary Build mode #2113
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? Specifically the change to setup.py to add libstdc++.a to the extra_link_args
.
I was reading:
https://stackoverflow.com/questions/13636513/linking-libstdc-statically-any-gotchas
It sounds like this missing symbols might have to do with dlopen
or other C++ libraries we link dynamically against. I'm a little surprised that adding the libstdc++.a
to extra_link_args
would fix this, but if it works we should do it.
We could also bundle libstdc++.so
and add it to the RPATH
like we do for other libraries.
setup.py
Outdated
# get path of libstdc++ and link manually. | ||
# for reasons unknown, -static-libstdc++ doesn't fully link some symbols | ||
CXXNAME = 'g++' | ||
if os.getenv('CXX'): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
setup.py
Outdated
CXXNAME = 'g++' | ||
if os.getenv('CXX'): | ||
CXXNAME = os.getenv('CXX') | ||
path = subprocess.check_output([CXXNAME, '-print-file-name=libstdc++.a']) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
shipping
No, this was a multi-day investigation and I still haven't concluded the exact cause, but this is the commit that introduced the regression where By stopped working, I mean: compiled with linker flag The commit adds usage of
From reading a bunch of stuff online, it seems like the only problematic issues with |
Don't we also need to link with |
@apaszke, do you mean See https://www.python.org/dev/peps/pep-0513/#versioning-of-core-shared-libraries for why they chose not to statically link |
No I meant |
i've checked on the libgcc thing empirically. We dont need it for now atleast. |
merged into master |
needed to ship binaries