]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp: Use HSA_RUNTIME_LIB, HSA_KMT_LIB in the testsuite
authorThomas Schwinge <thomas@codesourcery.com>
Tue, 2 Feb 2016 12:48:31 +0000 (13:48 +0100)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Tue, 2 Feb 2016 12:48:31 +0000 (13:48 +0100)
libgomp/
* plugin/configfrag.ac (HSA_KMT_LIB, HSA_KMT_LDFLAGS): New
variables.
* testsuite/libgomp-test-support.exp.in (hsa_runtime_lib)
(hsa_kmt_lib): Set variables.
* testsuite/lib/libgomp.exp (libgomp_init): Use them to amend
always_ld_library_path.
* Makefile.in: Regenerate.
* configure: Likewise.
* testsuite/Makefile.in: Likewise.

From-SVN: r233072

libgomp/ChangeLog
libgomp/Makefile.in
libgomp/configure
libgomp/plugin/configfrag.ac
libgomp/testsuite/Makefile.in
libgomp/testsuite/lib/libgomp.exp
libgomp/testsuite/libgomp-test-support.exp.in

index 6cae4d705da7443abf35f17565258845fb0491f8..806e23d642874734663c3cee3f692505081dbe53 100644 (file)
@@ -1,5 +1,15 @@
 2016-02-02  Thomas Schwinge  <thomas@codesourcery.com>
 
+       * plugin/configfrag.ac (HSA_KMT_LIB, HSA_KMT_LDFLAGS): New
+       variables.
+       * testsuite/libgomp-test-support.exp.in (hsa_runtime_lib)
+       (hsa_kmt_lib): Set variables.
+       * testsuite/lib/libgomp.exp (libgomp_init): Use them to amend
+       always_ld_library_path.
+       * Makefile.in: Regenerate.
+       * configure: Likewise.
+       * testsuite/Makefile.in: Likewise.
+
        * plugin/configfrag.ac (offload_additional_options)
        (offload_additional_lib_paths): Don't amend for hsa offloading.
        * configure: Regenerate.
index bbfac4e183f6e75023a9930d3b3931d03e305bd1..88c8517fddd6697cf99d1f271dde6047d41b6f3f 100644 (file)
@@ -268,6 +268,7 @@ FC = @FC@
 FCFLAGS = @FCFLAGS@
 FGREP = @FGREP@
 GREP = @GREP@
+HSA_KMT_LIB = @HSA_KMT_LIB@
 HSA_RUNTIME_INCLUDE = @HSA_RUNTIME_INCLUDE@
 HSA_RUNTIME_LIB = @HSA_RUNTIME_LIB@
 INSTALL = @INSTALL@
index f643bf8f67023b01638f4fbaccdd179d2529bf3e..8d03eb6cddce92e57e0b755a6cdce8a599ade488 100755 (executable)
@@ -637,6 +637,7 @@ PLUGIN_HSA_LIBS
 PLUGIN_HSA_LDFLAGS
 PLUGIN_HSA_CPPFLAGS
 PLUGIN_HSA
+HSA_KMT_LIB
 HSA_RUNTIME_LIB
 HSA_RUNTIME_INCLUDE
 PLUGIN_NVPTX_LIBS
@@ -11144,7 +11145,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11147 "configure"
+#line 11148 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11250,7 +11251,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11253 "configure"
+#line 11254 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -15292,6 +15293,9 @@ if test "x$HSA_RUNTIME_LIB" != x; then
   HSA_RUNTIME_LDFLAGS=-L$HSA_RUNTIME_LIB
 fi
 
+HSA_KMT_LIB=
+
+HSA_KMT_LDFLAGS=
 
 # Check whether --with-hsa-kmt-lib was given.
 if test "${with_hsa_kmt_lib+set}" = set; then :
@@ -15299,8 +15303,10 @@ if test "${with_hsa_kmt_lib+set}" = set; then :
 fi
 
 if test "x$with_hsa_kmt_lib" != x; then
-  HSA_RUNTIME_LDFLAGS="$HSA_RUNTIME_LDFLAGS -L$with_hsa_kmt_lib"
-  HSA_RUNTIME_LIB=
+  HSA_KMT_LIB=$with_hsa_kmt_lib
+fi
+if test "x$HSA_KMT_LIB" != x; then
+  HSA_KMT_LDFLAGS=-L$HSA_KMT_LIB
 fi
 
 PLUGIN_HSA=0
@@ -15378,7 +15384,7 @@ rm -f core conftest.err conftest.$ac_objext \
                tgt_name=hsa
                PLUGIN_HSA=$tgt
                PLUGIN_HSA_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS
-               PLUGIN_HSA_LDFLAGS=$HSA_RUNTIME_LDFLAGS
+               PLUGIN_HSA_LDFLAGS="$HSA_RUNTIME_LDFLAGS $HSA_KMT_LDFLAGS"
                PLUGIN_HSA_LIBS="-lhsa-runtime64 -lhsakmt"
 
                PLUGIN_HSA_save_CPPFLAGS=$CPPFLAGS
index b9209cb8c49b11819efcd7af84d2eaacc4218c37..88b4156188ebfaae5928945d3151aef0aa84fb45 100644 (file)
@@ -118,12 +118,17 @@ if test "x$HSA_RUNTIME_LIB" != x; then
   HSA_RUNTIME_LDFLAGS=-L$HSA_RUNTIME_LIB
 fi
 
+HSA_KMT_LIB=
+AC_SUBST(HSA_KMT_LIB)
+HSA_KMT_LDFLAGS=
 AC_ARG_WITH(hsa-kmt-lib,
        [AS_HELP_STRING([--with-hsa-kmt-lib=PATH],
                [specify directory for installed HSA KMT library.])])
 if test "x$with_hsa_kmt_lib" != x; then
-  HSA_RUNTIME_LDFLAGS="$HSA_RUNTIME_LDFLAGS -L$with_hsa_kmt_lib"
-  HSA_RUNTIME_LIB=
+  HSA_KMT_LIB=$with_hsa_kmt_lib
+fi
+if test "x$HSA_KMT_LIB" != x; then
+  HSA_KMT_LDFLAGS=-L$HSA_KMT_LIB
 fi
 
 PLUGIN_HSA=0
@@ -190,7 +195,7 @@ if test x"$enable_offload_targets" != x; then
                tgt_name=hsa
                PLUGIN_HSA=$tgt
                PLUGIN_HSA_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS
-               PLUGIN_HSA_LDFLAGS=$HSA_RUNTIME_LDFLAGS
+               PLUGIN_HSA_LDFLAGS="$HSA_RUNTIME_LDFLAGS $HSA_KMT_LDFLAGS"
                PLUGIN_HSA_LIBS="-lhsa-runtime64 -lhsakmt"
 
                PLUGIN_HSA_save_CPPFLAGS=$CPPFLAGS
index 1fae9e8cdcbe3677ab2b0fcff4f915cd886a9591..4dbb406545078e0cb6b5ac2c6e3973b3f7150cb1 100644 (file)
@@ -111,6 +111,7 @@ FC = @FC@
 FCFLAGS = @FCFLAGS@
 FGREP = @FGREP@
 GREP = @GREP@
+HSA_KMT_LIB = @HSA_KMT_LIB@
 HSA_RUNTIME_INCLUDE = @HSA_RUNTIME_INCLUDE@
 HSA_RUNTIME_LIB = @HSA_RUNTIME_LIB@
 INSTALL = @INSTALL@
index 6dc1e8ef3ca64dee857beac69a36c1c931397ff8..bb9b15f3a41ca59c318af81d119e89c07546bd01 100644 (file)
@@ -184,7 +184,7 @@ proc libgomp_init { args } {
     }
     lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
 
-    # For build-tree testing, also consider the CUDA paths used for builing.
+    # For build-tree testing, also consider the library paths used for builing.
     # For installed testing, we assume all that to be provided in the sysroot.
     if { $blddir != "" } {
        global cuda_driver_include
@@ -200,6 +200,14 @@ proc libgomp_init { args } {
            lappend ALWAYS_CFLAGS "additional_flags=-L$cuda_driver_lib"
            append always_ld_library_path ":$cuda_driver_lib"
        }
+       global hsa_runtime_lib
+       global hsa_kmt_lib
+       if { $hsa_runtime_lib != "" } {
+           append always_ld_library_path ":$hsa_runtime_lib"
+       }
+       if { $hsa_kmt_lib != "" } {
+           append always_ld_library_path ":$hsa_kmt_lib"
+       }
     }
 
     # We use atomic operations in the testcases to validate results.
index 764bec06c29edc5fd2d932e9dc9ffe5c713d7baf..5a724fb007a4676d6486205fb099d2b6173e1885 100644 (file)
@@ -1,4 +1,6 @@
 set cuda_driver_include "@CUDA_DRIVER_INCLUDE@"
 set cuda_driver_lib "@CUDA_DRIVER_LIB@"
+set hsa_runtime_lib "@HSA_RUNTIME_LIB@"
+set hsa_kmt_lib "@HSA_KMT_LIB@"
 
 set offload_targets "@offload_targets@"