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.
-
Scenario
Two dynamic libraries create ORBs. The first library
SyncClient
does not depend on bidirectional GIOP, while the second libraryOpenDDS_InfoRepoDiscovery
does.OpenDDS_InfoRepoDiscovery
includesBiDirGIOP.h
to satisfy the service configuration framework.If
SyncClient
is loaded first, then TAO throws an exception whenOpenDDS_InfoRepoDiscovery
attempts to use BiDirGIOPIf
OpenDDS_InfoRepoDiscovery
is 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_BiDirGIOP
was being loaded but the loader was never initialized.Including
BiDirGIOP.h
inSyncClient
solved 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
ldd
output for the default case (--as-needed
):And here is the
ldd
output for--no-as-needed
:The direct dependency of the application on
SyncClient
explains why addingBiDirGIOP.h
solved the problem; the linker did not elide the static initializers, soTAO_BiDirGIOP
was loaded and initialized correctly.The
ldd
output shows how--as-needed
strips 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-needed
breaks the service configuration framework in ACE when a manually loaded library depends on other libraries with static initializers. Theld
version in question is 2.35.2. This was discovered on Ubuntu and appears to be common to Debian derivatives.--as-needed
or is it more of a build configuration issue?Beta Was this translation helpful? Give feedback.
All reactions