You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I update the OpenCL SDK and build into an existing build directory I get a link error:
[ 74%] Linking CXX shared library libOpenCLSDKCpp.so
/usr/bin/ld: libsfml-system-s.a(Err.cpp.o): warning: relocation against `_ZTVSt9basic_iosIcSt11char_traitsIcEE@@GLIBCXX_3.4' in read-only section `.text.unlikely'
/usr/bin/ld: libsfml-window-s.a(Window.cpp.o): relocation R_X86_64_PC32 against symbol `_ZNKSt5ctypeIcE8do_widenEc' 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
Removing everything in the build directory and starting fresh does seem to "fix" the build, but this also redownloads all dependencies, etc, so it's a fairly big hammer. I think it would be better to build at least the OpenCL SDK static libraries with position independent code, instead.
For now, I've added this to the top of my OpenCL SDK CMakeLists.txt, and it seems to be working for me:
set(CMAKE_POSITION_INDEPENDENT_CODEON)
We could be more selective if we choose to, though, and instead enable position independent code for specific targets:
Whenever I update the OpenCL SDK and build into an existing build directory I get a link error:
Removing everything in the build directory and starting fresh does seem to "fix" the build, but this also redownloads all dependencies, etc, so it's a fairly big hammer. I think it would be better to build at least the OpenCL SDK static libraries with position independent code, instead.
For now, I've added this to the top of my OpenCL SDK CMakeLists.txt, and it seems to be working for me:
We could be more selective if we choose to, though, and instead enable position independent code for specific targets:
The text was updated successfully, but these errors were encountered: