public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/64203] New: shared_mutex compile errors on bare-metal targets
@ 2014-12-05 21:00 sandra at codesourcery dot com
  2014-12-05 23:55 ` [Bug libstdc++/64203] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sandra at codesourcery dot com @ 2014-12-05 21:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64203

            Bug ID: 64203
           Summary: shared_mutex compile errors on bare-metal targets
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sandra at codesourcery dot com
                CC: 3dw4rd at verizon dot net

After merging GCC 4.9.2 onto our local branch, I saw that the new libstdc++
testcase experimental/feat-cxx14.cc is failing on bare-metal targets
(arm-none-eabi, mips-sde-elf, powerpc-eabi, possibly others).  Here's an
excerpt from the test logs:

Executing on host: mips-sde-elf-g++ -fdiagnostics-color=never -D_GLIBCXX_ASSERT
-fmessage-length=0  -g -O2 -DLOCALEDIR="."
-I/scratch/sandra/mips-elf-trunk/src/gcc-trunk-4.9/libstdc++-v3/testsuite/util
/scratch/sandra/mips-elf-trunk/src/gcc-trunk-4.9/libstdc++-v3/testsuite/experimental/feat-cxx14.cc
  -std=gnu++14 -S    -mips16 -o feat-cxx14.s    (timeout = 600)
/scratch/sandra/mips-elf-trunk/src/gcc-trunk-4.9/libstdc++-v3/testsuite/experimental/feat-cxx14.cc:110:4:
error: #error "__cpp_lib_shared_timed_mutex"
 #  error "__cpp_lib_shared_timed_mutex"
    ^
In file included from
/scratch/sandra/mips-elf-trunk/src/gcc-trunk-4.9/libstdc++-v3/testsuite/experimental/feat-cxx14.cc:13:0:
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:274:36:
error: 'defer_lock_t' has not been declared
       shared_lock(mutex_type& __m, defer_lock_t) noexcept
                                    ^
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:277:36:
error: 'try_to_lock_t' has not been declared
       shared_lock(mutex_type& __m, try_to_lock_t)
                                    ^
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:277:7:
error:
'std::shared_lock<_Mutex>::shared_lock(std::shared_lock<_Mutex>::mutex_type&,
int)' cannot be overloaded
       shared_lock(mutex_type& __m, try_to_lock_t)
       ^
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:274:7:
error: with
'std::shared_lock<_Mutex>::shared_lock(std::shared_lock<_Mutex>::mutex_type&,
int)'
       shared_lock(mutex_type& __m, defer_lock_t) noexcept
       ^
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:280:36:
error: 'adopt_lock_t' has not been declared
       shared_lock(mutex_type& __m, adopt_lock_t)
                                    ^
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:280:7:
error:
'std::shared_lock<_Mutex>::shared_lock(std::shared_lock<_Mutex>::mutex_type&,
int)' cannot be overloaded
       shared_lock(mutex_type& __m, adopt_lock_t)
       ^
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:274:7:
error: with
'std::shared_lock<_Mutex>::shared_lock(std::shared_lock<_Mutex>::mutex_type&,
int)'
       shared_lock(mutex_type& __m, defer_lock_t) noexcept
       ^
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:
In member function 'void std::shared_lock<_Mutex>::unlock()':
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:347:29:
error: 'errc' was not declared in this scope
    __throw_system_error(int(errc::resource_deadlock_would_occur));
                             ^
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:
In member function 'void std::shared_lock<_Mutex>::_M_lockable() const':
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:381:29:
error: 'errc' was not declared in this scope
    __throw_system_error(int(errc::operation_not_permitted));
                             ^
/scratch/sandra/mips-elf-trunk/install/opt/codesourcery/mips-sde-elf/include/c++/4.9.2/shared_mutex:383:29:
error: 'errc' was not declared in this scope
    __throw_system_error(int(errc::resource_deadlock_would_occur));
                             ^
compiler exited with status 1

I am guessing this part of <shared_mutex> is to blame:

#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
# include <mutex>
# include <condition_variable>
#endif

Because of the guards, I think <mutex> is not being included and nothing else
is providing declarations of the missing identifiers.  I don't know my way
around this code or the C++ library specification at all, though.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/64203] shared_mutex compile errors on bare-metal targets
  2014-12-05 21:00 [Bug libstdc++/64203] New: shared_mutex compile errors on bare-metal targets sandra at codesourcery dot com
@ 2014-12-05 23:55 ` redi at gcc dot gnu.org
  2014-12-06  2:13 ` sandra at codesourcery dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-05 23:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64203

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Created attachment 34208
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34208&action=edit
fix config macros for shared_lock

Does this fix it?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/64203] shared_mutex compile errors on bare-metal targets
  2014-12-05 21:00 [Bug libstdc++/64203] New: shared_mutex compile errors on bare-metal targets sandra at codesourcery dot com
  2014-12-05 23:55 ` [Bug libstdc++/64203] " redi at gcc dot gnu.org
@ 2014-12-06  2:13 ` sandra at codesourcery dot com
  2014-12-06 16:49 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sandra at codesourcery dot com @ 2014-12-06  2:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64203

--- Comment #2 from Sandra Loosemore <sandra at codesourcery dot com> ---
(In reply to Jonathan Wakely from comment #1)
> Created attachment 34208 [details]
> fix config macros for shared_lock
> 
> Does this fix it?

No, with this patch I'm still getting the same undefined symbol errors about
defer_lock_t, try_to_lock_t, etc.

FAOD it looks like on this target _GLIBCXX_USE_C99_STDINT_TR1 is defined but
_GLIBCXX_HAS_GTHREADS is not.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/64203] shared_mutex compile errors on bare-metal targets
  2014-12-05 21:00 [Bug libstdc++/64203] New: shared_mutex compile errors on bare-metal targets sandra at codesourcery dot com
  2014-12-05 23:55 ` [Bug libstdc++/64203] " redi at gcc dot gnu.org
  2014-12-06  2:13 ` sandra at codesourcery dot com
@ 2014-12-06 16:49 ` redi at gcc dot gnu.org
  2014-12-06 19:38 ` sandra at codesourcery dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-06 16:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64203

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34208|0                           |1
        is obsolete|                            |

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Created attachment 34210
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34210&action=edit
fix config macros for shared_lock

(In reply to Sandra Loosemore from comment #2)
> FAOD it looks like on this target _GLIBCXX_USE_C99_STDINT_TR1 is defined but
> _GLIBCXX_HAS_GTHREADS is not.

Right, which means that defer_lock_t etc should be defined, but my patch was
incomplete and <shared_mutex> didn't include <mutex> to get those definitions.

How's this one?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/64203] shared_mutex compile errors on bare-metal targets
  2014-12-05 21:00 [Bug libstdc++/64203] New: shared_mutex compile errors on bare-metal targets sandra at codesourcery dot com
                   ` (2 preceding siblings ...)
  2014-12-06 16:49 ` redi at gcc dot gnu.org
@ 2014-12-06 19:38 ` sandra at codesourcery dot com
  2014-12-09 11:04 ` redi at gcc dot gnu.org
  2014-12-09 11:55 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: sandra at codesourcery dot com @ 2014-12-06 19:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64203

--- Comment #4 from Sandra Loosemore <sandra at codesourcery dot com> ---
(In reply to Jonathan Wakely from comment #3)
> How's this one?

Looks better; this version fixes the compile-time errors.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/64203] shared_mutex compile errors on bare-metal targets
  2014-12-05 21:00 [Bug libstdc++/64203] New: shared_mutex compile errors on bare-metal targets sandra at codesourcery dot com
                   ` (3 preceding siblings ...)
  2014-12-06 19:38 ` sandra at codesourcery dot com
@ 2014-12-09 11:04 ` redi at gcc dot gnu.org
  2014-12-09 11:55 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-09 11:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64203

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Tue Dec  9 11:03:57 2014
New Revision: 218511

URL: https://gcc.gnu.org/viewcvs?rev=218511&root=gcc&view=rev
Log:
    PR libstdc++/64203
    * include/std/shared_mutex: Fix preprocessor conditions.
    * testsuite/experimental/feat-cxx14.cc: Check conditions.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/std/shared_mutex
    trunk/libstdc++-v3/testsuite/experimental/feat-cxx14.cc


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/64203] shared_mutex compile errors on bare-metal targets
  2014-12-05 21:00 [Bug libstdc++/64203] New: shared_mutex compile errors on bare-metal targets sandra at codesourcery dot com
                   ` (4 preceding siblings ...)
  2014-12-09 11:04 ` redi at gcc dot gnu.org
@ 2014-12-09 11:55 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-09 11:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64203

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.3

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Please re-open if this isn't fixed now.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-12-09 11:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-05 21:00 [Bug libstdc++/64203] New: shared_mutex compile errors on bare-metal targets sandra at codesourcery dot com
2014-12-05 23:55 ` [Bug libstdc++/64203] " redi at gcc dot gnu.org
2014-12-06  2:13 ` sandra at codesourcery dot com
2014-12-06 16:49 ` redi at gcc dot gnu.org
2014-12-06 19:38 ` sandra at codesourcery dot com
2014-12-09 11:04 ` redi at gcc dot gnu.org
2014-12-09 11:55 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).