https://gcc.gnu.org/g:c650b557cb01f97bebb894aa68e5e74c2147c395

commit r15-8053-gc650b557cb01f97bebb894aa68e5e74c2147c395
Author: Thomas Schwinge <tho...@codesourcery.com>
Date:   Mon Jul 11 22:36:39 2022 +0200

    GCN, nvptx: Don't default-disable libstdc++ build
    
    In addition to making libstdc++ itself available, this, via enabling
    'build-gcc/*/libstdc++-v3/scripts/testsuite_flags', in particular also makes
    the standard C++ headers available to 'make check-gcc-c++'.  With that, 
there
    are a lot of FAIL/UNRESOLVED -> PASS progressions, where we previously ran
    into, for example:
    
        FAIL: g++.dg/coroutines/co-await-syntax-00-needs-expr.C  (test for 
errors, line 6)
        FAIL: g++.dg/coroutines/co-await-syntax-00-needs-expr.C (test for 
excess errors)
        Excess errors:
        [...]/gcc/testsuite/g++.dg/coroutines/coro.h:132:10: fatal error: 
cstdlib: No such file or directory
    
    Similarly, there are a lot of FAIL/UNRESOLVED -> UNSUPPORTED "progressions" 
due
    to 'sorry, unimplemented: exception handling not supported'.
    
    The 'make check-target-libstdc++-v3' results don't look too bad, either.
    
    This also reverts Subversion r221362
    (Git commit d94fae044da071381b73a2ee8afa874b14fa3820) "No libstdc++ for 
nvptx",
    and commit 2f4f3c0e9345805160ecacd6de527b519a8c9206 "No libstdc++ for GCN".
    
    With libstdc++ now available, libgrust gets enabled, which we in turn again
    have to disable, for 'sorry, unimplemented: exception handling not 
supported'
    reasons.
    
            PR target/92713
            PR target/101544
            * configure.ac [GCN, nvptx] (noconfigdirs): Don't add
            'target-libstdc++-v3'.  Add 'target-libgrust'.
            * configure: Regenerate.
            gcc/
            * config/gcn/gcn.h (LIBSTDCXX): Don't set.
            * config/nvptx/nvptx.h (LIBSTDCXX): Likewise.

Diff:
---
 configure                | 16 +++++++++++-----
 configure.ac             | 16 +++++++++++-----
 gcc/config/gcn/gcn.h     |  4 ----
 gcc/config/nvptx/nvptx.h |  4 ----
 4 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index 59a2a29e8799..e1063ccd9c3b 100755
--- a/configure
+++ b/configure
@@ -3431,10 +3431,6 @@ if test "${ENABLE_LIBSTDCXX}" = "default" ; then
       # VxWorks uses the Dinkumware C++ library.
       noconfigdirs="$noconfigdirs target-libstdc++-v3"
       ;;
-    amdgcn*-*-*)
-      # Not ported/fails to build when using newlib.
-      noconfigdirs="$noconfigdirs target-libstdc++-v3"
-      ;;
     arm*-wince-pe*)
       # the C++ libraries don't build on top of CE's C libraries
       noconfigdirs="$noconfigdirs target-libstdc++-v3"
@@ -4148,7 +4144,7 @@ case "${target}" in
     noconfigdirs="$noconfigdirs gprof"
     ;;
   nvptx*-*-*)
-    noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3"
+    noconfigdirs="$noconfigdirs target-libssp"
     ;;
   sh-*-*)
     case "${target}" in
@@ -10395,6 +10391,16 @@ case ,${enable_languages}, in
         # Disable target libgrust if we're not building target libstdc++.
         noconfigdirs="$noconfigdirs target-libgrust"
         ;;
+      *)
+       case "${target}" in
+         amdgcn*-*-* \
+         | nvptx*-*-* )
+           # Build fails in 'libgrust/libproc_macro_internal/':
+           #     sorry, unimplemented: exception handling not supported
+           noconfigdirs="$noconfigdirs target-libgrust"
+           ;;
+       esac
+       ;;
     esac
     ;;
 esac
diff --git a/configure.ac b/configure.ac
index 8967423ccdcf..eec6f817a4ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -657,10 +657,6 @@ if test "${ENABLE_LIBSTDCXX}" = "default" ; then
       # VxWorks uses the Dinkumware C++ library.
       noconfigdirs="$noconfigdirs target-libstdc++-v3"
       ;;
-    amdgcn*-*-*)
-      # Not ported/fails to build when using newlib.
-      noconfigdirs="$noconfigdirs target-libstdc++-v3"
-      ;;
     arm*-wince-pe*)
       # the C++ libraries don't build on top of CE's C libraries
       noconfigdirs="$noconfigdirs target-libstdc++-v3"
@@ -1365,7 +1361,7 @@ case "${target}" in
     noconfigdirs="$noconfigdirs gprof"
     ;;
   nvptx*-*-*)
-    noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3"
+    noconfigdirs="$noconfigdirs target-libssp"
     ;;
   sh-*-*)
     case "${target}" in
@@ -2696,6 +2692,16 @@ case ,${enable_languages}, in
         # Disable target libgrust if we're not building target libstdc++.
         noconfigdirs="$noconfigdirs target-libgrust"
         ;;
+      *)
+       case "${target}" in
+         amdgcn*-*-* \
+         | nvptx*-*-* )
+           # Build fails in 'libgrust/libproc_macro_internal/':
+           #     sorry, unimplemented: exception handling not supported
+           noconfigdirs="$noconfigdirs target-libgrust"
+           ;;
+       esac
+       ;;
     esac
     ;;
 esac
diff --git a/gcc/config/gcn/gcn.h b/gcc/config/gcn/gcn.h
index d7f92eb4b813..5198fbca2078 100644
--- a/gcc/config/gcn/gcn.h
+++ b/gcc/config/gcn/gcn.h
@@ -867,7 +867,3 @@ enum gcn_builtin_codes
       || M == V2SFmode || M == V2DImode || M == V2DFmode) \
    ? 2 \
    : 1)
-
-/* The C++ front end insists to link against libstdc++ -- which we don't build.
-   Tell it to instead link against the innocuous libgcc.  */
-#define LIBSTDCXX "gcc"
diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 1ec5f60fea7e..35ef4bdbd5e6 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -379,10 +379,6 @@ struct GTY(()) machine_function
 /* See 'libgcc/config/nvptx/crt0.c' for wrapping of 'main'.  */
 #define HAS_INIT_SECTION
 
-/* The C++ front end insists to link against libstdc++ -- which we don't build.
-   Tell it to instead link against the innocuous libgcc.  */
-#define LIBSTDCXX "gcc"
-
 /* The default doesn't fly ('internal compiler error: in simplify_subreg' when
    'dw2_assemble_integer' -> 'assemble_integer' attempts to simplify
    '(minus:DI (symbol_ref:DI ("$LEHB0")) (symbol_ref:DI ("$LFB3")))', for

Reply via email to