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

Samuel Thibault sthibault at debian.org
Fri May 5 12:47:30 UTC 2017


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2.tgz
Type: application/x-gtar-compressed
Size: 587 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-llvm-team/attachments/20170505/d0588626/attachment.tgz>


More information about the Pkg-llvm-team mailing list