aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/gcn/mkoffload.cc3
-rw-r--r--gcc/config/nvptx/mkoffload.cc3
-rw-r--r--gcc/gcc.cc3
3 files changed, 6 insertions, 3 deletions
diff --git a/gcc/config/gcn/mkoffload.cc b/gcc/config/gcn/mkoffload.cc
index fbd68a6..f5b89c9 100644
--- a/gcc/config/gcn/mkoffload.cc
+++ b/gcc/config/gcn/mkoffload.cc
@@ -1070,7 +1070,8 @@ main (int argc, char **argv)
#undef STR
/* Translate host into offloading libraries. */
else if (strcmp (argv[i], "-l_GCC_gfortran") == 0
- || strcmp (argv[i], "-l_GCC_m") == 0)
+ || strcmp (argv[i], "-l_GCC_m") == 0
+ || strcmp (argv[i], "-l_GCC_stdc++") == 0)
{
/* Elide '_GCC_'. */
size_t i_dst = strlen ("-l");
diff --git a/gcc/config/nvptx/mkoffload.cc b/gcc/config/nvptx/mkoffload.cc
index 958e16f..bdfe7f5 100644
--- a/gcc/config/nvptx/mkoffload.cc
+++ b/gcc/config/nvptx/mkoffload.cc
@@ -741,7 +741,8 @@ main (int argc, char **argv)
dumppfx = argv[++i];
/* Translate host into offloading libraries. */
else if (strcmp (argv[i], "-l_GCC_gfortran") == 0
- || strcmp (argv[i], "-l_GCC_m") == 0)
+ || strcmp (argv[i], "-l_GCC_m") == 0
+ || strcmp (argv[i], "-l_GCC_stdc++") == 0)
{
/* Elide '_GCC_'. */
size_t i_dst = strlen ("-l");
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index c7b2aa6..3edd21f 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -4154,7 +4154,8 @@ forward_offload_option (size_t opt_index, const char *arg, bool validated)
are injected by default in offloading compilation, and therefore not
forwarded here. */
/* GCC libraries. */
- if (/* '-lgfortran' */ strcmp (arg, "gfortran") == 0 )
+ if (/* '-lgfortran' */ strcmp (arg, "gfortran") == 0
+ || /* '-lstdc++' */ strcmp (arg, "stdc++") == 0)
save_switch (concat ("-foffload-options=-l_GCC_", arg, NULL),
0, NULL, validated, true);
/* Other libraries. */