public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105671] New: Unexplained "undefined reference" error
@ 2022-05-20 10:06 christian.morales.vega at gmail dot com
  2022-05-20 10:08 ` [Bug c++/105671] " christian.morales.vega at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: christian.morales.vega at gmail dot com @ 2022-05-20 10:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105671

            Bug ID: 105671
           Summary: Unexplained "undefined reference" error
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: christian.morales.vega at gmail dot com
  Target Milestone: ---

Created attachment 53005
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53005&action=edit
Full verbose build log

I have found a strange issue in my project build that reproduces is Ubuntu
22.04 (gcc 11.2) and Fedora 36 (gcc 12.1.1). This is the most I have been able
to reduce it:

$ tar xf boost_1_79_0.tar.bz2 
$ cd boost_1_79_0/
$ ./bootstrap.sh
$ ./b2 --with-program_options link=static --user-config=$PWD/../user-config.jam
$ cd ..
$ g++ -o /dev/null test.cpp -Iboost_1_79_0
boost_1_79_0/stage/lib/libboost_program_options.a -Os -flto
/usr/bin/ld: /tmp/cccbpRrv.ltrans0.ltrans.o: in function
`boost::program_options::options_description::get_option_column_width() const':
<artificial>:(.text+0x28cd): undefined reference to
`std::__cxx11::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >::_M_high_mark() const'
/usr/bin/ld: /tmp/cccbpRrv.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+0x2d80): undefined reference to
`std::__cxx11::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >::_M_high_mark() const'
/usr/bin/ld: <artificial>:(.text+0x2e13): undefined reference to
`std::__cxx11::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >::_M_high_mark() const'
/usr/bin/ld: <artificial>:(.text+0x3d40): 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
$

I'm attaching a log showing the whole Boost.Program_options verbose build log.

- Change "-Os" for "-O1" and it works
- Remove the -supposedly unused- "#include <boost/asio/spawn.hpp>" line and it
works.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-07-07 23:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 10:06 [Bug c++/105671] New: Unexplained "undefined reference" error christian.morales.vega at gmail dot com
2022-05-20 10:08 ` [Bug c++/105671] " christian.morales.vega at gmail dot com
2022-05-26 23:09 ` [Bug libstdc++/105671] [11/12/13 Regression] " jsm28 at gcc dot gnu.org
2022-05-27 10:19 ` redi at gcc dot gnu.org
2022-05-27 13:51 ` christian.morales.vega at gmail dot com
2022-05-27 14:23 ` cvs-commit at gcc dot gnu.org
2022-05-27 14:25 ` [Bug libstdc++/105671] [11/12 " redi at gcc dot gnu.org
2022-06-08 15:53 ` cvs-commit at gcc dot gnu.org
2022-06-08 16:10 ` [Bug libstdc++/105671] [11 " redi at gcc dot gnu.org
2022-07-07 23:33 ` cvs-commit at gcc dot gnu.org
2022-07-07 23:34 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).