summaryrefslogtreecommitdiffstats
path: root/libgomp
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2022-05-05 23:01:36 +0200
committerThomas Schwinge <thomas@codesourcery.com>2022-05-12 15:11:30 +0200
commitdcc266796a6afa18eeba1edde81f9eb78e6c83ce (patch)
tree93a894b66a4082ec7fb879779c69ad565fa995e5 /libgomp
parentrtl-optimization/105577 - RTL DSE and non-call EH (diff)
downloadgcc-dcc266796a6afa18eeba1edde81f9eb78e6c83ce.tar.gz
gcc-dcc266796a6afa18eeba1edde81f9eb78e6c83ce.tar.bz2
gcc-dcc266796a6afa18eeba1edde81f9eb78e6c83ce.tar.xz
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.
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/Makefile.am1
-rw-r--r--libgomp/Makefile.in8
-rw-r--r--libgomp/config.h.in3
-rwxr-xr-xlibgomp/configure16
-rw-r--r--libgomp/plugin/Makefrag.am8
-rw-r--r--libgomp/plugin/configfrag.ac9
-rw-r--r--libgomp/testsuite/Makefile.in2
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
56libgomp_version_info = -version-info $(libtool_VERSION) 56libgomp_version_info = -version-info $(libtool_VERSION)
57libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \ 57libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \
58 $(lt_host_flags) 58 $(lt_host_flags)
59libgomp_la_LIBADD =
59libgomp_la_DEPENDENCIES = $(libgomp_version_dep) 60libgomp_la_DEPENDENCIES = $(libgomp_version_dep)
60libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS) 61libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS)
61 62
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@
125@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@ -DPLUGIN_NVPTX_LINK_LIBCUDA 125@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@ -DPLUGIN_NVPTX_LINK_LIBCUDA
126 126
127# 'dlopen'ing the CUDA Driver library vs. linking it. 127# 'dlopen'ing the CUDA Driver library vs. linking it.
128@PLUGIN_NVPTX_DYNAMIC_TRUE@@PLUGIN_NVPTX_TRUE@am__append_3 = $(PLUGIN_NVPTX_LIBS) 128@PLUGIN_NVPTX_DYNAMIC_TRUE@@PLUGIN_NVPTX_TRUE@am__append_3 = $(DL_LIBS)
129@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__append_4 = $(PLUGIN_NVPTX_LIBS) 129@PLUGIN_NVPTX_DYNAMIC_FALSE@@PLUGIN_NVPTX_TRUE@am__append_4 = $(PLUGIN_NVPTX_LIBS)
130@PLUGIN_GCN_TRUE@am__append_5 = libgomp-plugin-gcn.la 130@PLUGIN_GCN_TRUE@am__append_5 = libgomp-plugin-gcn.la
131@USE_FORTRAN_TRUE@am__append_6 = openacc.f90 131@USE_FORTRAN_TRUE@am__append_6 = openacc.f90
@@ -219,7 +219,6 @@ libgomp_plugin_nvptx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
219 $(libgomp_plugin_nvptx_la_LDFLAGS) $(LDFLAGS) -o $@ 219 $(libgomp_plugin_nvptx_la_LDFLAGS) $(LDFLAGS) -o $@
220@PLUGIN_NVPTX_TRUE@am_libgomp_plugin_nvptx_la_rpath = -rpath \ 220@PLUGIN_NVPTX_TRUE@am_libgomp_plugin_nvptx_la_rpath = -rpath \
221@PLUGIN_NVPTX_TRUE@ $(toolexeclibdir) 221@PLUGIN_NVPTX_TRUE@ $(toolexeclibdir)
222libgomp_la_LIBADD =
223@USE_FORTRAN_TRUE@am__objects_1 = openacc.lo 222@USE_FORTRAN_TRUE@am__objects_1 = openacc.lo
224am_libgomp_la_OBJECTS = alloc.lo atomic.lo barrier.lo critical.lo \ 223am_libgomp_la_OBJECTS = alloc.lo atomic.lo barrier.lo critical.lo \
225 env.lo error.lo icv.lo icv-device.lo iter.lo iter_ull.lo \ 224 env.lo error.lo icv.lo icv-device.lo iter.lo iter_ull.lo \
@@ -384,6 +383,7 @@ CUDA_DRIVER_LIB = @CUDA_DRIVER_LIB@
384CYGPATH_W = @CYGPATH_W@ 383CYGPATH_W = @CYGPATH_W@
385DEFS = @DEFS@ 384DEFS = @DEFS@
386DEPDIR = @DEPDIR@ 385DEPDIR = @DEPDIR@
386DL_LIBS = @DL_LIBS@
387DSYMUTIL = @DSYMUTIL@ 387DSYMUTIL = @DSYMUTIL@
388DUMPBIN = @DUMPBIN@ 388DUMPBIN = @DUMPBIN@
389ECHO_C = @ECHO_C@ 389ECHO_C = @ECHO_C@
@@ -441,7 +441,6 @@ PACKAGE_URL = @PACKAGE_URL@
441PACKAGE_VERSION = @PACKAGE_VERSION@ 441PACKAGE_VERSION = @PACKAGE_VERSION@
442PATH_SEPARATOR = @PATH_SEPARATOR@ 442PATH_SEPARATOR = @PATH_SEPARATOR@
443PERL = @PERL@ 443PERL = @PERL@
444PLUGIN_GCN_LIBS = @PLUGIN_GCN_LIBS@
445PLUGIN_NVPTX_CPPFLAGS = @PLUGIN_NVPTX_CPPFLAGS@ 444PLUGIN_NVPTX_CPPFLAGS = @PLUGIN_NVPTX_CPPFLAGS@
446PLUGIN_NVPTX_LDFLAGS = @PLUGIN_NVPTX_LDFLAGS@ 445PLUGIN_NVPTX_LDFLAGS = @PLUGIN_NVPTX_LDFLAGS@
447PLUGIN_NVPTX_LIBS = @PLUGIN_NVPTX_LIBS@ 446PLUGIN_NVPTX_LIBS = @PLUGIN_NVPTX_LIBS@
@@ -553,6 +552,7 @@ libgomp_version_info = -version-info $(libtool_VERSION)
553libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \ 552libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \
554 $(lt_host_flags) 553 $(lt_host_flags)
555 554
555libgomp_la_LIBADD = $(DL_LIBS)
556libgomp_la_DEPENDENCIES = $(libgomp_version_dep) 556libgomp_la_DEPENDENCIES = $(libgomp_version_dep)
557libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS) 557libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS)
558libgomp_la_SOURCES = alloc.c atomic.c barrier.c critical.c env.c \ 558libgomp_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 \
586@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LDFLAGS = $(libgomp_plugin_gcn_version_info) \ 586@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LDFLAGS = $(libgomp_plugin_gcn_version_info) \
587@PLUGIN_GCN_TRUE@ $(lt_host_flags) 587@PLUGIN_GCN_TRUE@ $(lt_host_flags)
588 588
589@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LIBADD = libgomp.la $(PLUGIN_GCN_LIBS) 589@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LIBADD = libgomp.la $(DL_LIBS)
590@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LIBTOOLFLAGS = --tag=disable-static 590@PLUGIN_GCN_TRUE@libgomp_plugin_gcn_la_LIBTOOLFLAGS = --tag=disable-static
591nodist_noinst_HEADERS = libgomp_f.h 591nodist_noinst_HEADERS = libgomp_f.h
592nodist_libsubinclude_HEADERS = omp.h openacc.h acc_prof.h 592nodist_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 @@
51/* Define to 1 if you have the <inttypes.h> header file. */ 51/* Define to 1 if you have the <inttypes.h> header file. */
52#undef HAVE_INTTYPES_H 52#undef HAVE_INTTYPES_H
53 53
54/* Define to 1 if you have the `dl' library (-ldl). */
55#undef HAVE_LIBDL
56
57/* Define to 1 if you have the `memalign' function. */ 54/* Define to 1 if you have the `memalign' function. */
58#undef HAVE_MEMALIGN 55#undef HAVE_MEMALIGN
59 56
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
675offload_additional_options 675offload_additional_options
676offload_targets 676offload_targets
677offload_plugins 677offload_plugins
678PLUGIN_GCN_LIBS
679PLUGIN_NVPTX_LIBS 678PLUGIN_NVPTX_LIBS
680PLUGIN_NVPTX_LDFLAGS 679PLUGIN_NVPTX_LDFLAGS
681PLUGIN_NVPTX_CPPFLAGS 680PLUGIN_NVPTX_CPPFLAGS
682CUDA_DRIVER_LIB 681CUDA_DRIVER_LIB
683CUDA_DRIVER_INCLUDE 682CUDA_DRIVER_INCLUDE
683DL_LIBS
684libtool_VERSION 684libtool_VERSION
685ac_ct_FC 685ac_ct_FC
686FCFLAGS 686FCFLAGS
@@ -15057,6 +15057,8 @@ _ACEOF
15057# <http://www.gnu.org/licenses/>. 15057# <http://www.gnu.org/licenses/>.
15058 15058
15059plugin_support=yes 15059plugin_support=yes
15060DL_LIBS=
15061
15060{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 15062{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5
15061$as_echo_n "checking for dlsym in -ldl... " >&6; } 15063$as_echo_n "checking for dlsym in -ldl... " >&6; }
15062if ${ac_cv_lib_dl_dlsym+:} false; then : 15064if ${ac_cv_lib_dl_dlsym+:} false; then :
@@ -15094,12 +15096,7 @@ fi
15094{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 15096{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5
15095$as_echo "$ac_cv_lib_dl_dlsym" >&6; } 15097$as_echo "$ac_cv_lib_dl_dlsym" >&6; }
15096if test "x$ac_cv_lib_dl_dlsym" = xyes; then : 15098if test "x$ac_cv_lib_dl_dlsym" = xyes; then :
15097 cat >>confdefs.h <<_ACEOF 15099 DL_LIBS=-ldl
15098#define HAVE_LIBDL 1
15099_ACEOF
15100
15101 LIBS="-ldl $LIBS"
15102
15103else 15100else
15104 plugin_support=no 15101 plugin_support=no
15105fi 15102fi
@@ -15221,8 +15218,6 @@ PLUGIN_NVPTX_DYNAMIC=0
15221 15218
15222 15219
15223PLUGIN_GCN=0 15220PLUGIN_GCN=0
15224PLUGIN_GCN_LIBS=
15225
15226 15221
15227# Parse '--enable-offload-targets', figure out the corresponding libgomp 15222# Parse '--enable-offload-targets', figure out the corresponding libgomp
15228# plugins, and configure to find the corresponding offload compilers. 15223# plugins, and configure to find the corresponding offload compilers.
@@ -15295,7 +15290,6 @@ rm -f core conftest.err conftest.$ac_objext \
15295 && (test "x$CUDA_DRIVER_LIB" = x \ 15290 && (test "x$CUDA_DRIVER_LIB" = x \
15296 || test "x$CUDA_DRIVER_LIB" = xno); then 15291 || test "x$CUDA_DRIVER_LIB" = xno); then
15297 PLUGIN_NVPTX=1 15292 PLUGIN_NVPTX=1
15298 PLUGIN_NVPTX_LIBS='-ldl'
15299 PLUGIN_NVPTX_DYNAMIC=1 15293 PLUGIN_NVPTX_DYNAMIC=1
15300 else 15294 else
15301 PLUGIN_NVPTX=0 15295 PLUGIN_NVPTX=0
@@ -15321,8 +15315,6 @@ rm -f core conftest.err conftest.$ac_objext \
15321 ;; 15315 ;;
15322 *) 15316 *)
15323 tgt_plugin=gcn 15317 tgt_plugin=gcn
15324 PLUGIN_GCN=$tgt
15325 PLUGIN_GCN_LIBS="-ldl"
15326 PLUGIN_GCN=1 15318 PLUGIN_GCN=1
15327 ;; 15319 ;;
15328 esac 15320 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 @@
26# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 26# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
27# <http://www.gnu.org/licenses/>. 27# <http://www.gnu.org/licenses/>.
28 28
29libgomp_la_LIBADD += $(DL_LIBS)
30
29if PLUGIN_NVPTX 31if PLUGIN_NVPTX
30# Nvidia PTX OpenACC plugin. 32# Nvidia PTX OpenACC plugin.
31libgomp_plugin_nvptx_version_info = -version-info $(libtool_VERSION) 33libgomp_plugin_nvptx_version_info = -version-info $(libtool_VERSION)
@@ -46,7 +48,7 @@ endif
46 48
47# 'dlopen'ing the CUDA Driver library vs. linking it. 49# 'dlopen'ing the CUDA Driver library vs. linking it.
48if PLUGIN_NVPTX_DYNAMIC 50if PLUGIN_NVPTX_DYNAMIC
49libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS) 51libgomp_plugin_nvptx_la_LIBADD += $(DL_LIBS)
50else 52else
51libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_LINK_LIBCUDA 53libgomp_plugin_nvptx_la_CPPFLAGS += -DPLUGIN_NVPTX_LINK_LIBCUDA
52libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS) 54libgomp_plugin_nvptx_la_LIBADD += $(PLUGIN_NVPTX_LIBS)
@@ -62,6 +64,8 @@ libgomp_plugin_gcn_la_CPPFLAGS = $(AM_CPPFLAGS) \
62 -D_GNU_SOURCE 64 -D_GNU_SOURCE
63libgomp_plugin_gcn_la_LDFLAGS = $(libgomp_plugin_gcn_version_info) \ 65libgomp_plugin_gcn_la_LDFLAGS = $(libgomp_plugin_gcn_version_info) \
64 $(lt_host_flags) 66 $(lt_host_flags)
65libgomp_plugin_gcn_la_LIBADD = libgomp.la $(PLUGIN_GCN_LIBS) 67libgomp_plugin_gcn_la_LIBADD = libgomp.la
66libgomp_plugin_gcn_la_LIBTOOLFLAGS = --tag=disable-static 68libgomp_plugin_gcn_la_LIBTOOLFLAGS = --tag=disable-static
69
70libgomp_plugin_gcn_la_LIBADD += $(DL_LIBS)
67endif 71endif
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 @@
27# <http://www.gnu.org/licenses/>. 27# <http://www.gnu.org/licenses/>.
28 28
29plugin_support=yes 29plugin_support=yes
30AC_CHECK_LIB(dl, dlsym, , [plugin_support=no]) 30DL_LIBS=
31AC_SUBST(DL_LIBS)
32AC_CHECK_LIB(dl, dlsym, [DL_LIBS=-ldl], [plugin_support=no])
31if test x"$plugin_support" = xyes; then 33if test x"$plugin_support" = xyes; then
32 AC_DEFINE(PLUGIN_SUPPORT, 1, 34 AC_DEFINE(PLUGIN_SUPPORT, 1,
33 [Define if all infrastructure, needed for plugins, is supported.]) 35 [Define if all infrastructure, needed for plugins, is supported.])
@@ -91,8 +93,6 @@ AC_SUBST(PLUGIN_NVPTX_LDFLAGS)
91AC_SUBST(PLUGIN_NVPTX_LIBS) 93AC_SUBST(PLUGIN_NVPTX_LIBS)
92 94
93PLUGIN_GCN=0 95PLUGIN_GCN=0
94PLUGIN_GCN_LIBS=
95AC_SUBST(PLUGIN_GCN_LIBS)
96 96
97# Parse '--enable-offload-targets', figure out the corresponding libgomp 97# Parse '--enable-offload-targets', figure out the corresponding libgomp
98# plugins, and configure to find the corresponding offload compilers. 98# plugins, and configure to find the corresponding offload compilers.
@@ -154,7 +154,6 @@ if test x"$enable_offload_targets" != x; then
154 && (test "x$CUDA_DRIVER_LIB" = x \ 154 && (test "x$CUDA_DRIVER_LIB" = x \
155 || test "x$CUDA_DRIVER_LIB" = xno); then 155 || test "x$CUDA_DRIVER_LIB" = xno); then
156 PLUGIN_NVPTX=1 156 PLUGIN_NVPTX=1
157 PLUGIN_NVPTX_LIBS='-ldl'
158 PLUGIN_NVPTX_DYNAMIC=1 157 PLUGIN_NVPTX_DYNAMIC=1
159 else 158 else
160 PLUGIN_NVPTX=0 159 PLUGIN_NVPTX=0
@@ -180,8 +179,6 @@ if test x"$enable_offload_targets" != x; then
180 ;; 179 ;;
181 *) 180 *)
182 tgt_plugin=gcn 181 tgt_plugin=gcn
183 PLUGIN_GCN=$tgt
184 PLUGIN_GCN_LIBS="-ldl"
185 PLUGIN_GCN=1 182 PLUGIN_GCN=1
186 ;; 183 ;;
187 esac 184 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@
152CYGPATH_W = @CYGPATH_W@ 152CYGPATH_W = @CYGPATH_W@
153DEFS = @DEFS@ 153DEFS = @DEFS@
154DEPDIR = @DEPDIR@ 154DEPDIR = @DEPDIR@
155DL_LIBS = @DL_LIBS@
155DSYMUTIL = @DSYMUTIL@ 156DSYMUTIL = @DSYMUTIL@
156DUMPBIN = @DUMPBIN@ 157DUMPBIN = @DUMPBIN@
157ECHO_C = @ECHO_C@ 158ECHO_C = @ECHO_C@
@@ -209,7 +210,6 @@ PACKAGE_URL = @PACKAGE_URL@
209PACKAGE_VERSION = @PACKAGE_VERSION@ 210PACKAGE_VERSION = @PACKAGE_VERSION@
210PATH_SEPARATOR = @PATH_SEPARATOR@ 211PATH_SEPARATOR = @PATH_SEPARATOR@
211PERL = @PERL@ 212PERL = @PERL@
212PLUGIN_GCN_LIBS = @PLUGIN_GCN_LIBS@
213PLUGIN_NVPTX_CPPFLAGS = @PLUGIN_NVPTX_CPPFLAGS@ 213PLUGIN_NVPTX_CPPFLAGS = @PLUGIN_NVPTX_CPPFLAGS@
214PLUGIN_NVPTX_LDFLAGS = @PLUGIN_NVPTX_LDFLAGS@ 214PLUGIN_NVPTX_LDFLAGS = @PLUGIN_NVPTX_LDFLAGS@
215PLUGIN_NVPTX_LIBS = @PLUGIN_NVPTX_LIBS@ 215PLUGIN_NVPTX_LIBS = @PLUGIN_NVPTX_LIBS@