My software compiles on a variety of OSes, including RHEL7. I have a request to build it to run on RHEL6. My problem is that my C++ code relies a lot on C++11 features that are not present in gcc-4.4, the one coming with RHEL6. nullptr, auto, lambdas are not supported, and there are a lot in the code.
I've seen there are ways to have more recent gcc versions to run on RHEL6, such as the Developer ToolSet for instance. I've no doubt I'll be able to build my software for RHEL6.
However, once compiled with, say, gcc-6, what will I have to provide with the binaries of my software? The C library of gcc-6? The C++ library of gcc-6? Should I instead link them statically to my binary?
On top of that, my software is packaged into .rpm files, and installs at standard locations: /usr/bin, /usr/lib ... Where would I install these new C and C++ library files on the target system? (Obviously not in /usr/lib where they may interfere with the default ones!)
Edit: My software is a shared object, I guess I can statically link the C++ library? But what about the program (I've no control on it) that will use my shared object. Can it use another version of the C++ library? Won't the linker find lots of duplicates? Looks like I'd open a can of worms...
Edit: Would it be possible to use the more recent gcc compiler with the standard C++ library of the RHEL6 stock one?
Edit: Note that the shared object has a pure "C" interface (Standardized).