Replies: 3 comments 2 replies
-
|
ACE service configurator depends on the fact that the static initializers do run. The 'workaround' to add an explicit include is something that is done in a lot of ACE/TAO tests for the static builds, but that shouldn't be necessary in a dynamic build. The best seems to not use |
Beta Was this translation helpful? Give feedback.
-
UpdateUnsurprisingly, attempting to reproduce the problem yielded a better understanding of it. When using
When using
The main point I was missing was that the call to Summary
Possible Next StepsAs stated earlier, once I understood more about ACE/TAO, adding a little initialization code to solve the problem was straightforward. One possibility is using Another possibility is to update the global initialization code to respect things that have been loaded since the previous execution. In either case, this probably not going to affect many users. Perhaps the best thing is just documentation. |
Beta Was this translation helpful? Give feedback.
-
|
Was the use of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Scenario
Two dynamic libraries create ORBs. The first library
SyncClientdoes not depend on bidirectional GIOP, while the second libraryOpenDDS_InfoRepoDiscoverydoes.OpenDDS_InfoRepoDiscoveryincludesBiDirGIOP.hto satisfy the service configuration framework.If
SyncClientis loaded first, then TAO throws an exception whenOpenDDS_InfoRepoDiscoveryattempts to use BiDirGIOPIf
OpenDDS_InfoRepoDiscoveryis loaded first, then no exception is thrown.Investigation
Investigation showed that the exception is legitimate because the BiDirGIOP loader did not register the policy. Hence, the problem is with the loader. Further investigation seemed to show that
TAO_BiDirGIOPwas being loaded but the loader was never initialized.Including
BiDirGIOP.hinSyncClientsolved the problem.A trail starting here led me to try compiling with
LDFLAGS="-Wl,--no-as-needed". This also solved the problem.I also attempted to use
LDFLAGS="-Wl,--no-undefined -Wl,--no-allow-shlib-undefined". This did not solve the problem.Here is the
lddoutput for the default case (--as-needed):And here is the
lddoutput for--no-as-needed:The direct dependency of the application on
SyncClientexplains why addingBiDirGIOP.hsolved the problem; the linker did not elide the static initializers, soTAO_BiDirGIOPwas loaded and initialized correctly.The
lddoutput shows how--as-neededstrips dependencies that are loaded under application control. These dependencies can and are loaded but it seems that the static intializers they contain are getting elided.Conclusion and Call to Action
It seems like
--as-neededbreaks the service configuration framework in ACE when a manually loaded library depends on other libraries with static initializers. Theldversion in question is 2.35.2. This was discovered on Ubuntu and appears to be common to Debian derivatives.--as-neededor is it more of a build configuration issue?Beta Was this translation helpful? Give feedback.
All reactions