glibc_version_header icon indicating copy to clipboard operation
glibc_version_header copied to clipboard

Error: No symbol version section for versioned symbol `sqrt@GLIBC_2.2.5'

Open robguinness opened this issue 6 years ago • 4 comments

Hi,

This is really a great effort, however, I couldn't manage to build Python using any of several versions of "force_link_glibc" that I tried. They all fail during make with this error message:

[  4%] Linking C shared library ../../../lib/python3.6/lib-dynload/audioop.so
/usr/bin/ld: ../../../lib/python3.6/lib-dynload/audioop.so: No symbol version section for versioned symbol `sqrt@GLIBC_2.2.5'
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
CMakeBuild/extensions/extension_audioop/CMakeFiles/extension_audioop.dir/build.make:94: recipe for target 'lib/python3.6/lib-dynload/audioop.so' failed
make[2]: *** [lib/python3.6/lib-dynload/audioop.so] Error 1
CMakeFiles/Makefile2:1426: recipe for target 'CMakeBuild/extensions/extension_audioop/CMakeFiles/extension_audioop.dir/all' failed
make[1]: *** [CMakeBuild/extensions/extension_audioop/CMakeFiles/extension_audioop.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: ../../../lib/python3.6/lib-dynload/_ctypes_test.so: No symbol version section for versioned symbol `sqrt@GLIBC_2.2.5'
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
CMakeBuild/extensions/extension_ctypes_test/CMakeFiles/extension_ctypes_test.dir/build.make:94: recipe for target 'lib/python3.6/lib-dynload/_ctypes_test.so' failed
make[2]: *** [lib/python3.6/lib-dynload/_ctypes_test.so] Error 1
CMakeFiles/Makefile2:2031: recipe for target 'CMakeBuild/extensions/extension_ctypes_test/CMakeFiles/extension_ctypes_test.dir/all' failed
make[1]: *** [CMakeBuild/extensions/extension_ctypes_test/CMakeFiles/extension_ctypes_test.dir/all] Error 2
[  5%] Linking C shared library ../../../lib/python3.6/lib-dynload/array.so
[  5%] Linking C shared library ../../../lib/python3.6/lib-dynload/_heapq.so
[  5%] Built target extension_codecs_jp
[  5%] Built target extension_array
[  5%] Built target extension_heapq
[  5%] Linking C shared library ../../../lib/python3.6/lib-dynload/_functools.so
[  5%] Built target extension_functools
[  5%] Linking C shared library ../../../lib/python3.6/lib-dynload/_csv.so
[  5%] Built target extension_csv
[  6%] Linking C shared library ../../../lib/python3.6/lib-dynload/itertools.so
[  6%] Linking C shared library ../../../lib/python3.6/lib-dynload/_json.so
[  6%] Built target extension_itertools
[  6%] Built target extension_json
[  6%] Linking C shared library ../../../lib/python3.6/lib-dynload/cmath.so
[  6%] Built target extension_cmath
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

I am using CMake as my build toolchain. It's very possible I'm doing something wrong because I'm fairly new to CMake as well.

robguinness avatar Apr 29 '19 14:04 robguinness

Hey, when you say you're using cmake as your build system, do you mean you're using a third party cmake build system for Python? I have actually tried a few of these and never got any to work to my satisfaction (missing "optional" modules, and just random issues with interop code). I actually originally created this repo to be used with a further project to create a package manager for c++ development tools, and as part of that I used it to build python, so you're in luck :D See here: https://github.com/wheybags/natup/blob/master/natup_pkg/packages/python.py

I'm planning to get back to the project when I have time, but for now I hope it can help you at least.

wheybags avatar May 03 '19 19:05 wheybags

I meant that I was using the version of CMake distributed by my linux distribution (Ubuntu official repositories). Thanks for sharing your Python build example written in Python. ;-) I will give that a try.

robguinness avatar May 08 '19 08:05 robguinness

I'm getting this same error for a much simpler C library: https://github.com/shirakumo/libfond

Generating header for /home/linus/Projects/c/libfond/src/shader/to_texture.frag
Generating header for /home/linus/Projects/c/libfond/src/shader/to_texture.vert
[  0%] Built target shaders
Scanning dependencies of target fond
[ 14%] Building C object CMakeFiles/fond.dir/src/fond.c.o
[ 28%] Building C object CMakeFiles/fond.dir/src/fond_buffer.c.o
[ 42%] Building C object CMakeFiles/fond.dir/src/fond_common.c.o
[ 57%] Building C object CMakeFiles/fond.dir/src/fond_windows.c.o
[ 71%] Linking C shared library libfond.so
/usr/bin/ld: libfond.so: no symbol version section for versioned symbol `sqrtf@GLIBC_2.2.5'
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/fond.dir/build.make:131: libfond.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:80: CMakeFiles/fond.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Shinmera avatar Mar 05 '20 10:03 Shinmera

I had this error (or one very much like it), but found that putting the "-l" options (and the "-pthread" option if used) after anything I was compiling fixed the problem. i.e.:

broken: gcc -lm -pthread -o mylib.so filea.o, fileb.o working: gcc -o mylib.so filea.o fileb.o -lm -pthread

Hope this helps!

half-monkey avatar Oct 06 '21 13:10 half-monkey