Skip to content

Commit bd48392

Browse files
committed
using export_dynamic to export CLHEP/Geant4 so theyre avaialble to the plugins
1 parent 36d83f7 commit bd48392

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

meson.build

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,13 @@ gemc = executable(
276276
dependencies : [yaml_cpp_dep, qt6_deps, clhep_deps, geant4_deps, ogl_deps, assimp_dep, expat_dep, zlib_dep],
277277
include_directories : all_includes,
278278
link_with : all_libs,
279+
# Export the executable's dynamic symbol table (GNU --export-dynamic / -rdynamic, and the
280+
# macOS equivalent). CLHEP and Geant4 are linked statically into gemc, so without this their
281+
# symbols stay private and dlopen'd .gplugin output/digitization modules fail to resolve them
282+
# at load (e.g. "undefined symbol: _Z9_G4cerr_pv", i.e. G4cerr's _G4cerr_p()). Exporting keeps
283+
# a single shared copy of G4/CLHEP global state (notably the CLHEP RNG) between gemc and its
284+
# plugins, rather than each plugin embedding its own.
285+
export_dynamic : true,
279286
override_options : ['b_pie=true']
280287
)
281288

0 commit comments

Comments
 (0)