[MacPorts] #36364: Missing support for std::this_thread::sleep_for/sleep_until
#36364: Missing support for std::this_thread::sleep_for/sleep_until -------------------------------+-------------------------------- Reporter: l.digaspero@… | Owner: macports-tickets@… Type: defect | Status: new Priority: High | Milestone: MacPorts Future Component: ports | Version: 2.1.2 Keywords: c++11 std::thread | Port: gcc47 gcc48 -------------------------------+-------------------------------- In order to fully support c++11 threads for g++47/g++48, it is necessary to add the flag --enable-libstdccxx-time to ./configure in order to automatically define the _GLIBCXX_USE_NANOSLEEP macro and compile the support to sleep_for/sleep_until functions in threads. -- Ticket URL: <https://trac.macports.org/ticket/36364> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+------------------- Changes (by ryandesign@…): * cc: l.digaspero@… (removed) * cc: jeremyhu@… (added) * priority: High => Normal * keywords: c++11 std::thread => * milestone: MacPorts Future => * owner: macports-tickets@… => mww@… -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+-------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: fixed | Keywords: Port: gcc47 gcc48 | ----------------------------+-------------------- Changes (by jeremyhu@…): * status: new => closed * resolution: => fixed Comment: r98265 -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+-------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: fixed | Keywords: Port: gcc47 gcc48 | ----------------------------+-------------------- Comment (by howarth@…): Using --enable-libstdccxx-time without arguments doesn't do anything because that defaults to 'no'.[[BR]] Furthermore, using --enable-libstdccxx-time=yes won't work because the configure tests for nanosleep [[BR]] support in libstdc++-v3/configure ultimately fails on the test...[[BR]] [[BR]] configure:19829: checking for nanosleep[[BR]] configure:19851: /sw/src/fink.build/gcc47-4.7.2-1000/darwin_objdir/./gcc/xgcc -shared- libgcc -B/sw/src/fink.build/gcc47-4.7.2-1000/darwin_objdir/./gcc -nostdinc++ -L/sw/src/fink.build/gcc47-4.7.2-1000/darwin_objdir/x86_64 -apple-darwin12.2.0/libstdc++-v3/src -L/sw/src/fink.build/gcc47-4.7.2-1000/darwin_objdir/x86_64-apple- darwin12.2.0/libstdc++-v3/src/.libs -B/sw/lib/gcc4.7/x86_64-apple- darwin12.2.0/bin/ -B/sw/lib/gcc4.7/x86_64-apple-darwin12.2.0/lib/ -isystem /sw/lib/gcc4.7/x86_64-apple-darwin12.2.0/include -isystem /sw/lib/gcc4.7/x86_64-apple-darwin12.2.0/sys-include -o conftest -g -O2 -fno-exceptions conftest.cpp >&5[[BR]] conftest.cpp: In function 'int main()':[[BR]] conftest.cpp:97:15: error: 'tp' was not declared in this scope[[BR]] [[BR]] due to the test case....[[BR]] [[BR]] | #include <unistd.h>[[BR]] | #include <time.h>[[BR]] | | int[[BR]] | main ()[[BR]] | {[[BR]] | #if _POSIX_TIMERS > 0[[BR]] | timespec tp;[[BR]] | #endif[[BR]] | nanosleep(&tp, 0);[[BR]] |[[BR]] | ;[[BR]] | return 0;[[BR]] | }[[BR]] [[BR]] requiring posix timers which darwin doesn't support. -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+---------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+---------------------- Changes (by howarth@…): * status: closed => reopened * resolution: fixed => -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+---------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+---------------------- Comment (by howarth@…): Also note that passing --enable-libstdccxx-time=yes causes libstdc++-v3/configure to check...[[BR]] [[BR]] configure:19382: checking for clock_gettime, nanosleep and sched_yield[[BR]] [[BR]] and darwin doesn't provide clock_gettime. It is unclear how important that is to the enable-libstdccxx-time option[[BR]] functioning. -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+---------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+---------------------- Comment (by jeremyhu@…): Replying to [comment:4 howarth@…]:
Using --enable-libstdccxx-time without arguments doesn't do anything because that defaults to 'no'.[[BR]]
You seem to misunderstand how autoconf works. Also, it is --enable-libstdcxx-time, not --enable-libstdccxx-time (you made the same copy-paste-o as above).
Furthermore, using --enable-libstdccxx-time=yes won't work because the configure tests for nanosleep [[BR]] support in libstdc++-v3/configure ultimately fails on the test...[[BR]] [[BR]] configure:19829: checking for nanosleep[[BR]] configure:19851: /sw/src/fink.build/gcc47-4.7.2-1000/darwin_objdir/./gcc/xgcc -shared- libgcc -B/sw/src/fink.build/gcc47-4.7.2-1000/darwin_objdir/./gcc -nostdinc++ -L/sw/src/fink.build/gcc47-4.7.2-1000/darwin_objdir/x86_64 -apple-darwin12.2.0/libstdc++-v3/src -L/sw/src/fink.build/gcc47-4.7.2-1000/darwin_objdir/x86_64-apple- darwin12.2.0/libstdc++-v3/src/.libs -B/sw/lib/gcc4.7/x86_64-apple- darwin12.2.0/bin/ -B/sw/lib/gcc4.7/x86_64-apple-darwin12.2.0/lib/ -isystem /sw/lib/gcc4.7/x86_64-apple-darwin12.2.0/include -isystem /sw/lib/gcc4.7/x86_64-apple-darwin12.2.0/sys-include -o conftest -g -O2 -fno-exceptions conftest.cpp >&5[[BR]] conftest.cpp: In function 'int main()':[[BR]] conftest.cpp:97:15: error: 'tp' was not declared in this scope[[BR]] [[BR]] due to the test case....[[BR]] [[BR]] | #include <unistd.h>[[BR]] | #include <time.h>[[BR]] | | int[[BR]] | main ()[[BR]] | {[[BR]] | #if _POSIX_TIMERS > 0[[BR]] | timespec tp;[[BR]] | #endif[[BR]] | nanosleep(&tp, 0);[[BR]] |[[BR]] | ;[[BR]] | return 0;[[BR]] | }[[BR]] [[BR]] requiring posix timers which darwin doesn't support.
Why do they need _POSIX_TIMERS? That's not needed for nanosleep. -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+-------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: fixed | Keywords: Port: gcc47 gcc48 | ----------------------------+-------------------- Changes (by jeremyhu@…): * status: reopened => closed * resolution: => fixed Comment: If there is a new issue, please open a new ticket. -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+-------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: fixed | Keywords: Port: gcc47 gcc48 | ----------------------------+-------------------- Comment (by howarth@…): This isn't a new issue because the changes proposed and added in r98265 never worked in the first place.[[BR]] The documentation of the configure options in libstdc++-v3/configure[[BR]] [[BR]] --enable-libstdcxx-time[=KIND][[BR]] use KIND for check type [default=no][[BR]] [[BR]] clearly show the current usage is faulty. Also a cursory check of the libstdc++-v3/config.log would have[[BR]] shown that --enable-libstdcxx-time=yes also is broken on darwin because this option is currently linux-centric[[BR]] and depends on the presence of posix timers. -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+---------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+---------------------- Changes (by howarth@…): * status: closed => reopened * resolution: fixed => -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+---------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+---------------------- Comment (by jeremyhu@…): --enable-<blah> is equivalent to --enable-<blah>=yes in autoconf. Similarly, --disable-<blah> is equivalent to --enable-<blah>=yes. As for the option being broken, that's not something that I can fix as gcc is GPL3. It should be straight forward, though. I don't see why they check for posix timers for nanosleep. We should be able to just remove that #if _POSIX_TIMERS > 0 If you can provide such a patch, I'll include it. -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+---------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+---------------------- Comment (by howarth@…): The gcc47_fix_nanosleep_test.diff and gcc48_fix_nanosleep_test.diff patches need to be used in concert with passing --enable-libstdcxx- time=yes to configure.[[BR]] Can be confirmed by checking the installed c++ headers with grep to show...[[BR]] [[BR]] ./c++/4.8.0/x86_64-apple-darwin12.2.0/bits/c++config.h:#define _GLIBCXX_USE_NANOSLEEP 1[[BR]] ./c++/4.8.0/x86_64-apple-darwin12.2.0/i386/bits/c++config.h:#define _GLIBCXX_USE_NANOSLEEP 1[[BR]] -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+---------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+---------------------- Comment (by jeremyhu@…): Updated gcc48 in r98534 -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:14> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+---------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+---------------------- Comment (by howarth@…): Fixed upstream for gcc 4.8.0 by effectively defaulting to --enable- libstdcxx-time=yes on darwin.[[BR]] [[BR]] http://gcc.gnu.org/ml/libstdc++-cvs/2012-q4/msg00045.html -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:15> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+---------------------- Reporter: l.digaspero@… | Owner: mww@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+---------------------- Comment (by jeremyhu@…): Thanks, Jack. Can you please attach the final patch that was used to this ticket, so I can use it for gcc47? Thanks. -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:16> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+------------------------ Reporter: l.digaspero@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+------------------------ Changes (by jeremyhu@…): * status: reopened => new * owner: mww@… => jeremyhu@… Comment: I'll fix this when I bump gcc46 and gcc47 for #38814 -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:17> MacPorts <http://www.macports.org/> Ports system for OS X
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+------------------------ Reporter: l.digaspero@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: gcc47 gcc48 | ----------------------------+------------------------ Comment (by jeremyhu@…): r109291 -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:18> MacPorts <http://www.macports.org/> Ports system for OS X
#36364: gcc47, gcc48: Missing support for std::this_thread::sleep_for/sleep_until ----------------------------+------------------------ Reporter: l.digaspero@… | Owner: jeremyhu@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: fixed | Keywords: Port: gcc47 gcc48 | ----------------------------+------------------------ Changes (by jeremyhu@…): * status: new => closed * resolution: => fixed -- Ticket URL: <https://trac.macports.org/ticket/36364#comment:19> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts