[CMake] How to build CMake so it works on an older Linux?

Robert Maynard robert.maynard at kitware.com
Thu Apr 5 09:15:08 EDT 2018


The official CMake binaries do the same thing as you and build with a
static libstdc++ and libgcc.
As far as dependencies we use static builds of those too, with most
being the version provided inside CMake, and an external openssl.

You can find the more information on the exact flags we are using at:
https://gitlab.kitware.com/cmake/cmake/blob/master/Utilities/Release/linux64_release.cmake

On Thu, Apr 5, 2018 at 3:09 AM, Eric Wing <ewmailing at gmail.com> wrote:
> Thanks for the responses. Yes, I just need this to run on Ubuntu 12.04
> (and some other old Linux's in that era). Yes, I think the probably is
> the libstdc++ dependency.
>
> As pointed out, it is really hard to get a newer compiler on Ubuntu
> 12.04. I've been down this road before, and if memory serves, the gcc
> bootstrapping process to get a newer compiler doesn't seem to work
> with a compiler older than gcc 4.8. Same goes for clang, which also
> weirdly relies on gcc 4.8 to bootstrap itself.
>
> Anyway, CMake seems to already know how to ship binaries that work
> across Linux distros. I'm pretty sure they just statically linked
> libstdc++ and libgcc. In fact, I just built it with -static-libstdc++
> -static-libgcc on a newer Linux and tested it on 12.04 and it seemed
> to work.
>
> But I wanted to know for sure how CMake is building their own binaries
> in case there are subtle problems with what I did, and they have a
> completely different way of building it, e.g. statically libmusl for C
> and libc++ for C++, avoiding gcc entirely.
>
> Also, I did not take care of the libssl, libcrypto, and libz
> dependencies. I'm curious in practice how much trouble these are. (My
> recollection with zlib is that it is extremely stable and they care a
> great deal about not breaking backwards compatibility. I don't know
> about the others.)
>
> Thanks,
> Eric
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list