Hi!

On 2026-03-09T16:29:29+0100, Tobias Burnus <[email protected]> wrote:
> The main motivation for this change to enable the libstdc++
> testsuite with stand-alone GCN testing (gcn-run). Without, the
> support file libstdc++-v3/testsuite/util/testsuite_abi.cc fails:
>    util/testsuite_abi.h:68: sorry, unimplemented: exception handling not 
> supported

NACK.  The testing framework you're using must be doing something "funny"
-- upstream libstdc++ build/test already is doing with '-fno-exceptions'
etc.:

    commit r15-8052-g1268924a2eed4e4f4cf1f43cc996b2f0eedeb07e
    Author: Thomas Schwinge <[email protected]>
    Date:   Thu Feb 20 16:31:50 2025 +0100
    
        GCN, nvptx: Allow for "hosted" libstdc++ build
    
        We need '-fno-exceptions', '-fno-rtti', disable generation of PCH 
files, and
        for nvptx twiddle some more knobs.
    [...]
    --- a/libstdc++-v3/configure.host
    +++ b/libstdc++-v3/configure.host
    [...]
    +# 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"
    [...]

> As mentioned in the patch description, libstdc++ works when
> the attached patch is attached. 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.
>
> This seems to be somewhat sensible and consistent behavior and
> also one of the simplest and cleanest ways to permit running the
> libstdc++ testsuite.

Something like that was my first approach indeed -- but tuns out, that
causes sufficient chaos in the C++ front end test suite; way easier to
build these compiler test cases with default '-fexceptions', and instead
handle the 'sorry, unimplemented: exception handling not supported'
appropriately in the testing framework (turn into
'UNSUPPORTED: [...]: exception handling not supported').  I’m happy to
dig out the relevant commits, if you’d like to see the details.


Grüße
 Thomas


>
> OK for mainline?
>
> * * *
>
> I have tested this with stand-alone offloading to an MI210; while it hasn't
> finished, the in-between result looks fine:
> PASS    5616, FAIL    311, UNSUPPORTED     798, XFAIL   40
>
> I have also run the c++.exp testcases of libgomp with x86-64 + GCN offload,
> which seem to still work fine.
>
> Tobias

Reply via email to