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

#99: Only use CMAKE_POSITION_INDEPENDENT_CODE when building bindings #100

Conversation

cwschilly
Copy link
Contributor

Fixes #99

@pierrepebay
Copy link
Contributor

Looks good. Out of curiosity, what is the error when building the bindings without this option turned on?

@cwschilly
Copy link
Contributor Author

Looks good. Out of curiosity, what is the error when building the bindings without this option turned on?

@pierrepebay

[ 98%] Linking CXX shared module vttv.cpython-39-x86_64-linux-gnu.so
/usr/bin/ld: ../../lib/fmt/libfmt-vtd.a(format.cc.o): warning: relocation against `_ZTVN3fmt2vt12system_errorE' in read-only section `.text._ZN3fmt2vt12system_errorC2IJEEEiNS0_17basic_string_viewIcEEDpRKT_[_ZN3fmt2vt12system_errorC5IJEEEiNS0_17basic_string_viewIcEEDpRKT_]'
/usr/bin/ld: ../../src/libvt-tv.a(render.cc.o): relocation R_X86_64_PC32 against symbol `_ZN2vt2tv14compareObjectsERKSt4pairINS0_10ObjectWorkEmES5_' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [bindings/python/CMakeFiles/vttv.dir/build.make:142: bindings/python/vttv.cpython-39-x86_64-linux-gnu.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:1784: bindings/python/CMakeFiles/vttv.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

CMakeLists.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@nlslatt nlslatt left a comment

Choose a reason for hiding this comment

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

I'm not sure if there's another way to fix the link error, but this works at least for now.

@nlslatt nlslatt merged commit 23ac6ab into master Aug 5, 2024
6 checks passed
@cwschilly cwschilly deleted the 99-only-use-cmake_position_independent_code-when-building-bindings branch August 5, 2024 21:19
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

Successfully merging this pull request may close these issues.

Only use CMAKE_POSITION_INDEPENDENT_CODE when building bindings
3 participants