This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[nvptx-tools, committed 2/2] Don't link the assembler and linker against CUDA libraries.


..., because that's not needed.
---
 tools/Makefile.in  | 2 +-
 tools/configure    | 4 +---
 tools/configure.ac | 6 ++----
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git tools/Makefile.in tools/Makefile.in
index f007b83..2886fe6 100644
--- tools/Makefile.in
+++ tools/Makefile.in
@@ -36,7 +36,7 @@ nvptx-none-as: $(srcdir)/nvptx-as.c
 nvptx-none-run: $(srcdir)/nvptx-run.c
 	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -I$(srcdir)/../include \
 		$< -o $@ \
-		-L ../libiberty -liberty $(LDFLAGS) $(LIBS)
+		-L ../libiberty -liberty $(LDFLAGS) $(LIBS) -lcuda -lcudart
 
 .PHONY: install
 
diff --git tools/configure tools/configure
index 7295da1..0f77626 100755
--- tools/configure
+++ tools/configure
@@ -3133,7 +3133,6 @@ fi
 if test "x$with_cuda_driver_lib" != x; then
   CUDA_DRIVER_LDFLAGS="-L$with_cuda_driver_lib"
 fi
-LIBS="$LIBS -lcuda"
 
 CXXFLAGS="$CXXFLAGS $CUDA_DRIVER_CPPFLAGS"
 LDFLAGS="$LDFLAGS $CUDA_DRIVER_LDFLAGS"
@@ -3146,7 +3145,7 @@ CFLAGS="$CUDA_DRIVER_CPPFLAGS $CFLAGS"
 cudart_save_LDFLAGS=$LDFLAGS
 LDFLAGS="$CUDA_DRIVER_LDFLAGS $LDFLAGS"
 cudart_save_LIBS=$LIBS
-LIBS="$LIBS -lcudart"
+LIBS="$LIBS -lcuda -lcudart"
 
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -3163,7 +3162,6 @@ const char *p; CUresult r; cuGetErrorString (r, &p); cudaDeviceReset ();
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   NVPTX_RUN=nvptx-none-run
-cudart_save_LIBS="$LIBS"
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
diff --git tools/configure.ac tools/configure.ac
index f871a70..35e8607 100644
--- tools/configure.ac
+++ tools/configure.ac
@@ -36,7 +36,6 @@ fi
 if test "x$with_cuda_driver_lib" != x; then
   CUDA_DRIVER_LDFLAGS="-L$with_cuda_driver_lib"
 fi
-LIBS="$LIBS -lcuda"
 
 CXXFLAGS="$CXXFLAGS $CUDA_DRIVER_CPPFLAGS"
 LDFLAGS="$LDFLAGS $CUDA_DRIVER_LDFLAGS"
@@ -48,14 +47,13 @@ CFLAGS="$CUDA_DRIVER_CPPFLAGS $CFLAGS"
 cudart_save_LDFLAGS=$LDFLAGS
 LDFLAGS="$CUDA_DRIVER_LDFLAGS $LDFLAGS"
 cudart_save_LIBS=$LIBS
-LIBS="$LIBS -lcudart"
+LIBS="$LIBS -lcuda -lcudart"
 AC_LINK_IFELSE([AC_LANG_PROGRAM(
 [#include "cuda.h"
 #include <cuda_runtime.h>
 ],
 [const char *p; CUresult r; cuGetErrorString (r, &p); cudaDeviceReset (); ])],
-[NVPTX_RUN=nvptx-none-run
-cudart_save_LIBS="$LIBS"])
+[NVPTX_RUN=nvptx-none-run])
 AC_MSG_RESULT($NVPTX_RUN)
 
 CFLAGS=$cudart_save_CFLAGS
-- 
1.8.1.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]