--- /dev/null
+// Specific definitions for nvptx platforms -*- C++ -*-
+
+// Copyright (C) 2025 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/cpu_defines.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly. @headername{iosfwd}
+ */
+
+#ifndef _GLIBCXX_CPU_DEFINES
+#define _GLIBCXX_CPU_DEFINES 1
+
+// No support for referencing weak symbols without a definition.
+#define _GLIBCXX_USE_WEAK_REF 0
+
+#endif
--- /dev/null
+# Per-file flags, see '../../../configure.host', "inject per-file flags".
+
+# 'ptxas'/CUDA Driver rejects objects with a lot of global constant data:
+# ptxas error : File uses too much global constant data ([...])
+# Cut short the assembly-time check; defer to actual use of the object file.
+AM_MAKEFLAGS += CXXFLAGS-src/c++17/floating_to_chars.lo=-Wa,--no-verify
+AM_MAKEFLAGS += CXXFLAGS-src/c++20/tzdb.lo=-Wa,--no-verify
arm*)
cpu_defines_dir=cpu/arm
;;
+ nvptx)
+ cpu_defines_dir=cpu/nvptx
+ ;;
powerpc* | rs6000)
cpu_defines_dir=cpu/powerpc
;;
arm*-*-freebsd*)
port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
;;
+ nvptx-*-none)
+ # For 'make all-target-libstdc++-v3', we need to inject per-file flags:
+ OPTIMIZE_CXXFLAGS="${OPTIMIZE_CXXFLAGS} \$(CXXFLAGS-\$(subdir)/\$@)"
+ # ..., see:
+ tmake_file="$tmake_file cpu/nvptx/t-nvptx"
+
+ # For 'make all-target-libstdc++-v3', re 'alloca'/VLA usage:
+ EXTRA_CFLAGS="${EXTRA_CFLAGS} -mfake-ptx-alloca"
+ OPTIMIZE_CXXFLAGS="${OPTIMIZE_CXXFLAGS} -mfake-ptx-alloca"
+ ;;
powerpc*-*-darwin*)
port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"
;;
abi_baseline_subdir_switch=--print-multi-os-directory
;;
esac
+
+
+# Dumb down libstdc++ for certain configurations.
+# THIS TABLE IS SORTED. KEEP IT THAT WAY.
+case "${host}" in
+ amdgcn-*-amdhsa \
+ | nvptx-*-none )
+ # For 'make all-target-libstdc++-v3' and 'make check-target-libstdc++-v3',
+ # exception handling is not supported: in case that exception handling
+ # constructs survive compiler optimizations, the back ends error out:
+ # sorry, unimplemented: exception handling not supported
+ EXTRA_CXX_FLAGS="${EXTRA_CXX_FLAGS} -fno-exceptions"
+
+ # For 'make all-target-libstdc++-v3' and 'make check-target-libstdc++-v3',
+ # RTTI is not supported.
+ EXTRA_CXX_FLAGS="${EXTRA_CXX_FLAGS} -fno-rtti"
+
+ # Cannot '#include' all newlib header files without explosion, for example:
+ # error: 'jmp_buf' was not declared in this scope
+ # Just disable generation of PCH files here, instead of attempting to care
+ # for such special cases in some more complex way.
+ enable_libstdcxx_pch=no
+ ;;
+esac