# Linux DSO-\>Static-\>DSO link impasse

**URL:** https://discourse.cmake.org/t/linux-dso-static-dso-link-impasse/13543
**Category:** Usage
**Tags:** os:linux
**Created:** [February 5, 2025, 7:26pm UTC](https://discourse.cmake.org/t/linux-dso-static-dso-link-impasse/13543 "2025-02-05T19:26:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wdezell](https://discourse.cmake.org/user_avatar/discourse.cmake.org/wdezell/32/6081_2.png) [@wdezell](https://discourse.cmake.org/u/wdezell)
#### Post date: [February 5, 2025, 7:26pm UTC](https://discourse.cmake.org/t/linux-dso-static-dso-link-impasse/13543/1 "2025-02-05T19:26:19Z")

</div>

**BG**  
We have a product in the late stages of development, the architecture of which implements hardware/functionality support as plugins loaded at startup (impl via Boost::DLL). Hardware support vendor drivers are typically statically linked to the plugin DSO to travel as a single drop-in, well, plugin. It works well.

The problem case is a card purchased for which there is no option for a static vendor lib – it’s between 1 and 3 DSOs depending on the API calls used. Our developer has implemented an abstraction class (call it fooClass) as a subclass of a base in one of the vendor DSOs. fooClass is packaged as a **static** library to be consumed by our plugin DSO. _Copies_ of the libs exist in a source tree subdir to satisfy build-time link on development systems but the runtime libs are in a vendor directory added to _ld.so.conf_ on the production devices.

**Problem**  
The subclass static lib _fooClass_ must access vendor DSO methods (seems to) yet so too must the plugin DSO – it uses an instance of fooClass via static fooClassLib but also makes direct calls to vendor DSO base class methods, which segfault (_nm_ shows as Unresolved)\*\*.

How do I link to ensure vendor DSO symbols are passed through correctly to plugin DSO?

_fooClassLib_

```auto

set( LIBRARIES
        ziodaq
        ziodaqutil
)

add_library(${TARGET_NAME} STATIC ${SOURCES} ${HEADERS}) 
set_property(TARGET ${TARGET_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) # usable by plugin DSO

target_link_options(${TARGET_NAME} PRIVATE LINKER:-L${CMAKE_CURRENT_SOURCE_DIR}/ztech/lib)
target_link_libraries(${TARGET_NAME} PUBLIC ${LIBRARIES})

```

The plugin DSO that consumes is built separately and linked as follows:

```auto
set( LIBRARIES
        <snip>
        dl
        fooClassLib # a static lib we built elsewhere
        ziodaq # hardware vendor dso
        ziodaqutil # hardware vendor dso
)

# -- our plugin target
add_library(${TARGET_NAME} SHARED ${HEADERS} ${SOURCES})
set_target_properties( ${TARGET_NAME} PROPERTIES VERSION ${VERSION} SOVERSION ${SOVERSION} )
target_link_options(${TARGET_NAME} PRIVATE LINKER:-L${PROJECT_BINARY_DIR}/copy/of/vendor/libs)
target_include_directories(${TARGET_NAME} PRIVATE ${VENDOR_INCLUDE_DIRS})
target_link_libraries(${TARGET_NAME} PRIVATE ${LIBRARIES})

add_dependencies(${TARGET_NAME} SHMEM_HDRS fooClassLib)

```
