[Bug 1228201] Re: g++ doesn't compile simple code, using thread header
Static link with `-static` also reproduces the issue, even with `-Wl ,--no-as-needed`. Removing `-static` fixed the issue for me. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1228201 Title: g++ doesn't compile simple code, using thread header To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1228201] Re: g++ doesn't compile simple code, using thread header
On trusty the problem is still present when linking against any of the boost library (tried both 1.54.0 or 1.55.0) - the workaround (-Wl,--no-as-needed) still works though. This is what I get using the 'thread.cpp' provided above: craczy@vb:/tmp$ g++ thread.cpp -pthread -std=c++11 -o thread craczy@vb:/tmp$ ./thread 1307674368000 355687428096000 craczy@vb:/tmp$ g++ thread.cpp -pthread -std=c++11 -o thread -lboost_filesystem craczy@vb:/tmp$ ./thread terminate called after throwing an instance of 'std::system_error' what(): Enable multithreading to use std::thread: Operation not permitted Aborted (core dumped) craczy@vb:/tmp$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION=Ubuntu 14.04.1 LTS craczy@vb:/tmp$ -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1228201 Title: g++ doesn't compile simple code, using thread header To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1228201] Re: g++ doesn't compile simple code, using thread header
closing based on the previous comment. ** Changed in: gcc-defaults (Ubuntu) Status: Confirmed = Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1228201 Title: g++ doesn't compile simple code, using thread header To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1228201] Re: g++ doesn't compile simple code, using thread header
Works on trusty. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1228201 Title: g++ doesn't compile simple code, using thread header To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1228201] Re: g++ doesn't compile simple code, using thread header
** Changed in: gcc-defaults (Ubuntu) Importance: Undecided = High -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1228201 Title: g++ doesn't compile simple code, using thread header To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1228201] Re: g++ doesn't compile simple code, using thread header
This is fun, but for me the program works fine for few runs then after more coding and recompile, then I start getting this error when executing. Ubuntu 13.10 g++ 4.8.1 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1228201 Title: g++ doesn't compile simple code, using thread header To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1228201] Re: g++ doesn't compile simple code, using thread header
I agree this behaviour is not desired. For now, you can work around it passing -Wl,--no-as-needed. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1228201 Title: g++ doesn't compile simple code, using thread header To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1228201] Re: g++ doesn't compile simple code, using thread header
code builds using clang: shkiper@server:~/C++/Thread$ clang++ thread.cpp -o thread -pthread -std=c++11 shkiper@server:~/C++/Thread$ ./thread 1307674368000 355687428096000 shkiper@server:~/C++/Thread$ so, problem is in g++ -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1228201 Title: g++ doesn't compile simple code, using thread header To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1228201] Re: g++ doesn't compile simple code, using thread header
Status changed to 'Confirmed' because the bug affects multiple users. ** Changed in: gcc-defaults (Ubuntu) Status: New = Confirmed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1228201 Title: g++ doesn't compile simple code, using thread header To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1228201/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs