[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#861878: nvidia-cuda-toolkit: nvcc needs to pass -fpie to compiler



Samuel Thibault, on ven. 05 mai 2017 11:59:19 +0200, wrote:
> Now that gcc has defaulted to building with pie, we're getting issues
> with the binaries produced by nvcc:
> 
> cc    -c -o test.o test.c
> nvcc -ccbin clang-3.8 -c test-cuda.cu -o test-cuda.o
> cc   test.o test-cuda.o  -lcudart -o test
> /usr/bin/ld: test-cuda.o: relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Nonrepresentable section on output

That said, it's the same issue with clang-3.8, see attached testcase:

cc    -c -o test.o test.c
clang-3.8  -c test-clang.c -o test-clang.o
cc   test.o test-clang.o   -o test
/usr/bin/ld: test-clang.o: relocation R_X86_64_32S against undefined symbol `x' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output

Samuel

Attachment: test2.tgz
Description: application/gtar-compressed


Reply to: