[PATCH] D15596: Add -L/path/to/cuda/lib if any of our inputs are CUDA files.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 6 10:45:50 PST 2016


jlebar added inline comments.

================
Comment at: lib/Driver/ToolChains.cpp:4125
@@ +4124,3 @@
+                              ArgStringList &LDArgs) const {
+  if (DriverArgs.hasArg(options::OPT_nocudalib) || !CudaInstallation.isValid())
+    return;
----------------
tra wrote:
> I'd rename -nocudalib to -nocudalibdevice (or -nocudabclib) to better reflect what it currently does -- disables linking with CUDA's libdevice bitcode.
> 
> Then you could use -nocudalib to control automatic addition of CUDA library-related options which would be closer to what '-nostdlib' does.
> 
> While you're at it, you may consider adding linker flags to link with static libcudart. nvcc always adds "-lcudart_static  -lrt -lpthread  -ldl" at the end. If user explicitly requests linking with dynamic version of libcudart, then it gets linked first, and linker then ignores all the symbols from static lib.
> 
Sounds like a plan.  I'll send separate patches for each of these.


http://reviews.llvm.org/D15596





More information about the cfe-commits mailing list