Google Summer of Code/2023/Ideas/Modern C porting of Gentoo packages

From Gentoo Wiki
Jump to:navigation Jump to:search

Modern C porting of Gentoo packages

Newer versions of compilers are planning on becoming significantly stricter with the C code they will accept or reject. This is a huge problem for the general Linux ecosystem.

Even worse is that some of these failures are silent and lead to incorrect behaviour at runtime. Extra care must be taken to detect this and we must prioritise these cases because they're the most harmful. With the release of Clang 16 (expected March 2023), the following specified warnings will be treated as errors:

  • -Werror=implicit-function-declaration
  • -Werror=implicit-int
  • -Werror=int-conversion (been enabled in clang 15)
  • -Werror=incompatible-function-pointer-types (for GCC a student might have to use -Werror=incompatible-pointer-types instead)

Also, in the coming years with C2x (likely C23) additional changes like removing certain deprecated prototypes will be made.

The above changes will affect affect Gentoo packages in the following ways:

  • Lots of packages fail to build with these settings
  • Sometimes packages build successfully but their ./configure scripts have misdetected features or otherwise made the wrong conclusion about the system because they expect a test to succeed when it now fails.

Please read Modern C porting in detail and see also bug #870412.

Students can test and provide patches for affected packages on both glibc and musl systems in parallel, but keeping glibc as the primary target might help fixes reach users faster.



Contacts Required Skills
  • Familiarity with C programming
  • Familiarity with build system and configuration scripts
  • Knowledge of bumping ebuilds and applying patches in ebuild
  • Git
  • Patience


Expected Project Size Expected Outcomes
350
  • Bring down the bug list
  • Keep primary focus on glibc to help faster reach of bug fixes to end users
  • While focusing on musl, the tasks can be divided into smaller sub tasks. Such as first installing a desktop environment like GNOME or KDE to ensure a basic desktop is usable and can be built on musl. Then starting to emerge some of the affected/already fixed packages on musl to ensure that they can be built and patch works on musl too.
  • Send patches upstream so that other users and distributions can take advantage (this is critical)
  • Provide patches for both glibc and musl systems if possible
  • Report other broken packages not in the bug list
Project Difficulty
Medium