We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Steps to reproduce:
$ sudo docker run -v /path/to/mold/install:/root/prefix --rm -it --net host centos:7 /bin/bash # Install dependencies $ yum install gcc-c++ python3-devel -y # Source code for python3 module $ cat <<EOF > Py_module.cc #include <Python.h> static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, /* m_base */ "pycore", /* m_name */ nullptr, /* m_doc */ -1, /* m_size */ nullptr, /* m_methods */ nullptr, /* m_slots */ nullptr, /* m_traverse */ nullptr, /* m_clear */ nullptr /* m_free */ }; PyMODINIT_FUNC PyInit_pycore(void) { PyObject* module = PyModule_Create(&moduledef); if (module == nullptr) { return nullptr; } return module; } EOF # Compile the object file $ g++ -I/usr/include/python3.6m -fPIC -std=c++11 -o pycore.o -c Py_module.cc # Generate shared library using mold $ g++ -B$PWD/prefix/bin -shared -Wl,-soname,pycore.so -o pycore.so pycore.o $ readelf -p .comment pycore.so String dump of section '.comment': [ 0] mold 0.9.6 (06c237838c9bde07820f0ad38c5421536dad4701; compatible with GNU ld and GNU gold) [ 5b] GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-44) # Try to import it (fails!) $ python3 Python 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pycore Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /pycore.so: undefined symbol: libstdc++.so.6 # Link and import it without mold (success!) $ g++ -shared -Wl,-soname,pycore.so -o pycore.so pycore.o $ python3 Python 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pycore >>> # Link again with mold, import with python2 just for fun (better error) $ g++ -B$PWD/prefix/bin -shared -Wl,-soname,pycore.so -o pycore.so pycore.o $ python Python 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pycore Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: ./pycore.so: unexpected reloc type 0x00020001 >>> # Version of ld.so $ rpm -qf /lib64/ld-linux-x86-64.so.2 glibc-2.17-324.el7_9.x86_64
The text was updated successfully, but these errors were encountered:
Attaching statically linked mold (for use on glibc2.12+ , kernel 2.6.32+) for convenience: mold.gz
Sorry, something went wrong.
Thank you for your report! It looks dlopen() fails with any mold-generated shared object files on CentOS 7. Investigating...
ffb8e03
I believe the above change fixed the issue. Could you verify?
Verified. Thank you for the prompt fix!
No branches or pull requests
Steps to reproduce:
The text was updated successfully, but these errors were encountered: