Bug 10899 - g++ built without --enable-libstdcxx-time breaks C++11 thread API
Summary: g++ built without --enable-libstdcxx-time breaks C++11 thread API
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 3
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: has_procedure mga3-64-ok advisory MGA...
Keywords: validated_update
Depends on:
Blocks:
 
Reported: 2013-08-02 06:25 CEST by Daniel Osmari
Modified: 2013-11-30 23:02 CET (History)
6 users (show)

See Also:
Source RPM: gcc-4.7.2-8.1.mga3
CVE:
Status comment:


Attachments

Description Daniel Osmari 2013-08-02 06:25:36 CEST
The gcc-c++-4.7.2-7.mga3 package is incorrectly built.

An important C++11 feature is not enabled due to the compiler being built without the --enable-libstdcxx-time option.

More details here:

http://stackoverflow.com/questions/12523122/what-is-glibcxx-use-nanosleep-all-about



Steps to reproduce:


Type this in a shell:

g++ -x c++ -std=c++11 - << EOF
#include <thread>
#include <chrono>

int main()
{
    std::this_thread::yield();
    std::this_thread::sleep_for(std::chrono::milliseconds(10));
    std::this_thread::sleep_until(std::chrono::steady_clock::now());
}
EOF


The result will be:

<stdin>: In function âint main()â:
<stdin>:6:5: error: âyieldâ is not a member of âstd::this_threadâ
<stdin>:7:5: error: âsleep_forâ is not a member of âstd::this_threadâ
<stdin>:8:5: error: âsleep_untilâ is not a member of âstd::this_threadâ



Current workaround is to tediously add "-D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD" to the command line, or edit 
"/usr/include/c++/4.7.2/x86_64-mageia-linux-gnu/bits/c++config.h" to define these macros by hand permanently.


Proper workaround is to rebuild GCC passing "--enable-libstdcxx-time" to the configure script.
Daniel Osmari 2013-08-02 06:27:36 CEST

CC: (none) => danielosmari
Source RPM: (none) => gcc-c++-4.7.2-7.mga3

Sander Lepik 2013-08-02 10:31:07 CEST

CC: (none) => mageia
Assignee: bugsquad => tmb

Comment 1 Thomas Backlund 2013-08-06 22:45:58 CEST
Indeed, seems no-one was needing / using any C++11 thread stuff...

I will fix it in an update for mga3.

for cauldron / mga4 it will be "automatically" fixed when I switch over to gcc-4.8.2 in ~1 week

Status: NEW => ASSIGNED

Comment 2 Thomas Backlund 2013-09-24 23:29:55 CEST
gcc-4.7.2-8.mga3 submitted to testing
Comment 3 Thomas Backlund 2013-11-18 23:16:36 CET
Advisory:
gcc in mga3 release does not support the C++ nanosleep(),
as it was not properly configured at gcc build time.

This update resolves this by properly enabling nanosleep() support.
It also fixes a reverse sort speed regression since gcc-4.4 
(PR libstdc++/58437) 



SRPM:
gcc-4.7.2-8.1.mga3.src.rpm

i586:
gcc-4.7.2-8.1.mga3.i586.rpm
gcc-c++-4.7.2-8.1.mga3.i586.rpm
gcc-cpp-4.7.2-8.1.mga3.i586.rpm
gcc-doc-4.7.2-8.1.mga3.noarch.rpm
gcc-doc-pdf-4.7.2-8.1.mga3.noarch.rpm
gcc-gfortran-4.7.2-8.1.mga3.i586.rpm
gcc-gnat-4.7.2-8.1.mga3.i586.rpm
gcc-java-4.7.2-8.1.mga3.i586.rpm
gcc-objc-4.7.2-8.1.mga3.i586.rpm
gcc-objc++-4.7.2-8.1.mga3.i586.rpm
gcc-plugins-4.7.2-8.1.mga3.i586.rpm
gcj-tools-4.7.2-8.1.mga3.i586.rpm
libgcc1-4.7.2-8.1.mga3.i586.rpm
libgcj13-4.7.2-8.1.mga3.i586.rpm
libgcj13-base-4.7.2-8.1.mga3.i586.rpm
libgcj13-src-4.7.2-8.1.mga3.i586.rpm
libgcj_bc1-4.7.2-8.1.mga3.i586.rpm
libgcj-devel-4.7.2-8.1.mga3.i586.rpm
libgcj-static-devel-4.7.2-8.1.mga3.i586.rpm
libgfortran3-4.7.2-8.1.mga3.i586.rpm
libgnat1-4.7.2-8.1.mga3.i586.rpm
libgomp1-4.7.2-8.1.mga3.i586.rpm
libgomp-devel-4.7.2-8.1.mga3.i586.rpm
libitm1-4.7.2-8.1.mga3.i586.rpm
libitm-devel-4.7.2-8.1.mga3.i586.rpm
libmudflap0-4.7.2-8.1.mga3.i586.rpm
libmudflap-devel-4.7.2-8.1.mga3.i586.rpm
libobjc4-4.7.2-8.1.mga3.i586.rpm
libquadmath0-4.7.2-8.1.mga3.i586.rpm
libquadmath-devel-4.7.2-8.1.mga3.i586.rpm
libstdc++6-4.7.2-8.1.mga3.i586.rpm
libstdc++-devel-4.7.2-8.1.mga3.i586.rpm
libstdc++-docs-4.7.2-8.1.mga3.noarch.rpm
libstdc++-static-devel-4.7.2-8.1.mga3.i586.rpm


x86_64:
gcc-4.7.2-8.1.mga3.x86_64.rpm
gcc-c++-4.7.2-8.1.mga3.x86_64.rpm
gcc-cpp-4.7.2-8.1.mga3.x86_64.rpm
gcc-doc-4.7.2-8.1.mga3.noarch.rpm
gcc-doc-pdf-4.7.2-8.1.mga3.noarch.rpm
gcc-gfortran-4.7.2-8.1.mga3.x86_64.rpm
gcc-gnat-4.7.2-8.1.mga3.x86_64.rpm
gcc-java-4.7.2-8.1.mga3.x86_64.rpm
gcc-objc-4.7.2-8.1.mga3.x86_64.rpm
gcc-objc++-4.7.2-8.1.mga3.x86_64.rpm
gcc-plugins-4.7.2-8.1.mga3.x86_64.rpm
gcj-tools-4.7.2-8.1.mga3.x86_64.rpm
lib64gcj13-4.7.2-8.1.mga3.x86_64.rpm
lib64gcj_bc1-4.7.2-8.1.mga3.x86_64.rpm
lib64gcj-devel-4.7.2-8.1.mga3.x86_64.rpm
lib64gcj-static-devel-4.7.2-8.1.mga3.x86_64.rpm
libgcc1-4.7.2-8.1.mga3.x86_64.rpm
libgcj13-base-4.7.2-8.1.mga3.x86_64.rpm
libgcj13-src-4.7.2-8.1.mga3.x86_64.rpm
libgfortran3-4.7.2-8.1.mga3.x86_64.rpm
libgnat1-4.7.2-8.1.mga3.x86_64.rpm
libgomp1-4.7.2-8.1.mga3.x86_64.rpm
libgomp-devel-4.7.2-8.1.mga3.x86_64.rpm
libitm1-4.7.2-8.1.mga3.x86_64.rpm
libitm-devel-4.7.2-8.1.mga3.x86_64.rpm
libmudflap0-4.7.2-8.1.mga3.x86_64.rpm
libmudflap-devel-4.7.2-8.1.mga3.x86_64.rpm
libobjc4-4.7.2-8.1.mga3.x86_64.rpm
libquadmath0-4.7.2-8.1.mga3.x86_64.rpm
libquadmath-devel-4.7.2-8.1.mga3.x86_64.rpm
libstdc++6-4.7.2-8.1.mga3.x86_64.rpm
libstdc++-devel-4.7.2-8.1.mga3.x86_64.rpm
libstdc++-docs-4.7.2-8.1.mga3.noarch.rpm
libstdc++-static-devel-4.7.2-8.1.mga3.x86_64.rpm




Testcase in initial report above.

Assignee: tmb => qa-bugs
Source RPM: gcc-c++-4.7.2-7.mga3 => gcc-4.7.2-8.1.mga3

Comment 4 Olivier Delaune 2013-11-23 09:48:01 CET
Tested on Mga 3 64-bits. I did not get any error anymore. Works for me :)

CC: (none) => olivier.delaune

Comment 5 claire robinson 2013-11-23 14:11:15 CET
Thanks Olivier. Adding the whiteboard stuff.

Whiteboard: (none) => has_procedure mga3-64-ok

Comment 6 Dave Hodgins 2013-11-30 14:20:51 CET
Advisory 10899.adv committed to svn

CC: (none) => davidwhodgins
Whiteboard: has_procedure mga3-64-ok => has_procedure mga3-64-ok advisory

Comment 7 Dave Hodgins 2013-11-30 18:27:36 CET
Testing complete on Mageia 3 i586. Validating the update.

Someone from the sysadmin team, please push 10899.adv to updates.

Keywords: (none) => validated_update
Whiteboard: has_procedure mga3-64-ok advisory => has_procedure mga3-64-ok advisory MGA3-32-OK
CC: (none) => sysadmin-bugs

Comment 8 Thomas Backlund 2013-11-30 23:02:07 CET
Update pushed:
http://advisories.mageia.org/MGAA-2013-0125.html

Status: ASSIGNED => RESOLVED
CC: (none) => tmb
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.