GCC 4.4 was included in Red Hat Enterprise Linux 6. The following table lists recommended build flags (as seen by the gcc and g++ compiler drivers), along with a brief description of which version of Red Hat Enterprise Linux and Fedora are applicable:Ī note about GCC versions for Red Hat Enterprise Linux-GCC 4.8 was included in Red Hat Enterprise Linux 7. Recommended flags vary between distribution versions because of toolchain and kernel limitations. When you are using one of these distributions with the included compiler, this environment is recreated, requiring an extensive list of flags to be specified. We only align the architecture selection to the minimum architecture level required by the distribution.Ĭonsequently, developers need to pay attention to build flags, and manage them according to the needs of their project for optimization, level of warning and error detection, and security hardening.ĭuring the build process to create distributions such as Fedora and Red Hat Enterprise Linux, compiler and linker flags have to be injected, as discussed below. While some aspects of the default settings can be changed when building GCC and Binutils from source, the toolchain we supply in our RPM builds does not do this. For historical reasons, the GCC and Binutils upstream projects do not enable optimization or any security hardening by default. The GNU-based toolchain in Red Hat Enterprise Linux and Fedora (consisting of GCC programs such as gcc, g++, and Binutils programs such as as and ld) are very close to upstream defaults in terms of build flags. Did you know that when you compile your C or C++ programs, GCC will not enable all exceptions by default? Do you know which build flags you need to specify in order to obtain the same level of security hardening that GNU/Linux distributions use (such as Red Hat Enterprise Linux and Fedora)? This article walks through a list of recommended build flags.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |