https://llvm.org/bugs/show_bug.cgi?id=31224

            Bug ID: 31224
           Summary: lld produces broken executable with CUDA
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedb...@nondot.org
          Reporter: ism...@i10z.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

Created attachment 17694
  --> https://llvm.org/bugs/attachment.cgi?id=17694&action=edit
Crashing executable

havana ~/Downloads > clang-4.0 -v
openSUSE Linux clang version 4.0.0 (trunk 288322) (based on LLVM 4.0.0svn)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /suse/idoenmez/bin
Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/6
Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/6
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

> /opt/clang/bin/clang++ --cuda-gpu-arch=sm_50 --cuda-path=/havana/cuda-8.0 
> axpy.cu -fuse-ld=lld -L/havana/cuda-8.0/lib64 -lcudart_static -ldl -lrt 
> -pthread -Wl,-rpath,/opt/clang/lib64 -Wl,-rpath,/havana/cuda-8.0/lib64

> ./a.out
zsh: segmentation fault (core dumped)  ./a.out

Same works with gold (or bfd too):

> /opt/clang/bin/clang++ --cuda-gpu-arch=sm_50 --cuda-path=/havana/cuda-8.0 
> axpy.cu -fuse-ld=gold -L/havana/cuda-8.0/lib64 -lcudart_static -ldl -lrt 
> -pthread -Wl,-rpath,/opt/clang/lib64 -Wl,-rpath,/havana/cuda-8.0/lib64
> ./a.out             
y[0] = 2
y[1] = 4
y[2] = 6
y[3] = 8

Attached is the produced binary.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to