hughperkins / coriander

Build NVIDIA® CUDA™ code for OpenCL™ 1.2 devices
Apache License 2.0
840 stars 88 forks source link

when run "make -j 8 tests", something went wrong,seems like the "PIE object" problem. #101

Open SpeitzerPatrick opened 3 years ago

SpeitzerPatrick commented 3 years ago

[ 2%] Built target cocl_gtest [ 2%] Built target clew [ 8%] Built target easycl [ 13%] Built target patch_hostside [ 50%] Built target cocl [ 55%] Linking CXX executable test_char [ 55%] Linking CXX executable longname [ 55%] Linking CXX executable test_floatstarstar [ 55%] Linking CXX executable testpartialcopy [ 55%] Linking CXX executable test_ZeroCudaMalloc [ 56%] Linking CXX executable test_devices [ 57%] Linking CXX executable test_types [ 58%] Linking CXX executable test_bitcast /usr/bin/ld: test_types.d/test_types.cu.o: relocation R_X86_64_32 against symbol _ZSt4cout@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[3]: *** [test/endtoend/CMakeFiles/test_types.dir/build.make:223:test/endtoend/test_types] 错误 1 make[2]: *** [CMakeFiles/Makefile2:1196:test/endtoend/CMakeFiles/test_types.dir/all] 错误 2 make[2]: *** 正在等待未完成的任务.... /usr/bin/ld: test_char.d/test_char.cu.o: relocation R_X86_64_32 against symbols_devicell_sourcecodetest_char.d/test_char-device.llZ8setValuePcic' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[3]: [test/endtoend/CMakeFiles/test_char.dir/build.make:223:test/endtoend/test_char] 错误 1 make[2]: [CMakeFiles/Makefile2:827:test/endtoend/CMakeFiles/test_char.dir/all] 错误 2 /usr/bin/ld: test_ZeroCudaMalloc.d/test_ZeroCudaMalloc.cu.o: relocation R_X86_64_32 against symbol _ZSt4cout@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[3]: *** [test/endtoend/CMakeFiles/test_ZeroCudaMalloc.dir/build.make:223:test/endtoend/test_ZeroCudaMalloc] 错误 1 make[2]: *** [CMakeFiles/Makefile2:627:test/endtoend/CMakeFiles/test_ZeroCudaMalloc.dir/all] 错误 2 /usr/bin/ld: test_floatstarstar.d/test_floatstarstar.cu.o: relocation R_X86_64_32 against symbols_devicell_sourcecodetest_floatstarstar.d/test_floatstarstar-device.llZ4wipePii' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status /usr/bin/ld: testpartialcopy.d/testpartialcopy.cu.o: relocation R_X86_64_32 against symbol _ZSt4cout@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[3]: *** [test/endtoend/CMakeFiles/test_floatstarstar.dir/build.make:223:test/endtoend/test_floatstarstar] 错误 1 make[2]: *** [CMakeFiles/Makefile2:685:test/endtoend/CMakeFiles/test_floatstarstar.dir/all] 错误 2 make[3]: *** [test/endtoend/CMakeFiles/testpartialcopy.dir/build.make:223:test/endtoend/testpartialcopy] 错误 1 make[2]: *** [CMakeFiles/Makefile2:3261:test/endtoend/CMakeFiles/testpartialcopy.dir/all] 错误 2 /usr/bin/ld: longname.d/longname.cu.o: relocation R_X86_64_32 against symbols_devicell_sourcecodelongname.d/longname-device.llZ46setValueSomestupidlylongnamefoobarfoobarfoobarPfif' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status /usr/bin/ld: test_devices.d/test_devices.cu.o: relocation R_X86_64_32 against symbol _ZSt4cout@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status /usr/bin/ld: test_bitcast.d/test_bitcast.cu.o: relocation R_X86_64_32 against symbols_devicell_sourcecodetest_bitcast.d/test_bitcast-device.llZ8mykernelPiPfS_' can not be used when making a PIE object; recompile withmake[3]: [test/endtoend/CMakeFiles/longname.dir/build.make:223:test/endtoend/longname] 错误 1 -fPIE collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/Makefile2:885:test/endtoend/CMakeFiles/longname.dir/all] 错误 2 make[3]: [test/endtoend/CMakeFiles/test_devices.dir/build.make:223:test/endtoend/test_devices] 错误 1 make[2]: [CMakeFiles/Makefile2:1026:test/endtoend/CMakeFiles/test_devices.dir/all] 错误 2 make[3]: [test/endtoend/CMakeFiles/test_bitcast.dir/build.make:223:test/endtoend/test_bitcast] 错误 1 make[2]: [CMakeFiles/Makefile2:1281:test/endtoend/CMakeFiles/test_bitcast.dir/all] 错误 2 make[1]: [CMakeFiles/Makefile2:348:CMakeFiles/tests.dir/rule] 错误 2 make: [Makefile:216:tests] 错误 2

hughperkins commented 2 years ago

Might need -fPIE for any C/C++ compilations.

For any compilation of hostside LLVM IR (.ll file), you might need to use --relocation-model=pic.

Aciole-David commented 2 years ago

Similar issue here: What shoul I do to proceed with the install?

[ 1%] Built target clew [ 2%] Built target cocl_gtest [ 8%] Built target easycl [ 13%] Built target patch_hostside [ 50%] Built target cocl [ 51%] Linking CXX executable test_ZeroCudaMalloc [ 55%] Linking CXX executable test_floatstarstar [ 55%] Linking CXX executable test_char [ 55%] Linking CXX executable testpartialcopy [ 55%] Linking CXX executable longname [ 56%] Linking CXX executable test_devices [ 57%] Linking CXX executable test_bitcast [ 58%] Linking CXX executable test_types [ 59%] Linking CXX executable test_structs [ 59%] Linking CXX executable test_buffers [ 59%] Linking CXX executable testshfl [ 59%] Linking CXX executable test_callbacks /usr/bin/ld: test_types.d/test_types.cu.o: relocation R_X86_64_32 against symbol _ZSt4cout@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[3]: *** [test/endtoend/CMakeFiles/test_types.dir/build.make:223: test/endtoend/test_types] Error 1 make[2]: *** [CMakeFiles/Makefile2:1196: test/endtoend/CMakeFiles/test_types.dir/all] Error 2 make[2]: *** Waiting for unfinished jobs.... /usr/bin/ld: test_ZeroCudaMalloc.d/test_ZeroCudaMalloc.cu.o: relocation R_X86_64_32 against symbol_ZSt4cout@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[3]: [test/endtoend/CMakeFiles/test_ZeroCudaMalloc.dir/build.make:223: test/endtoend/test_ZeroCudaMalloc] Error 1 make[2]: [CMakeFiles/Makefile2:627: test/endtoend/CMakeFiles/test_ZeroCudaMalloc.dir/all] Error 2 /usr/bin/ld: test_callbacks.d/test_callbacks.cu.o: relocation R_X86_64_32 against symbol s___devicell_sourcecodetest_callbacks.d/test_callbacks-device.ll__Z10longKernelPfif' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status /usr/bin/ld: testshfl.d/testshfl.cu.o: relocation R_X86_64_32 against symbols_devicell_sourcecodetestshfl.d/testshfl-device.llZ8getValuePf' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[3]: [test/endtoend/CMakeFiles/test_callbacks.dir/build.make:223: test/endtoend/test_callbacks] Error 1 make[2]: [CMakeFiles/Makefile2:1422: test/endtoend/CMakeFiles/test_callbacks.dir/all] Error 2 make[3]: [test/endtoend/CMakeFiles/testshfl.dir/build.make:223: test/endtoend/testshfl] Error 1 /usr/bin/ld: test_floatstarstar.d/test_floatstarstar.cu.o: relocation R_X86_64_32 against symbol `s_devicell_sourcecodetest_floatstarstar.d/test_floatstarstar-device.llZ4wipePii' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/Makefile2:1478: test/endtoend/CMakeFiles/testshfl.dir/all] Error 2 /usr/bin/ld: test_buffers.d/test_buffers.cu.o: relocation R_X86_64_32 against symbol s___devicell_sourcecodetest_buffers.d/test_buffers-device.ll__Z8mykernelPfS_S_S_S_' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[3]: *** [test/endtoend/CMakeFiles/test_floatstarstar.dir/build.make:223: test/endtoend/test_floatstarstar] Error 1 make[2]: *** [CMakeFiles/Makefile2:685: test/endtoend/CMakeFiles/test_floatstarstar.dir/all] Error 2 make[3]: *** [test/endtoend/CMakeFiles/test_buffers.dir/build.make:223: test/endtoend/test_buffers] Error 1 make[2]: *** [CMakeFiles/Makefile2:1619: test/endtoend/CMakeFiles/test_buffers.dir/all] Error 2 /usr/bin/ld: test_devices.d/test_devices.cu.o: relocation R_X86_64_32 against symbol_ZSt4cout@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status /usr/bin/ld: longname.d/longname.cu.o: relocation R_X86_64_32 against symbol s___devicell_sourcecodelongname.d/longname/-device.ll__Z46setValueSomestupidlylongnamefoobarfoobarfoobarPfif' can not be usrused /whenbin /making a PIEld: test_bitcast.d/test_bitcast.cu.o: relocation R_X86_64_32 against object; recompile with -fPIE symbols_devicell_sourcecodetest_bitcast.d/test_bitcast collect2: error: ld returned 1 exit status -device.llZ8mykernelPiPfS_' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[3]: [test/endtoend/CMakeFiles/test_devices.dir/build.make:223: test/endtoend/test_devices] Error 1 make[2]: [CMakeFiles/Makefile2:1026: test/endtoend/CMakeFiles/test_devices.dir/all] Error 2 make[3]: [test/endtoend/CMakeFiles/longname.dir/build.make:223: test/endtoend/longname] Error 1 make[2]: [CMakeFiles/Makefile2:885: test/endtoend/CMakeFiles/longname.dir/all] Error 2 make[3]: [test/endtoend/CMakeFiles/test_bitcast.dir/build.make:223: test/endtoend/test_bitcast] Error 1 make[2]: [CMakeFiles/Makefile2:1281: test/endtoend/CMakeFiles/test_bitcast.dir/all] Error 2 /usr/bin/ld: test_structs.d/test_structs.cu.o: relocation R_X86_64_32 against symbol s___devicell_sourcecodetest_structs.d/test_structs-device.ll__Z14struct_byvalue16Struct_fp_fp_f_fPf' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[3]: *** [test/endtoend/CMakeFiles/test_structs.dir/build.make:223: test/endtoend/test_structs] Error 1 make[2]: *** [CMakeFiles/Makefile2:1310: test/endtoend/CMakeFiles/test_structs.dir/all] Error 2 /usr/bin/ld: test_char.d/test_char.cu.o: relocation R_X86_64_32 against symbols_devicell_sourcecodetest_char.d/test_char-device.llZ8setValuePcic' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status /usr/bin/ld: testpartialcopy.d/testpartialcopy.cu.o: relocation R_X86_64_32 against symbol `_ZSt4cout@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE make[3]: [test/endtoend/CMakeFiles/test_char.dir/build.make:223: test/endtoend/test_char] Error 1 collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/Makefile2:827: test/endtoend/CMakeFiles/test_char.dir/all] Error 2 make[3]: [test/endtoend/CMakeFiles/testpartialcopy.dir/build.make:223: test/endtoend/testpartialcopy] Error 1 make[2]: [CMakeFiles/Makefile2:3261: test/endtoend/CMakeFiles/testpartialcopy.dir/all] Error 2 make[1]: [CMakeFiles/Makefile2:348: CMakeFiles/tests.dir/rule] Error 2 make: [Makefile:216: tests] Error 2

Aciole-David commented 2 years ago

I'm trying this in an AMD machine. If that helps. Any guess, @hughperkins ?

Gitkingly commented 1 year ago

I have a similar issue but prompted "recompile with -fPIC": /usr/bin/ld: context.d/context.cu.o: relocation R_X86_64_32 against symbol `s_devicell_sourcecodecontext.d/context-device.llZ8getValuePf' can not be used when making a PIE object; recompile with -fPIC

engineer1109 commented 1 year ago

same issue