From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BC493896C0D; Wed, 21 Jul 2021 09:33:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BC493896C0D From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/101544] [OpenMP][AMDGCN][nvptx] C++ offloading: unresolved _Znwm = "operator new(unsigned long)" Date: Wed, 21 Jul 2021 09:33:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: openmp, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 09:33:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101544 --- Comment #4 from Jonathan Wakely --- (In reply to Andrew Stubbs from comment #3) > C++ offloading works fine provided that there are no library calls or > exceptions. There's no reason std::pair, std::tuple, std::optional and types like that shouldn't work. Just making it possible to compile with -fno-rtti -fno-exceptions would be a start, and would avoid the need for exception handling. Libstdc++ headers already work fine with those options, and it should be possible to build the library itself that way (or it's a bug that can be fixed). > Ignoring unsupported C++ language features, for now, I don't think there's > any reason why libstdc++ would need to be cut down. We already build the > full libgfortran for amdgcn. System calls that make no sense on the GPU w= ere > implemented as stubs in Newlib (mostly returning some reasonable errno > value), and it would be straight-forward to implement more the same way. But it's a waste of space in the .so to build lots of symbols that use the stubs. There are other reasons it might be nice to be able to configure libstdc++ = for something in between a full hosted environment and a minimal freestanding o= ne. > I believe static constructors work (libgfortran uses some), but exception > handling does not. I'm not sure what other exotica C++ might need? Ideally, __cxa_atexit and __cxa_thread_atexit for static and thread-local destructors, but we can survive without them (and have not-fully-conforming destruction ordering).=