Index: documentation/content/en/articles/committers-guide/_index.adoc =================================================================== --- documentation/content/en/articles/committers-guide/_index.adoc +++ documentation/content/en/articles/committers-guide/_index.adoc @@ -3479,6 +3479,7 @@ If your changes are anywhere else, make sure you can still make world. If your changes are to a branch, make sure your testing occurs with a machine which is running that code. If you have a change which also may break another architecture, be sure and test on all supported architectures. +If you change the build system or use compiler specific features, make sure it works in all <>. Please refer to the https://www.FreeBSD.org/internal/[FreeBSD Internal Page] for a list of available resources. As other architectures are added to the FreeBSD supported platforms list, the appropriate shared testing resources will be made available. . Do not commit to contributed software without _explicit_ approval from the respective maintainers. @@ -3510,6 +3511,43 @@ The rules here are intended to provide guidance during the development process, and are distinct from the requirements for features and architectures listed in that section. The Tier rules for feature support on architectures at release-time are more strict than the rules for changes during the development process. +[[compilers]] +=== Policy on Multiple Compilers + +FreeBSD has built with both clang and gcc for some time. +This section documents where we use different compilers, and the expectations around that. + +The FreeBSD project provides an in-tree compiler. +This compiler is currently clang 15.x. +Due to being in the tree, this compiler is the most supported compiler. +All changes are expected to compile with it, prior to commit. +Complete testing, as appropriate for the change, should be done with this compiler. + +The FreeBSD project also support out-of-tree compilers. +At present, this is gcc 9.x and 12.x. +Ideally, committers should test compile with this compiler, especially large change. +This compiler is available as the ${TARGET_ARCH}-gcc package, such as package:aarch64-gcc[] or packkage:riscv64-gcc[]. +The project runs automated CI jobs to build everything with these compilers. +Committers are expected to fix the jobs they break with their changes. + +The FreeBSD also has some CI pipelines on github. +For pull requests on github and some branches pushed to the github forks, a number of cross compilation jobs run. +These test FreeBSD building using a version of clang that sometimes lags the in-tree compiler by a major version for a time. + +The FreeBSD project is also upgrading compilers. +Both clang and gcc are fast moving targets. +Some work to change things in the tree, for example removing the old-style K&R function declarations and definitions, will land in the tree prior to the compiler landing. +Committers should try to be mindful about this and be receptive to looking into problems with their code or changes with these new compilers. + +In addition to the compiler, llvm's LLD and gnu's binutils are used for the low-level toolchains to assembler and link the files that the compilers produce. +These are also tested with the various CI jobs we have. +Although rare, some changes may tickle bugs or specific behavior of these toolchains and may require some adjustments. + +The FreeBSD build system currently has much code to accomodate these different environments. +As new warnings are added to compilers, the project tries to fix them. +However, sometimes these warnings require extensive rework, so are suppressed in some way by using make variables that evaluate to the proper thing depending on the compiler version. +Developers should be mindful of this, and ensure any compiler specific flags are properly conditionalized. + === Other Suggestions When committing documentation changes, use a spell checker before committing.