On Fri, Apr 23, 2021 at 11:18:59AM -0400, Ben Cotton wrote: > https://fedoraproject.org/wiki/Changes/CompilerPolicy > > == Summary == > Fedora has historically forced packages to build with GCC unless the > upstream project for the package only supported Clang/LLVM. This > change proposal replaces that policy with one where, given a good > technical reason, a packager may: > * Choose to build with their package with clang even if the upstream > project supports gcc. > * Choose to build with gcc even if upstream does not support it. > > The goal is to give the packager the ability to use their own > technical judgement to choose the best compiler. Does the choice have to be consistent per package, or is it within expectations to use different compilers on different Fedora arches ? > == Detailed Description == > It is worth noting that Clang/LLVM's implementation of > -fstack-clash-protection, which is one of Fedora's default compiler > flags, is under development and does not yet have an implementation > for AArch64. This would suggest need to use GCC on x86 and CLang on aarch64 within a single package. > == Feedback == > * The original proposal stated that Fedora packagers should follow > upstream's compiler preferences, but based on feedback, the proposal > was updated to allow a packager to choose the compiler they feel is > best as long as there is a valid technical reason to do so. > > == Benefit to Fedora == > Other packages that may benefit include: > * llvm/clang (currently has to disable LTO due to compilation failures). > * qemu (could take advantage of clang's CFI hardening feature). Upstream QEMU has been considering whether there's any loss of features implied by replacing GCC with use of CLang in QEMU builds. One edge case was discovered for s390x target. GCC has a min code generation target of z900 (hw release circa 2000), CLang has a min code genreation target of z10 (hw release circa 2008) This doesn't matter for compiling QEMU itself, as anyone actually running QEMU on an s390x is likely to have z10 or newer. It does cause a problem with firmware builds though. If QEMU wants to emulate old hardware (qemu-system-s390x -cpu z900 ..args...), then the firmware blob needs to have been built to target z900 which is not possible with CLang. So if QEMU is switched to use CLang, then we will possibly need to use GCC still for QEMU's firmware builds, or only use CLang on certain Fedora arches. This is quite a niche problem that's unlikely to cause issues for most people, but its a illustration that swapping compilers out can have unexpected consequences/complications. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :| _______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure