[Boost-bugs] [Boost C++ Libraries] #13166: gcc static linking with LTO flag with boost filesystem fails

Subject: [Boost-bugs] [Boost C++ Libraries] #13166: gcc static linking with LTO flag with boost filesystem fails
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-08-17 15:06:40


#13166: gcc static linking with LTO flag with boost filesystem fails
------------------------------+-------------------------
 Reporter: mettbest@… | Owner: Beman Dawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.64.0 | Severity: Problem
 Keywords: lto gcc linking |
------------------------------+-------------------------
 boost version 1.64 \\
 gcc version 6.4.1 \\
 Linux OpenSuse x64 42.2 \\
 Cmake 3.5.2 \\
 \\
 **[linking, no LTO] works:** \\
 -std=gnu++11 -O2 -fopenmp -static /opt/lib64/libboost_filesystem.a
 /opt/lib64/libboost_system.a \\

 **[linking, with LTO] does not work:** \\
 -std=gnu++11 -O2 -fopenmp -flto=8 -static
 /opt/lib64/libboost_filesystem.a /opt/lib64/libboost_system.a

 **error:**

 {{{
 /opt/lib64/libboost_filesystem.a(operations.o): In function
 `boost::filesystem::detail::is_empty(boost::filesystem::path const&,
 boost::system::error_code*)':
 operations.cpp:(.text+0x536a): undefined reference to `vtable for
 boost::detail::sp_counted_impl_p<boost::filesystem::detail::dir_itr_imp>'
 /opt/lib64/libboost_filesystem.a(operations.o): In function `(anonymous
 namespace)::remove_all_aux(boost::filesystem::path const&,
 boost::filesystem::file_type, boost::system::error_code*)':
 operations.cpp:(.text+0x699d): undefined reference to `vtable for
 boost::detail::sp_counted_impl_p<boost::filesystem::detail::dir_itr_imp>'
 operations.cpp:(.text+0x6add): undefined reference to `vtable for
 boost::detail::sp_counted_impl_p<boost::filesystem::detail::dir_itr_imp>'
 collect2: error: ld returned 1 exit status
 CMakeFiles/zebr.dir/build.make:137: recipe for target 'zebr' failed
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13166>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-08-17 15:12:31 UTC