On 09/03/2026 16:00, Tobias Burnus wrote:
Tobias Burnus wrote:
That patch just disables for the
non-offload compiler -fexceptions by default, but not if explicitly
enabled by the user. The latter will then run into the sorry mentioned
above, unless -mfake-exceptions has been specified on top.
Thomas mentioned that in principle it should work without this
patch as there is the following in commit
r15-8052-g1268924a2eed4e GCN, nvptx: Allow for "hosted" libstdc++ build
https://gcc.gnu.org/cgit/gcc/commit?id=1268924a2eed4e
Namely, it adds code to libstdc++-v3/configure.host to add -fno-exceptions
with the goal that it enables testing.
I have no idea why it worked for Thomas in one way of testing and fails
here
with another - nor whether it makes sense to have this patch nonetheless or
not. I find the error with this patch more helpful than without and it also
permits using
#if __EXCEPTIONS (with GCC and Clang)
or more modern
#if __cpp_exceptions
which seems to be sensible
Thus, with the caveat that it is not quite clear to me what Thomas' patch
does nor why it worked for him but not here, I still think that this patch
makes sense.
Thoughts?
I don't understand what Thomas's "sufficient chaos in the C++ front end
test suite" means. It sounds like applying your patch will perturb his
testing?
Andrew
Tobias
PS: If this patch is applied, I wonder whether the amdgcn part of the
host config could be removed? This requires removing the if-not-offload
compiler and the setting has to be based on -mfake-exceptions that
mkoffload
passes unconditionally (see attached patch, untested).