Installing software compiled with newer version of GLIBC

One of the biggest issues I have installing software is errors that have the form:

/lib64/libm.so.6: version 'GLIBC_2.XX' not found

which happens when trying to install something which was compiled on a newer version of GCC that uses a GLIBC version newer than what is installed on the cluster. I was wondering if there is any advice on the best approach in these situations. Is there any way to load a module that will somehow make higher versions of GLIBC available?

Otherwise the only solution I can think of is either compile from source, which can be highly non-trivial, or somehow run the code in a container like Docker, which may come at performance cost or create other headaches.

Any advice?