YottaDB / YDB

Mirrored from https://gitlab.com/YottaDB/DB/YDB
Other
76 stars 37 forks source link

gtm_init and gtm_ci missing from libgtmshr.so #346

Closed seanwoods closed 6 years ago

seanwoods commented 6 years ago

I noticed that gtm_init and gtm_ci are not in this shared library. Intentional? Would seem to break backwards compatibility?

[swoods@tpx220 ~]$ nm -g $gtm_dist/libgtmshr.so | egrep '(gtm_init|gtm_exit|gtm_ci|gtm_zstatus)'
000000000004fc30 T gtm_cij
000000000004fc20 T gtm_exit
000000000004fc40 T gtm_zstatus
estess commented 6 years ago

The expectation is that when one is moving to a new build (either a new release or from GT.M to YottaDB) that one would recompile their programs (the release notes used to say this but not sure if they still do). You are correct that these entry points are not present in the executable but when you rebuild your program, there are #define statements in gtmxctypes.h that will change those references to the ydb*() flavor of routine so it should work. We would like to know if that is not true.

seanwoods commented 6 years ago

Ah. I'm using dlsym() to get a handle to the function. When I wrote this code years ago, there was a lot of haranguing I had to do with LD_LIBRARY_PATH and other stuff in order to get the code to compile, so as a workaround I dynamically linked it.

I can add some code to work around this. Thanks for letting me know what the rationale is/was.

estess commented 6 years ago

Just make sure to specify the -rpath linker option to avoid the envvar headaches. Example (my 'sandbox' build is /usr/library/V994 so put your own build directory in there):

(other link/load stuff) -L/usr/library/V994/dbg -lyottadb -Wl,-rpath,/usr/library/V994/dbg

seanwoods commented 6 years ago

Good tip. Thanks!