Dear Alexei
The point is that in the original GiNaC code there would be two instances of, say, foo<void*>::data inside the executable.
But foo<T>::data is a static memeber. There should be only one instance.
Yes, there should be one. Unfortunately there are two.
One comming from the shared library and the other one coming from the executable itself. Library code would modify the first one and code from the executable would modify the other one.
Could you please run nm -B -C -D /path/to/libginac.so nm -B -C /path/to/your/binary (or nm -B /path/to/libginac.so | c++filt, or whatever is it on OS X)
Those options are not recognized on OS X, but I did do the following: for the unpatched lib:
nm ~/lib/libginac-1.4.0.0.0.dylib | grep class_info | grep first 003a4124 s __ZN5GiNaC10class_infoINS_21print_context_optionsEE5firstE 003a3c10 s __ZN5GiNaC10class_infoINS_24registered_class_optionsEE5firstE
nm gendiags | grep class_info | grep first 002a2174 s __ZN5GiNaC10class_infoINS_24registered_class_optionsEE5firstE
for the patched lib:
nm ~/lib/libginac-1.4.0.0.0.dylib | grep class_info | grep first 00000000 a _GLOBAL__D__ZN5GiNaC10class_infoINS_24registered_class_optionsEE5firstE.eh 00000000 a _GLOBAL__I__ZN5GiNaC10class_infoINS_24registered_class_optionsEE5firstE.eh 002f3c60 s __GLOBAL__D__ZN5GiNaC10class_infoINS_24registered_class_optionsEE5firstE 002f3c50 s __GLOBAL__I__ZN5GiNaC10class_infoINS_24registered_class_optionsEE5firstE 00323940 D __ZN5GiNaC10class_infoINS_21print_context_optionsEE5firstE 00323938 D __ZN5GiNaC10class_infoINS_24registered_class_optionsEE5firstE
nm gendiags | grep class_info | grep first U __ZN5GiNaC10class_infoINS_24registered_class_optionsEE5firstE
Best wishes, Chris