Bug 100179 - [12 regression] xtreme-header-2_a.H fails on arm-eabi
Summary: [12 regression] xtreme-header-2_a.H fails on arm-eabi
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-21 11:54 UTC by Christophe Lyon
Modified: 2021-04-23 08:41 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Lyon 2021-04-21 11:54:05 UTC
Between r11-8253 and r12-12, I've noticed new failures on arm-eabi (using newlib)
    g++.dg/modules/xtreme-header-2_a.H -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header-2_a.H -std=c++2b (test for excess errors)
    g++.dg/modules/xtreme-header-2_a.H module-cmi  (gcm.cache/$srcdir/g++.dg/modules/xtreme-header-2_a.H.gcm)
    g++.dg/modules/xtreme-header-2_b.C -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
    g++.dg/modules/xtreme-header-2_c.C -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header-2_c.C -std=c++2b (test for excess errors)
    g++.dg/modules/xtreme-header-5_a.H -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header-5_a.H -std=c++2b (test for excess errors)
    g++.dg/modules/xtreme-header-5_a.H module-cmi  (gcm.cache/$srcdir/g++.dg/modules/xtreme-header-5_a.H.gcm)
    g++.dg/modules/xtreme-header-5_b.C -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header-5_b.C -std=c++2b (test for excess errors)
    g++.dg/modules/xtreme-header-5_c.C -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header-5_c.C -std=c++2b (test for excess errors)
    g++.dg/modules/xtreme-header-6_a.H -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header-6_a.H -std=c++2b (test for excess errors)
    g++.dg/modules/xtreme-header-6_a.H module-cmi  (gcm.cache/$srcdir/g++.dg/modules/xtreme-header-6_a.H.gcm)
    g++.dg/modules/xtreme-header-6_b.C -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header-6_b.C -std=c++2b (test for excess errors)
    g++.dg/modules/xtreme-header-6_c.C -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header-6_c.C -std=c++2b (test for excess errors)
    g++.dg/modules/xtreme-header_a.H -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header_a.H -std=c++2b (test for excess errors)
    g++.dg/modules/xtreme-header_a.H module-cmi  (gcm.cache/$srcdir/g++.dg/modules/xtreme-header_a.H.gcm)
    g++.dg/modules/xtreme-header_b.C -std=c++2a (test for excess errors)
    g++.dg/modules/xtreme-header_b.C -std=c++2b (test for excess errors)


g++.log says:
FAIL: g++.dg/modules/xtreme-header-2_a.H -std=c++2a (test for excess errors)
Excess errors:
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/bits/semaphore_base.h:259:4: error: #error "No suitable semaphore implementation available"
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:43:42: error: '__semaphore_impl' has not been declared
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:47:42: error: '__semaphore_impl' has not been declared
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:49:7: error: '__semaphore_impl' does not name a type
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:66:57: error: '_M_sem' was not declared in this scope
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:70:35: error: '_M_sem' was not declared in this scope
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:74:39: error: '_M_sem' was not declared in this scope
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:53:11: error: class 'std::counting_semaphore<__least_max_value>' does not have any field named '_M_sem'
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:67:9: error: '_M_sem' was not declared in this scope
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:71:9: error: '_M_sem' was not declared in this scope
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:75:16: error: '_M_sem' was not declared in this scope
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:80:18: error: '_M_sem' was not declared in this scope
/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/arm-none-eabi/libstdc++-v3/include/semaphore:85:18: error: '_M_sem' was not declared in this scope
/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: warning: not writing module '/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H' due to errors
Comment 1 Christophe Lyon 2021-04-21 11:55:32 UTC
Similar errors noticed in libstdc++ testsuite:
    17_intro/headers/c++2020/all_attributes.cc (test for excess errors)
    17_intro/headers/c++2020/all_no_exceptions.cc (test for excess errors)
    17_intro/headers/c++2020/all_no_rtti.cc (test for excess errors)
    17_intro/headers/c++2020/all_pedantic_errors.cc (test for excess errors)
    17_intro/headers/c++2020/operator_names.cc (test for excess errors)
    17_intro/headers/c++2020/stdc++.cc (test for excess errors)
    17_intro/headers/c++2020/stdc++_multiple_inclusion.cc (test for excess errors)
    20_util/polymorphic_allocator/allocate_object.cc (test for excess errors)
    20_util/polymorphic_allocator/construct_c++2a.cc (test for excess errors)
    20_util/polymorphic_allocator/lwg3237.cc (test for excess errors)
    20_util/scoped_allocator/construct_pair_c++2a.cc (test for excess errors)
    20_util/uses_allocator/make_obj.cc (test for excess errors)
    21_strings/basic_string/hash/hash_char8_t.cc (test for excess errors)
    24_iterators/normal_iterator/cmp_c++20.cc (test for excess errors)
    27_io/basic_istringstream/cons/char/1.cc (test for excess errors)
    27_io/basic_istringstream/cons/wchar_t/1.cc (test for excess errors)
    27_io/basic_istringstream/str/char/2.cc (test for excess errors)
    27_io/basic_istringstream/str/wchar_t/2.cc (test for excess errors)
    27_io/basic_ostringstream/cons/char/1.cc (test for excess errors)
    27_io/basic_ostringstream/cons/wchar_t/1.cc (test for excess errors)
    27_io/basic_ostringstream/str/char/3.cc (test for excess errors)
    27_io/basic_ostringstream/str/wchar_t/3.cc (test for excess errors)
    27_io/basic_stringbuf/cons/char/2.cc (test for excess errors)
    27_io/basic_stringbuf/cons/wchar_t/2.cc (test for excess errors)
    27_io/basic_stringbuf/str/char/4.cc (test for excess errors)
    27_io/basic_stringbuf/str/wchar_t/4.cc (test for excess errors)
    27_io/basic_stringstream/cons/char/1.cc (test for excess errors)
    27_io/basic_stringstream/cons/wchar_t/1.cc (test for excess errors)
    27_io/basic_stringstream/str/char/5.cc (test for excess errors)
    27_io/basic_stringstream/str/wchar_t/5.cc.cc (test for excess errors)
    27_io/basic_syncbuf/basic_ops/1.cc (test for excess errors)
    27_io/basic_syncstream/basic_ops/1.cc (test for excess errors)
Comment 2 Jonathan Wakely 2021-04-21 14:26:56 UTC
I have a patch for this.
Comment 3 GCC Commits 2021-04-22 12:59:36 UTC
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:4b2db8077136d2f8b5a0db026e6161810be327b3

commit r12-59-g4b2db8077136d2f8b5a0db026e6161810be327b3
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Apr 22 11:10:06 2021 +0100

    libstdc++: Remove #error from <semaphore> implementation [PR 100179]
    
    This removes the #error from <bits/semaphore_base.h> for the case where
    neither __atomic_semaphore nor __platform_semaphore is defined.
    
    Also rename the _GLIBCXX_REQUIRE_POSIX_SEMAPHORE macro to
    _GLIBCXX_USE_POSIX_SEMAPHORE for consistency with the similar
    _GLIBCXX_USE_CXX11_ABI macro that can be used to request an alternative
    (ABI-changing) implementation.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/100179
            * include/bits/semaphore_base.h: Remove #error.
            * include/std/semaphore: Do not define anything unless one of
            the implementations is available.
Comment 4 GCC Commits 2021-04-22 13:37:33 UTC
The releases/gcc-11 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:718fcebe8b65e98b794f9a53ce7358e034657588

commit r11-8282-g718fcebe8b65e98b794f9a53ce7358e034657588
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Apr 22 11:10:06 2021 +0100

    libstdc++: Remove #error from <semaphore> implementation [PR 100179]
    
    This removes the #error from <bits/semaphore_base.h> for the case where
    neither __atomic_semaphore nor __platform_semaphore is defined.
    
    Also rename the _GLIBCXX_REQUIRE_POSIX_SEMAPHORE macro to
    _GLIBCXX_USE_POSIX_SEMAPHORE for consistency with the similar
    _GLIBCXX_USE_CXX11_ABI macro that can be used to request an alternative
    (ABI-changing) implementation.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/100179
            * include/bits/semaphore_base.h: Remove #error.
            * include/std/semaphore: Do not define anything unless one of
            the implementations is available.
    
    (cherry picked from commit 4b2db8077136d2f8b5a0db026e6161810be327b3)
Comment 5 Jonathan Wakely 2021-04-22 13:38:15 UTC
I think this should be fixed now, but please shout and/or reopen this if not.
Comment 6 Christophe Lyon 2021-04-23 08:36:00 UTC
Yes, I confirm it's now fixed, thanks!
Comment 7 Jonathan Wakely 2021-04-23 08:41:55 UTC
Great, thanks for report, so that this could be fixed for gcc-11.