Skip to content

Current build system allows to build libraries with undefined symbols

Summary

Current build system will neither fail nor even issue a warning when building a library with declared but not defined functions. Resulting library will contain undefined symbol(s) and will cause runtime error.

Steps to reproduce

  • Checkout the code
  • Remove definition of some function (I used gem::hw::optohybrid::OptoHybridManager::createOptoHybridInfoSpaceItems), but do not touch the declaration or invocation
  • Build the project The library is successfully built and contains undefined symbol:
nm _build/gemhardware/managers/libgemhw_managers.so |c++filt |grep createOptoHybrid
                 U gem::hw::optohybrid::OptoHybridManager::createOptoHybridInfoSpaceItems(std::shared_ptr<gem::base::utils::GEMInfoSpaceToolBox>, std::shared_ptr<gem::hw::optohybrid::HwOptoHybrid>)

What is the expected correct behavior?

The build should fail, or at least a warning should be issued (in case of forward declaration and expectation of the symbol to be defined in linked library).

Relevant logs and/or screenshots

Environment

  • Version used: head of develop
  • Operation System: cc7