public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Refactor '-ldl' handling for libgomp proper and plugins
@ 2022-05-12 12:39 Thomas Schwinge
  2022-05-12 12:42 ` Jakub Jelinek
  2022-05-13 12:05 ` libgomp nvptx plugin: Only consider '--with-cuda-driver=[...]' when applicable Thomas Schwinge
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Schwinge @ 2022-05-12 12:39 UTC (permalink / raw)
  To: gcc-patches, Jakub Jelinek; +Cc: Tom de Vries, Andrew Stubbs, Julian Brown

[-- Attachment #1: Type: text/plain, Size: 676 bytes --]

Hi!

Again, no change in behavior, just refactoring, making things more
explicit, in preparation for other changes.  OK to push the attached
"Refactor '-ldl' handling for libgomp proper and plugins"?

By the way, this might also qualify as a first preparational step to
support dynamic loading schemes different from 'dl.so'/'dlopen'.  ;-)
(But I'm not working on that.)


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Refactor-ldl-handling-for-libgomp-proper-and-plugins.patch --]
[-- Type: text/x-diff, Size: 9502 bytes --]

From 223f9e18819bce6b51642c8aebb7272655d12e6f Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Thu, 5 May 2022 23:01:36 +0200
Subject: [PATCH] Refactor '-ldl' handling for libgomp proper and plugins

Instead of implicit global 'LIBS="-ldl $LIBS"' via 'AC_CHECK_LIB', make
'-ldl' explicit for libgomp proper, and clean up 'PLUGIN_GCN_LIBS',
'PLUGIN_NVPTX_LIBS' accordingly.

	libgomp/
	* Makefile.am (libgomp_la_LIBADD): Initialize.
	* plugin/configfrag.ac (DL_LIBS): New.
	(PLUGIN_GCN_LIBS): Remove.
	(PLUGIN_NVPTX_LIBS): Don't set in the 'PLUGIN_NVPTX_DYNAMIC' case.
	* plugin/Makefrag.am (libgomp_la_LIBADD)
	(libgomp_plugin_gcn_la_LIBADD): Consider '$(DL_LIBS)'.
	(libgomp_plugin_nvptx_la_LIBADD) <PLUGIN_NVPTX_DYNAMIC>: Likewise.
	* Makefile.in: Regenerate.
	* config.h.in: Likewise.
	* configure: Likewise.
	* testsuite/Makefile.in: Likewise.
---
 libgomp/Makefile.am           |  1 +
 libgomp/Makefile.in           |  8 ++++----
 libgomp/config.h.in           |  3 ---
 libgomp/configure             | 16 ++++------------
 libgomp/plugin/Makefrag.am    |  8 ++++++--
 libgomp/plugin/configfrag.ac  |  9 +++------
 libgomp/testsuite/Makefile.in |  2 +-
 7 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/libgomp/Makefile.am b/libgomp/Makefile.am
index f8b2a06d63e..428f7a9dab5 100644
--- a/libgomp/Makefile.am
+++ b/libgomp/Makefile.am
@@ -56,6 +56,7 @@ endif
 libgomp_version_info = -version-info $(libtool_VERSION)
 libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \
         $(lt_host_flags)
+libgomp_la_LIBADD =
 libgomp_la_DEPENDENCIES = $(libgomp_version_dep)
 libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS)
 
diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in
index 51252b89462..c47b6bd6153 100644
--- a/libgomp/Makefile.in
+++ b/libgomp/Makefile.in
@@ -125,7 +125,7 @@ target_triplet = @target@
 @PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@	-DPLUGIN_NVPTX_LINK_LIBCUDA
 
 # 'dlopen'ing the CUDA Driver library vs. linking it.
-@PLUGIN_NVPTX_DYNAMIC_TRUE@@PLUGIN_NVPTX_TRUE@am__append_3 = $(PLUGIN_NVPTX_LIBS)
+@PLUGIN_NVPTX_DYNAMIC_TRUE@@PLUGIN_NVPTX_TRUE@am__append_3 = $(DL_LIBS)
 @PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__append_4 = $(PLUGIN_NVPTX_LIBS)
 @PLUGIN_GCN_TRUE@am__append_5 = libgomp-plugin-gcn.la
 @USE_FORTRAN_TRUE@am__append_6 = openacc.f90
@@ -219,7 +219,6 @@ libgomp_plugin_nvptx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
 	$(libgomp_plugin_nvptx_la_LDFLAGS) $(LDFLAGS) -o $@
 @PLUGIN_NVPTX_TRUE@am_libgomp_plugin_nvptx_la_rpath = -rpath \
 @PLUGIN_NVPTX_TRUE@	$(toolexeclibdir)
-libgomp_la_LIBADD =
 @USE_FORTRAN_TRUE@am__objects_1 = openacc.lo
 am_libgomp_la_OBJECTS = alloc.lo atomic.lo barrier.lo critical.lo \
 	env.lo error.lo icv.lo icv-device.lo iter.lo iter_ull.lo \
@@ -384,6 +383,7 @@ CUDA_DRIVER_LIB = @CUDA_DRIVER_LIB@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DL_LIBS = @DL_LIBS@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -441,7 +441,6 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
-PLUGIN_GCN_LIBS = @PLUGIN_GCN_LIBS@
 PLUGIN_NVPTX_CPPFLAGS = @PLUGIN_NVPTX_CPPFLAGS@
 PLUGIN_NVPTX_LDFLAGS = @PLUGIN_NVPTX_LDFLAGS@
 PLUGIN_NVPTX_LIBS = @PLUGIN_NVPTX_LIBS@
@@ -553,6 +552,7 @@ libgomp_version_info = -version-info $(libtool_VERSION)
 libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \
         $(lt_host_flags)
 
+libgomp_la_LIBADD = $(DL_LIBS)
 libgomp_la_DEPENDENCIES = $(libgomp_version_dep)
 libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS)
 libgomp_la_SOURCES = alloc.c atomic.c barrier.c critical.c env.c \
@@ -586,7 +586,7 @@ libgomp_la_SOURCES = alloc.c atomic.c barrier.c critical.c env.c \
 @PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LDFLAGS = $(libgomp_plugin_gcn_version_info) \
 @PLUGIN_GCN_TRUE@	$(lt_host_flags)
 
-@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LIBADD = libgomp.la $(PLUGIN_GCN_LIBS)
+@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LIBADD = libgomp.la $(DL_LIBS)
 @PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LIBTOOLFLAGS = --tag=disable-static
 nodist_noinst_HEADERS = libgomp_f.h
 nodist_libsubinclude_HEADERS = omp.h openacc.h acc_prof.h
diff --git a/libgomp/config.h.in b/libgomp/config.h.in
index d971ea38c46..46d3eac1e61 100644
--- a/libgomp/config.h.in
+++ b/libgomp/config.h.in
@@ -51,9 +51,6 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
-/* Define to 1 if you have the `dl' library (-ldl). */
-#undef HAVE_LIBDL
-
 /* Define to 1 if you have the `memalign' function. */
 #undef HAVE_MEMALIGN
 
diff --git a/libgomp/configure b/libgomp/configure
index 0df47cf96e3..66dface222e 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -675,12 +675,12 @@ offload_additional_lib_paths
 offload_additional_options
 offload_targets
 offload_plugins
-PLUGIN_GCN_LIBS
 PLUGIN_NVPTX_LIBS
 PLUGIN_NVPTX_LDFLAGS
 PLUGIN_NVPTX_CPPFLAGS
 CUDA_DRIVER_LIB
 CUDA_DRIVER_INCLUDE
+DL_LIBS
 libtool_VERSION
 ac_ct_FC
 FCFLAGS
@@ -15057,6 +15057,8 @@ _ACEOF
 # <http://www.gnu.org/licenses/>.
 
 plugin_support=yes
+DL_LIBS=
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5
 $as_echo_n "checking for dlsym in -ldl... " >&6; }
 if ${ac_cv_lib_dl_dlsym+:} false; then :
@@ -15094,12 +15096,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5
 $as_echo "$ac_cv_lib_dl_dlsym" >&6; }
 if test "x$ac_cv_lib_dl_dlsym" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDL 1
-_ACEOF
-
-  LIBS="-ldl $LIBS"
-
+  DL_LIBS=-ldl
 else
   plugin_support=no
 fi
@@ -15221,8 +15218,6 @@ PLUGIN_NVPTX_DYNAMIC=0
 
 
 PLUGIN_GCN=0
-PLUGIN_GCN_LIBS=
-
 
 # Parse '--enable-offload-targets', figure out the corresponding libgomp
 # plugins, and configure to find the corresponding offload compilers.
@@ -15295,7 +15290,6 @@ rm -f core conftest.err conftest.$ac_objext \
 		       && (test "x$CUDA_DRIVER_LIB" = x \
 			   || test "x$CUDA_DRIVER_LIB" = xno); then
 		      PLUGIN_NVPTX=1
-		      PLUGIN_NVPTX_LIBS='-ldl'
 		      PLUGIN_NVPTX_DYNAMIC=1
 		    else
 		      PLUGIN_NVPTX=0
@@ -15321,8 +15315,6 @@ rm -f core conftest.err conftest.$ac_objext \
 		;;
 	      *)
 		tgt_plugin=gcn
-		PLUGIN_GCN=$tgt
-		PLUGIN_GCN_LIBS="-ldl"
 		PLUGIN_GCN=1
 		;;
 	      esac
diff --git a/libgomp/plugin/Makefrag.am b/libgomp/plugin/Makefrag.am
index 3eeb3419f9c..3e453ff6fee 100644
--- a/libgomp/plugin/Makefrag.am
+++ b/libgomp/plugin/Makefrag.am
@@ -26,6 +26,8 @@
 # see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 # <http://www.gnu.org/licenses/>.
 
+libgomp_la_LIBADD += $(DL_LIBS)
+
 if PLUGIN_NVPTX
 # Nvidia PTX OpenACC plugin.
 libgomp_plugin_nvptx_version_info = -version-info $(libtool_VERSION)
@@ -46,7 +48,7 @@ endif
 
 # 'dlopen'ing the CUDA Driver library vs. linking it.
 if PLUGIN_NVPTX_DYNAMIC
-libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS)
+libgomp_plugin_nvptx_la_LIBADD += $(DL_LIBS)
 else
 libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_LINK_LIBCUDA
 libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS)
@@ -62,6 +64,8 @@ libgomp_plugin_gcn_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-D_GNU_SOURCE
 libgomp_plugin_gcn_la_LDFLAGS = $(libgomp_plugin_gcn_version_info) \
 	$(lt_host_flags)
-libgomp_plugin_gcn_la_LIBADD = libgomp.la $(PLUGIN_GCN_LIBS)
+libgomp_plugin_gcn_la_LIBADD = libgomp.la
 libgomp_plugin_gcn_la_LIBTOOLFLAGS = --tag=disable-static
+
+libgomp_plugin_gcn_la_LIBADD += $(DL_LIBS)
 endif
diff --git a/libgomp/plugin/configfrag.ac b/libgomp/plugin/configfrag.ac
index c16224104e3..14203048bdb 100644
--- a/libgomp/plugin/configfrag.ac
+++ b/libgomp/plugin/configfrag.ac
@@ -27,7 +27,9 @@
 # <http://www.gnu.org/licenses/>.
 
 plugin_support=yes
-AC_CHECK_LIB(dl, dlsym, , [plugin_support=no])
+DL_LIBS=
+AC_SUBST(DL_LIBS)
+AC_CHECK_LIB(dl, dlsym, [DL_LIBS=-ldl], [plugin_support=no])
 if test x"$plugin_support" = xyes; then
   AC_DEFINE(PLUGIN_SUPPORT, 1,
     [Define if all infrastructure, needed for plugins, is supported.])
@@ -91,8 +93,6 @@ AC_SUBST(PLUGIN_NVPTX_LDFLAGS)
 AC_SUBST(PLUGIN_NVPTX_LIBS)
 
 PLUGIN_GCN=0
-PLUGIN_GCN_LIBS=
-AC_SUBST(PLUGIN_GCN_LIBS)
 
 # Parse '--enable-offload-targets', figure out the corresponding libgomp
 # plugins, and configure to find the corresponding offload compilers.
@@ -154,7 +154,6 @@ if test x"$enable_offload_targets" != x; then
 		       && (test "x$CUDA_DRIVER_LIB" = x \
 			   || test "x$CUDA_DRIVER_LIB" = xno); then
 		      PLUGIN_NVPTX=1
-		      PLUGIN_NVPTX_LIBS='-ldl'
 		      PLUGIN_NVPTX_DYNAMIC=1
 		    else
 		      PLUGIN_NVPTX=0
@@ -180,8 +179,6 @@ if test x"$enable_offload_targets" != x; then
 		;;
 	      *)
 		tgt_plugin=gcn
-		PLUGIN_GCN=$tgt
-		PLUGIN_GCN_LIBS="-ldl"
 		PLUGIN_GCN=1
 		;;
 	      esac
diff --git a/libgomp/testsuite/Makefile.in b/libgomp/testsuite/Makefile.in
index 2d1bf8f20d7..048844f0a40 100644
--- a/libgomp/testsuite/Makefile.in
+++ b/libgomp/testsuite/Makefile.in
@@ -152,6 +152,7 @@ CUDA_DRIVER_LIB = @CUDA_DRIVER_LIB@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DL_LIBS = @DL_LIBS@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -209,7 +210,6 @@ PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
-PLUGIN_GCN_LIBS = @PLUGIN_GCN_LIBS@
 PLUGIN_NVPTX_CPPFLAGS = @PLUGIN_NVPTX_CPPFLAGS@
 PLUGIN_NVPTX_LDFLAGS = @PLUGIN_NVPTX_LDFLAGS@
 PLUGIN_NVPTX_LIBS = @PLUGIN_NVPTX_LIBS@
-- 
2.35.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Refactor '-ldl' handling for libgomp proper and plugins
  2022-05-12 12:39 Refactor '-ldl' handling for libgomp proper and plugins Thomas Schwinge
@ 2022-05-12 12:42 ` Jakub Jelinek
  2022-05-13 12:05 ` libgomp nvptx plugin: Only consider '--with-cuda-driver=[...]' when applicable Thomas Schwinge
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2022-05-12 12:42 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gcc-patches, Tom de Vries, Andrew Stubbs, Julian Brown

On Thu, May 12, 2022 at 02:39:14PM +0200, Thomas Schwinge wrote:
> Hi!
> 
> Again, no change in behavior, just refactoring, making things more
> explicit, in preparation for other changes.  OK to push the attached
> "Refactor '-ldl' handling for libgomp proper and plugins"?
> 
> By the way, this might also qualify as a first preparational step to
> support dynamic loading schemes different from 'dl.so'/'dlopen'.  ;-)
> (But I'm not working on that.)

Ok.
> 	libgomp/
> 	* Makefile.am (libgomp_la_LIBADD): Initialize.
> 	* plugin/configfrag.ac (DL_LIBS): New.
> 	(PLUGIN_GCN_LIBS): Remove.
> 	(PLUGIN_NVPTX_LIBS): Don't set in the 'PLUGIN_NVPTX_DYNAMIC' case.
> 	* plugin/Makefrag.am (libgomp_la_LIBADD)
> 	(libgomp_plugin_gcn_la_LIBADD): Consider '$(DL_LIBS)'.
> 	(libgomp_plugin_nvptx_la_LIBADD) <PLUGIN_NVPTX_DYNAMIC>: Likewise.
> 	* Makefile.in: Regenerate.
> 	* config.h.in: Likewise.
> 	* configure: Likewise.
> 	* testsuite/Makefile.in: Likewise.

	Jakub


^ permalink raw reply	[flat|nested] 3+ messages in thread

* libgomp nvptx plugin: Only consider '--with-cuda-driver=[...]' when applicable
  2022-05-12 12:39 Refactor '-ldl' handling for libgomp proper and plugins Thomas Schwinge
  2022-05-12 12:42 ` Jakub Jelinek
@ 2022-05-13 12:05 ` Thomas Schwinge
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Schwinge @ 2022-05-13 12:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jakub Jelinek, Tom de Vries

[-- Attachment #1: Type: text/plain, Size: 1626 bytes --]

Hi!

Another small one:

On 2022-05-12T14:39:14+0200, I wrote:
> Again, no change in behavior, just refactoring, making things more
> explicit, in preparation for other changes.

> "Refactor '-ldl' handling for libgomp proper and plugins"?

> --- a/libgomp/plugin/Makefrag.am
> +++ b/libgomp/plugin/Makefrag.am

> @@ -46,7 +48,7 @@ endif
>
>  # 'dlopen'ing the CUDA Driver library vs. linking it.
>  if PLUGIN_NVPTX_DYNAMIC
> -libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS)
> +libgomp_plugin_nvptx_la_LIBADD += $(DL_LIBS)
>  else
>  libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_LINK_LIBCUDA
>  libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS)

This means that 'PLUGIN_NVPTX_LIBS' is no longer considered in the
'--without-cuda-driver' case.

Similarly, normally, 'PLUGIN_NVPTX_CPPFLAGS' and 'PLUGIN_NVPTX_LDFLAGS'
are either empty (especially in the '--without-cuda-driver' case), or
assigned from 'CUDA_DRIVER_CPPFLAGS' and 'CUDA_DRIVER_LDFLAGS' (in the
'--with-cuda-driver=[...]' etc. cases).

Only in the latter case, they're actually (a) meaningful and (b)
(possibly) non-empty, so I've clarified that, pushed to master branch
commit 1f89e48789d230c78ec60ff3dc9e7e2478cc3df9 "libgomp nvptx plugin:
Only consider '--with-cuda-driver=[...]' when applicable", see attached.


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-libgomp-nvptx-plugin-Only-consider-with-cuda-driver-.patch --]
[-- Type: text/x-diff, Size: 4969 bytes --]

From 1f89e48789d230c78ec60ff3dc9e7e2478cc3df9 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Thu, 12 May 2022 17:51:43 +0200
Subject: [PATCH] libgomp nvptx plugin: Only consider
 '--with-cuda-driver=[...]' when applicable

They're not applicable in 'PLUGIN_NVPTX_DYNAMIC' configurations.

	libgomp/
	* plugin/Makefrag.am (libgomp_plugin_nvptx_la_CPPFLAGS)
	[PLUGIN_NVPTX_DYNAMIC]: Don't append '$(PLUGIN_NVPTX_CPPFLAGS)'.
	(libgomp_plugin_nvptx_la_LDFLAGS) [PLUGIN_NVPTX_DYNAMIC]: Don't
	append '$(PLUGIN_NVPTX_LDFLAGS)'.
	* Makefile.in: Regenerate.
---
 libgomp/Makefile.in        | 18 ++++++++++--------
 libgomp/plugin/Makefrag.am |  5 +++--
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in
index c47b6bd6153..2ac0397a036 100644
--- a/libgomp/Makefile.in
+++ b/libgomp/Makefile.in
@@ -122,13 +122,15 @@ target_triplet = @target@
 
 # Including the GCC-shipped 'include/cuda/cuda.h' vs. system <cuda.h>.
 @PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__append_2 = -DPLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H \
+@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@	$(PLUGIN_NVPTX_CPPFLAGS) \
 @PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@	-DPLUGIN_NVPTX_LINK_LIBCUDA
 
 # 'dlopen'ing the CUDA Driver library vs. linking it.
 @PLUGIN_NVPTX_DYNAMIC_TRUE@@PLUGIN_NVPTX_TRUE@am__append_3 = $(DL_LIBS)
-@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__append_4 = $(PLUGIN_NVPTX_LIBS)
-@PLUGIN_GCN_TRUE@am__append_5 = libgomp-plugin-gcn.la
-@USE_FORTRAN_TRUE@am__append_6 = openacc.f90
+@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__append_4 = $(PLUGIN_NVPTX_LDFLAGS)
+@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__append_5 = $(PLUGIN_NVPTX_LIBS)
+@PLUGIN_GCN_TRUE@am__append_6 = libgomp-plugin-gcn.la
+@USE_FORTRAN_TRUE@am__append_7 = openacc.f90
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
@@ -536,7 +538,7 @@ libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
 AM_CPPFLAGS = $(addprefix -I, $(search_path))
 AM_CFLAGS = $(XCFLAGS)
 AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
-toolexeclib_LTLIBRARIES = libgomp.la $(am__append_1) $(am__append_5)
+toolexeclib_LTLIBRARIES = libgomp.la $(am__append_1) $(am__append_6)
 nodist_toolexeclib_HEADERS = libgomp.spec
 
 # -Wc is only a libtool option.
@@ -563,18 +565,18 @@ libgomp_la_SOURCES = alloc.c atomic.c barrier.c critical.c env.c \
 	oacc-parallel.c oacc-host.c oacc-init.c oacc-mem.c \
 	oacc-async.c oacc-plugin.c oacc-cuda.c priority_queue.c \
 	affinity-fmt.c teams.c allocator.c oacc-profiling.c \
-	oacc-target.c $(am__append_6)
+	oacc-target.c $(am__append_7)
 
 # Nvidia PTX OpenACC plugin.
 @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_version_info = -version-info $(libtool_VERSION)
 @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_SOURCES = plugin/plugin-nvptx.c
 @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_CPPFLAGS = $(AM_CPPFLAGS) \
-@PLUGIN_NVPTX_TRUE@	$(PLUGIN_NVPTX_CPPFLAGS) $(am__append_2)
+@PLUGIN_NVPTX_TRUE@	$(am__append_2)
 @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LDFLAGS =  \
 @PLUGIN_NVPTX_TRUE@	$(libgomp_plugin_nvptx_version_info) \
-@PLUGIN_NVPTX_TRUE@	$(lt_host_flags) $(PLUGIN_NVPTX_LDFLAGS)
+@PLUGIN_NVPTX_TRUE@	$(lt_host_flags) $(am__append_4)
 @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBADD = libgomp.la \
-@PLUGIN_NVPTX_TRUE@	$(am__append_3) $(am__append_4)
+@PLUGIN_NVPTX_TRUE@	$(am__append_3) $(am__append_5)
 @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
 
 # AMD GCN plugin
diff --git a/libgomp/plugin/Makefrag.am b/libgomp/plugin/Makefrag.am
index 3e453ff6fee..66c8c12c1a6 100644
--- a/libgomp/plugin/Makefrag.am
+++ b/libgomp/plugin/Makefrag.am
@@ -33,10 +33,9 @@ if PLUGIN_NVPTX
 libgomp_plugin_nvptx_version_info = -version-info $(libtool_VERSION)
 toolexeclib_LTLIBRARIES += libgomp-plugin-nvptx.la
 libgomp_plugin_nvptx_la_SOURCES = plugin/plugin-nvptx.c
-libgomp_plugin_nvptx_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_NVPTX_CPPFLAGS)
+libgomp_plugin_nvptx_la_CPPFLAGS = $(AM_CPPFLAGS)
 libgomp_plugin_nvptx_la_LDFLAGS = $(libgomp_plugin_nvptx_version_info) \
 	$(lt_host_flags)
-libgomp_plugin_nvptx_la_LDFLAGS += $(PLUGIN_NVPTX_LDFLAGS)
 libgomp_plugin_nvptx_la_LIBADD = libgomp.la
 libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
 
@@ -44,6 +43,7 @@ libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
 if PLUGIN_NVPTX_DYNAMIC
 else
 libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H
+libgomp_plugin_nvptx_la_CPPFLAGS += $(PLUGIN_NVPTX_CPPFLAGS)
 endif
 
 # 'dlopen'ing the CUDA Driver library vs. linking it.
@@ -51,6 +51,7 @@ if PLUGIN_NVPTX_DYNAMIC
 libgomp_plugin_nvptx_la_LIBADD += $(DL_LIBS)
 else
 libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_LINK_LIBCUDA
+libgomp_plugin_nvptx_la_LDFLAGS += $(PLUGIN_NVPTX_LDFLAGS)
 libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS)
 endif
 endif
-- 
2.35.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-13 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 12:39 Refactor '-ldl' handling for libgomp proper and plugins Thomas Schwinge
2022-05-12 12:42 ` Jakub Jelinek
2022-05-13 12:05 ` libgomp nvptx plugin: Only consider '--with-cuda-driver=[...]' when applicable Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).