Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#66864 - [gcc] c++ mutex uses undefined function pthread_mutex_clocklock

Attached to Project: Arch Linux
Opened by Kristoffel Pirard (xtofl) - Tuesday, 02 June 2020, 12:39 GMT
Last edited by Allan McRae (Allan) - Tuesday, 02 June 2020, 12:55 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

In gcc-10's libstdc++, condition variables require the function `pthread_mutex_clocklock`, which was introduced
in libc 2.30. However, the gcc 10.1.0-2 package depends on gcclibs 10.1.0-2, which includes glibc>=2.27. This
leaves 3 minors of glibc not upgraded by installing gcc-10.1.0-2.

Cf. announcement http://randombitsofuselessinformation.blogspot.com/2019/09/stdconditionvariable-will-work.html
Cf. patch https://gcc.gnu.org/legacy-ml/gcc-patches/2019-10/msg01118.html


Additional info:
* package version(s) 10.1.0-2
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:

Upgrade gcc from version 9 to 10. Set glibc to 2.28. Compile this snippet:

```
#include <mutex>

int main() {
std::timed_mutex m;
if (m.try_lock()) {
m.unlock();
}
}
```

Results:

```
$ g++ xtofl.cpp
In file included from xtofl.cpp:1:
/usr/include/c++/10.1.0/mutex: In member function ‘bool std::timed_mutex::_M_clocklock(clockid_t, const __gthread_time_t&)’:
/usr/include/c++/10.1.0/mutex:270:17: error: ‘pthread_mutex_clocklock’ was not declared in this scope; did you mean ‘pthread_mutex_unlock’?
270 | { return !pthread_mutex_clocklock(&_M_mutex, clockid, &__ts); }
| ^~~~~~~~~~~~~~~~~~~~~~~
| pthread_mutex_unlock
/usr/include/c++/10.1.0/mutex: In member function ‘bool std::recursive_timed_mutex::_M_clocklock(clockid_t, const __gthread_time_t&)’:
/usr/include/c++/10.1.0/mutex:336:17: error: ‘pthread_mutex_clocklock’ was not declared in this scope; did you mean ‘pthread_mutex_unlock’?
336 | { return !pthread_mutex_clocklock(&_M_mutex, clockid, &__ts); }
| ^~~~~~~~~~~~~~~~~~~~~~~
| pthread_mutex_unlock
compilation terminated.
```

This task depends upon

Closed by  Allan McRae (Allan)
Tuesday, 02 June 2020, 12:55 GMT
Reason for closing:  Not a bug
Additional comments about closing:  partial updates are not supported
Comment by Kristoffel Pirard (xtofl) - Tuesday, 02 June 2020, 12:47 GMT
Erratum: the problem occurs with glibc v2.29; something else happens with v2.28 (make: /usr/lib/libm.so.6: version `GLIBC_2.29' not found (required by /usr/lib/libguile-2.2.so.1))

Loading...