]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgomp/plugin/configfrag.ac
Remove support for Intel MIC offloading
[thirdparty/gcc.git] / libgomp / plugin / configfrag.ac
CommitLineData
41dbbb37
TS
1# Plugins for offload execution, configure.ac fragment. -*- mode: autoconf -*-
2#
7adcbafe 3# Copyright (C) 2014-2022 Free Software Foundation, Inc.
41dbbb37
TS
4#
5# Contributed by Mentor Embedded.
6#
7# This file is part of the GNU Offloading and Multi Processing Library
8# (libgomp).
9#
10# Libgomp is free software; you can redistribute it and/or modify it
11# under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 3, or (at your option)
13# any later version.
14#
15# Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
16# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17# FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18# more details.
19#
20# Under Section 7 of GPL version 3, you are granted additional
21# permissions described in the GCC Runtime Library Exception, version
22# 3.1, as published by the Free Software Foundation.
23#
24# You should have received a copy of the GNU General Public License and
25# a copy of the GCC Runtime Library Exception along with this program;
26# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
27# <http://www.gnu.org/licenses/>.
28
41dbbb37 29plugin_support=yes
dcc26679
TS
30DL_LIBS=
31AC_SUBST(DL_LIBS)
32AC_CHECK_LIB(dl, dlsym, [DL_LIBS=-ldl], [plugin_support=no])
41dbbb37
TS
33if test x"$plugin_support" = xyes; then
34 AC_DEFINE(PLUGIN_SUPPORT, 1,
35 [Define if all infrastructure, needed for plugins, is supported.])
41dbbb37
TS
36elif test "x${enable_offload_targets-no}" != xno; then
37 AC_MSG_ERROR([Can't support offloading without support for plugins])
38fi
b8d89b03
ML
39AC_CHECK_HEADERS_ONCE(unistd.h)
40AC_CHECK_FUNCS_ONCE(secure_getenv __secure_getenv getuid geteuid getgid getegid)
41
41dbbb37 42
41dbbb37 43PLUGIN_NVPTX=0
237957cc 44PLUGIN_GCN=0
ee332b4a
TS
45# Parse '--enable-offload-targets', figure out the corresponding libgomp
46# plugins, and configure to find the corresponding offload compilers.
0a0384b4 47# 'offload_plugins' and 'offload_targets' will be populated in the same order.
ee332b4a 48offload_plugins=
0a0384b4 49offload_targets=
ee332b4a 50AC_SUBST(offload_plugins)
0a0384b4 51AC_SUBST(offload_targets)
41dbbb37
TS
52offload_additional_options=
53offload_additional_lib_paths=
54AC_SUBST(offload_additional_options)
55AC_SUBST(offload_additional_lib_paths)
56if test x"$enable_offload_targets" != x; then
57 for tgt in `echo $enable_offload_targets | sed -e 's#,# #g'`; do
58 tgt_dir=`echo $tgt | grep '=' | sed 's/.*=//'`
59 tgt=`echo $tgt | sed 's/=.*//'`
ee332b4a 60 tgt_plugin=
41dbbb37 61 case $tgt in
41dbbb37 62 nvptx*)
6106dfb9
TS
63 case "${target}" in
64 aarch64*-*-* | powerpc64le-*-* | x86_64-*-*)
f65e551f
JJ
65 case "$ac_cv_sizeof_void_p" in
66 4)
6106dfb9
TS
67 # PR libgomp/65099: Currently, we only support offloading in
68 # 64-bit configurations.
69 PLUGIN_NVPTX=0
70 ;;
71 *)
72 tgt_plugin=nvptx
1459b55d 73 PLUGIN_NVPTX=1
6106dfb9
TS
74 ;;
75 esac
76 ;;
77 *-*-*)
78 # Target architecture not supported.
79 PLUGIN_NVPTX=0
80 ;;
41dbbb37
TS
81 esac
82 ;;
237957cc
AS
83 amdgcn*)
84 case "${target}" in
85 x86_64-*-*)
f65e551f
JJ
86 case "$ac_cv_sizeof_void_p" in
87 4)
237957cc
AS
88 PLUGIN_GCN=0
89 ;;
90 *)
91 tgt_plugin=gcn
237957cc
AS
92 PLUGIN_GCN=1
93 ;;
94 esac
95 ;;
96 *-*-*)
97 PLUGIN_GCN=0
98 ;;
99 esac
100 ;;
41dbbb37
TS
101 *)
102 AC_MSG_ERROR([unknown offload target specified])
103 ;;
104 esac
ee332b4a
TS
105 if test x"$tgt_plugin" = x; then
106 # Not configuring libgomp for this offload target if we're not building
107 # the corresponding offload plugin.
41d809d3 108 continue
ee332b4a
TS
109 elif test x"$offload_plugins" = x; then
110 offload_plugins=$tgt_plugin
0a0384b4 111 offload_targets=$tgt
41dbbb37 112 else
ee332b4a 113 offload_plugins=$offload_plugins,$tgt_plugin
0a0384b4 114 offload_targets=$offload_targets,$tgt
41dbbb37 115 fi
ee332b4a 116 # Configure additional search paths.
c56684fd 117 if test x"$tgt_dir" != x; then
52f42dce 118 offload_additional_options="$offload_additional_options -B$tgt_dir/\$(libexecdir:\$(exec_prefix)/%=%)/gcc/\$(target_alias)/\$(gcc_version) -B$tgt_dir/bin"
41dbbb37
TS
119 offload_additional_lib_paths="$offload_additional_lib_paths:$tgt_dir/lib64:$tgt_dir/lib:$tgt_dir/lib32"
120 else
121 offload_additional_options="$offload_additional_options -B\$(libexecdir)/gcc/\$(target_alias)/\$(gcc_version) -B\$(bindir)"
122 offload_additional_lib_paths="$offload_additional_lib_paths:$toolexeclibdir"
123 fi
124 done
125fi
ee332b4a
TS
126AC_DEFINE_UNQUOTED(OFFLOAD_PLUGINS, "$offload_plugins",
127 [Define to offload plugins, separated by commas.])
41dbbb37 128AM_CONDITIONAL([PLUGIN_NVPTX], [test $PLUGIN_NVPTX = 1])
237957cc 129AM_CONDITIONAL([PLUGIN_GCN], [test $PLUGIN_GCN = 1])