User is experiencing the upstream issue. $ scl enable gcc-toolset-11 bash $ tar jxf boost_1_79_0.tar.bz2 $ cd boost_1_79_0 $ ./bootstrap.sh ... $ cat ../user-config.jam using gcc : : g++ : <cxxflags>"-flto" ; $ ./b2 --with-program_options link=static --user-config=$PWD/../user-config.jam ... $ cd .. $ cat test.cpp #include <boost/asio/spawn.hpp> #include <boost/program_options.hpp> #include <iostream> int main() { auto generic = boost::program_options::options_description{}; std::cout << generic; } $ g++ -o /dev/null test.cpp -Iboost_1_79_0 boost_1_79_0/stage/lib/libboost_program_options.a -Os -flto /opt/rh/gcc-toolset-11/root/usr/bin/ld: /tmp/ccx7yv55.ltrans0.ltrans.o: in function `boost::program_options::options_description::get_option_column_width() const': <artificial>:(.text+0x2449): undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_high_mark() const' /opt/rh/gcc-toolset-11/root/usr/bin/ld: /tmp/ccx7yv55.ltrans0.ltrans.o: in function `boost::program_options::(anonymous namespace)::format_one(std::ostream&, boost::program_options::option_description const&, unsigned int, unsigned int) [clone .constprop.0]': <artificial>:(.text+0x2822): undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_high_mark() const' /opt/rh/gcc-toolset-11/root/usr/bin/ld: <artificial>:(.text+0x28bf): undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_high_mark() const' /opt/rh/gcc-toolset-11/root/usr/bin/ld: <artificial>:(.text+0x376f): undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_high_mark() const' collect2: error: ld returned 1 exit status Manually adding I can reproduce the issue, and adding https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=libstdc%2B%2B-v3/include/std/sstream;h=bc7d636e702ea4352a182cc521fd32a06ca31b6f;hp=bb25c2c69a94f8fc325289ab7267e91c5b846121;hb=d47c4f0f1da0aa84097878b82e100d08deb6d950;hpb=6666ca1ab44ad8a61e2b916cf4173fe452b78ed6 to /opt/rh/gcc-toolset-11/root/usr/include/c++/11/sstream corrects the problem.
The fix is in 11.4 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105671#c9 so I think it makes sense to backport it.