Skip to content

Undefined symbols when using boost statecharts #42697

@llvmbot

Description

@llvmbot
Bugzilla Link 43352
Version unspecified
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @dwblaikie,@rui314

Extended Description

Version 9.0.0 RC5

The same link works in ld. You can use the boost statechart as such:

namespace my_namespace
{
struct evt_done_state: boost::statechart::event<evt_done_state> {};
}

lld-link: error: undefined symbol: __ZN5boost10statechart6detail10no_contextIN12my_namespace14evt_done_stateEE11no_funct>>> referenced by (... file path)

Looking at the boost source code, there is declared, undefined function. This was taken from boost 1.63.0, but the specific code is common for older and newer versions:
boost\statechart\detail\reaction_dispatcher.hpp:33
template< class Event >
struct no_context
{
void no_function( const Event & ); // <------
};

The method is not called or referenced, and shows up as 'U' in nm. I suspect ld drops the unused, undefined symbol.

We're working around this by changing the offending line to:
void no_function( const Event & ) {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions