Print

Print


Currently, all functions that accept or return strings use the type `std::string`. This leads to an issue when users of the library are using a different C++ revision than what the library was compiled with. See https://developers.redhat.com/blog/2015/02/05/gcc5-and-the-c11-abi/ for more info, but the short description is that `std::string` changed its memory layout beginning with c++11 and this "new" `std::string` has its library-visible typename prefixed with `__cxx11`. If the library is compiled w/a c++ version < c++11, user applications with c++ version > c++11 can't correctly link to the library, and vice-versa.

The problem is more complicated on RHEL7-based OSes -- This breaking ABI change occurred during the RHEL7 lifecycle, and instead of migrating the OS to the new ABI (which I don't even think is possible in an easy way), RHEL has hard-coded the system compiler to use the old ABI, even if c++11 is requested. This hurts because experiments compile with non-system-compilers who don't implement this functionality which means the library is compiled with the `__cxx11` abi versions (I checked the sft.cern.ch and cms.cern.ch CVMFS libxrootd.so), but applications have no way to accept that ABI.

My particular use-case is trying to fix up the implementation of the Hadoop xrootd filesystem implementation. It's currently undeployable via maven because the JNI stub library can only work with one ABI version of the library to call the Url constructor (http://xrootd.org/doc/doxygen/current/html/classXrdCl_1_1URL.html#a30b5a58a5c7fc3e514df7ca32ebe6d61). If there was a thin `char *` version of the function exported, I would be able to use that instead and skip this whole problem (additionally, that change would allow me to completely drop the stub JNI library and instead use [JNA](https://github.com/java-native-access/jna) to call the client library directly from Java w/o needing to compile/maintain a stub.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/issues/1010

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1