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

Joseph S. Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Unexplained "undefined      |[11/12/13 Regression]
                   |reference" error            |Unexplained "undefined
                   |                            |reference" error
                 CC|                            |jsm28 at gcc dot gnu.org
          Component|c++                         |libstdc++
   Target Milestone|---                         |11.4

--- Comment #2 from Joseph S. Myers <jsm28 at gcc dot gnu.org> ---
I'm seeing the same undefined reference on a customer test case. I haven't
reduced it to a self-contained test case either, but as far as I can see this
is a libstdc++ issue (rather than a front-end or LTO bug). _M_high_mark (which
is new in libstdc++ in GCC 11) isn't exported from libstdc++.so (it's present
in libstdc++.a), presumably because the symbol version maps don't include it,
so if the compiler decides to inline one of the functions from the header that
calls _M_high_mark, without inlining _M_high_mark itself, there is an undefined
reference to _M_high_mark. (This selective inlining is what I haven't
reproduced in a self-contained test, even when adjusting various inlining
parameters, but it would explain the undefined reference.)

Reply via email to