Version 4 (modified by Michael Catanzaro, 5 years ago) (diff)


WebKit is a complex C++ library that often requires relatively new versions of GCC to build. Older versions of GCC tend to have bugs that prevent code from compiling successfully, which tend to be fixed in newer versions of GCC, and which are often encountered in practice by WebKit developers. Apple also likes to be able to use new C++ features, which are often not present in older versions of GCC, relatively early.

We are aware that Linux distributions and embedded systems vendors like to be able to compile everything with the same version of GCC, which may be very old, so we have compromised with Apple to develop a DependenciesPolicy that attempts to balance the interests of both WebKit users and developers. With respect to GCC, we intend to support the version of GCC in the latest Ubuntu LTS and Debian stable releases. As of fall 2017, that is Ubuntu 16.04 (GCC 5) and Debian Stretch (GCC 6). We'll continue to support GCC 5 at least until the release of Ubuntu 18.04 in April 2018. Shortly thereafter, you should expect that an upgrade to GCC 6 will be required to build trunk. Accordingly, the 2.22 releases of WebKitGTK+ and WPE will likely be the first to require GCC 6. After that, GCC 6 will be supported at least until the next Debian stable release. While we can't be sure when the next Debian stable release will be, it will probably be in mid to late 2019, so it is likely that either the 2.26 or 2.28 release will be the first to require GCC 7.

This policy may mean that a new version of GCC is required sooner than you might prefer. Because Apple does not use GCC to develop WebKit, and because of the relatively high number of compatibility issues caused by supporting GCC, we should be grateful that it is still possible to build WebKit with GCC at all. Unless you are able to upgrade your systems to newer GCCs on a regular basis, it is expected that your system GCC may not be new enough to build WebKit. We urge you to consider building with a custom compiler instead. One option that may sometimes work is to try to build with Clang, which may be new enough when GCC is not. (Clang is the compiler that Apple uses to develop WebKit.) Another option is to bootstrap a newer version of GCC as part of your WebKit build. If you choose to stop building new versions of WebKit as a result of a GCC version increase, rather than bootstrapping a newer compiler, your users will be left vulnerable to numerous security vulnerabilities that are fixed in newer versions.

GCC 4.9 -> GCC 5

In very rare cases, a C++ ABI change may make upgrading to a new version of GCC unusually difficult. For example, the C++ ABI changed between GCC 4.9 and GCC 5. Building WebKit with libstdc++ 5 would ordinarily require that you recompile all C++ libraries that it links against using the newer libstdc++. However, in this particular case, a compatibility option is provided: you can configure GCC with --with-default-libstdcxx-abi=gcc4-compatible when building GCC itself. This option may not exist forever, but it appears to still be supported as of libstdc++ 7.