Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 441810 - dev-libs/boost: Add "c++11" USE flag
Summary: dev-libs/boost: Add "c++11" USE flag
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: C++ Team [disbanded]
URL:
Whiteboard:
Keywords: PATCH
Depends on: 441804
Blocks: 441812
  Show dependency tree
 
Reported: 2012-11-05 01:53 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2012-11-22 03:23 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
boost.patch (boost.patch,1.39 KB, patch)
2012-11-05 01:54 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2012-11-05 01:53:10 UTC
ABI of Boost changes when Boost has been built with C++11, resulting in requirement of using C++11 for a subset of reverse dependencies of Boost:

$ cat test.cpp
#include <boost/filesystem.hpp>
int main()
{
    boost::filesystem::copy_file("/tmp/file1", "/tmp/file2");
}
$ g++ -o test test.cpp -lboost_filesystem
/tmp/cceFhNtv.o: In function `boost::filesystem::copy_file(boost::filesystem::path const&, boost::filesystem::path const&)':
test.cpp:(.text._ZN5boost10filesystem9copy_fileERKNS0_4pathES3_[_ZN5boost10filesystem9copy_fileERKNS0_4pathES3_]+0x26): undefined reference to `boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option::enum_type, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
$ g++ -std=c++11 -o test test.cpp -lboost_filesystem
$ readelf -sW /usr/lib64/libboost_filesystem-mt-1_51.so | grep copy_file
   241: 000000000000c840   779 FUNC    GLOBAL DEFAULT   10 _ZN5boost10filesystem6detail9copy_fileERKNS0_4pathES4_NS0_11copy_optionEPNS_6system10error_codeE
$ c++filt _ZN5boost10filesystem6detail9copy_fileERKNS0_4pathES4_NS0_11copy_optionEPNS_6system10error_codeE
boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option, boost::system::error_code*)

Addition of "c++11" USE flag in Boost will allow other packages to use:

if has_version "dev-libs/boost[c++11(-)]"; then
    append-cxxflags -std=c++11
fi
Comment 1 Arfrever Frehtes Taifersar Arahesis 2012-11-05 01:54:19 UTC
Created attachment 328390 [details, diff]
boost.patch

Patch backported from Progress Overlay.
Comment 2 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2012-11-05 05:21:45 UTC
Assigned herd: Just learned I shouldn't CC herd maintainers if I assign to a herd, to avoid that you receive any further comments double I have removed you from CC.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-11-07 22:27:28 UTC
No this is not going to be the right way to do this.
Comment 4 Arfrever Frehtes Taifersar Arahesis 2012-11-14 01:22:10 UTC
What alternative solution do you suggest?
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-11-22 03:23:20 UTC
We'll decide when to enable C++11 tree-wide _after_ gcc 4.7 is generally available. So please don't open this bug again.