Contents
Update to GCC 7
GCC 7 is now released and is available in Debian testing. There are again the usual quirks with new standards versions and older software.
Test rebuilds of Debian testing/unstable on amd64 were done in January 2017 and June 2017, and bug reports filed for the packages. These issues are tracked in http://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-gcc-7;users=debian-gcc@lists.debian.org When submitting new reports, please tag these:
- Usertags: ftbfs-gcc-7
Test rebuilds were done in Ubuntu in December 2016 and June 2017, covering other architectures than amd64. See the links at the bottom of the page.
Bug squashing at DebCamp/DebConf
At DebCamp: Fri, Aug 04 (and if time and space permits, on Sat, Aug 05)
At DebConf: TBC. We'll find a place and an afternoon or two ...
TODO list
Fixing GCC build failures.
- Use GCC 7 by default.
- GFortran transition (new soname).
- Go transition (easy, no packages relying on gccgo-6).
- GCJ transition (easy, it was removed).
- GDC transition (new soname). Easy, no dependencies.
- gnat transition: TODO (can be done after the GCC 7 transition), contact the debian-ada ML.
Porting help
General porting help https://gcc.gnu.org/gcc-7/porting_to.html
Add pointers to porting efforts of other distributions (e.g. Fedora, OpenSUSE underway)...
Add porting recipes here...
link errors are usually caused by the new C11 inline semantics. They can be avoid by adding an attribute "__attribute__ ((gnu_inline))" before the inline keyword (preferred method), or by building with -fgnu89-inline (doesn't make sense if headers are installed in -dev packages).
Prepare for GCC 7
GCC 7 name mangling bug fix
In GCC 7, the name mangling for C++ conversion operators which return a type using the abi_tag attribute (most commonly std::string) has changed. When your library is compiled with GCC 7, it will now emit two symbols for the conversion operator using the new and old naming. Executables compiled with GCC 7 will always use the new symbol, while old executables compiled using <= GCC 6 will use the old symbol. For new executables to build without undefined references, your library will need rebuilding with GCC 7.
To ensure that new executables will pull in the newer version of the library built with GCC 7:
Your library package should Build-Depend on g++ (>= 4:7).
- If your package provides a symbols file, ensure that the new conversion operator symbols have a version matching the version this bug is fixed in (including the Debian revision and tilde if necessary).
- Using apt as an example (debian/libapt-pkg5.0.symbols):
(c++)"URI::operator std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >[abi:cxx11]()@APTPKG_5.0" 0.8.0
+ (c++)"URI::operator std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >()@APTPKG_5.0" 1.5~beta2~ Where "1.5~beta2" is the version this bug was fixed in.
- Using apt as an example (debian/libapt-pkg5.0.symbols):
- If your package does not provide a symbols file, add a dh_makeshlibs override so that tight enough dependencies are generated.
- Using libebml as an example (debian/rules): + override_dh_makeshlibs: + # For new symbols when compiled with GCC 7
+ dh_makeshlibs -V'libebml4v5 (>= 1.3.4-2~)' Where "1.3.4-2" is the version this bug was fixed in.
- Using libebml as an example (debian/rules): + override_dh_makeshlibs: + # For new symbols when compiled with GCC 7
- If your package is about to be renamed due to an upstream SONAME bump, you do not need to add any special symbols handling.
If you would like to know the exact name of the new symbols, using "abipkgdiff" from abigail-tools might be able to help.
Bug reports for packages needing this fix are tagged with gcc-7-op-mangling.
Timeline
TBD ...
- 2016-11-12: GCC 7 in experimental.
- 2017-01-31: Bug reports against packages filed.
- 2017-06-18: GCC 7 in unstable
- 2017-06-23: GCC 7 in testing
- 2017-08-xx: Make GCC 7 the default
Further information
Ubuntu test rebuild results (amd64, i386, arm64, armhf, powerpc, ppc64el, s390x):