nvidia-cuda-toolkit: nvcc needs to pass -fpie to compiler

Lumin cdluminate at gmail.com
Sun May 7 02:29:46 UTC 2017


Hi Samuel,

I'm not sure whether this bug should be marked as serious. Since your test
cases are mixing the default cc (GCC-6) and clang-3.8 together.

I reproduced the failure you reported, but there is a simpler solution
to the issue
as shown below.

test$ CC=clang-3.8 make
clang-3.8    -c -o test.o test.c
nvcc -ccbin clang-3.8 -c test-cuda.cu -o test-cuda.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecat
ed, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to s
uppress warning).
clang-3.8   test.o test-cuda.o  -lcudart -o test

test2$ CC=clang-3.8 make
clang-3.8    -c -o test.o test.c
clang-3.8  -c test-clang.c -o test-clang.o
clang-3.8   test.o test-clang.o   -o test

Maybe this is a bug about GCC's linking process on a set of GCC-6 and
clang-3.8 produced objects. I did further test on your test2.tgz,
swapping GCC-6 and clang-3.8:

test2$ cat Makefile
CLANG=cc
[...]
test2$ CC=clang-3.8 make
clang-3.8    -c -o test.o test.c
cc  -c test-clang.c -o test-clang.o
clang-3.8   test.o test-clang.o   -o test

Clang-3.8 is able to link a set of mixed object files while GCC-6
fails to do so. I guess
this bug is a GCC-6 bug and not related to CUDA?

On the other hand, for instance, cuda application package
"caffe-contrib" was thoroughly
and finely compiled by clang-3.8 .

Best,



More information about the Pkg-llvm-team mailing list