Skip to content

Conversation

clan
Copy link

@clan clan commented Jan 18, 2025

  1. _FORTIFY_SOURCE is defined built-in by compiler, so undefine the define to slience warnings like:

: warning: "_FORTIFY_SOURCE" redefined
: note: this is the location of the previous definition

  1. -Wno-unknown-warning-option & -Wno-gnu-alignof-expression are available for clang only, but "-fplan9-extensions" is used which is gcc only! So remove these two warning options to avoid:

cc1: note: unrecognized command-line option ‘-Wno-gnu-alignof-expression’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics

@lahwaacz
Copy link

Where do you get warning: "_FORTIFY_SOURCE" redefined ? The documentation for GCC at least says nothing about the need to undefine it: https://www.gnu.org/software/libc/manual/html_node/Source-Fortification.html

@clan
Copy link
Author

clan commented Jan 19, 2025

Where do you get warning: "_FORTIFY_SOURCE" redefined ? The documentation for GCC at least says nothing about the need to undefine it: https://www.gnu.org/software/libc/manual/html_node/Source-Fortification.html

see: SELinuxProject/selinux@4f96b32
and discussion here: https://patchwork.kernel.org/project/selinux/patch/[email protected]/

I encoutered this warning when compilng in Gentoo Hardened profile.

1. _FORTIFY_SOURCE is defined built-in by certian build of gcc (such as Gentoo
   in Hardened profile), so undefine the define to slience warnings like:
    <command-line>: warning: "_FORTIFY_SOURCE" redefined
    <built-in>: note: this is the location of the previous definition
2. -Wno-unknown-warning-option & -Wno-gnu-alignof-expression are
   available for clang only, but "-fplan9-extensions" is used which is
   gcc only! So remove these two warning options to avoid:
     cc1: note: unrecognized command-line option ‘-Wno-gnu-alignof-expression’ may have been intended to silence earlier diagnostics
     cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics

Signed-off-by: Z. Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants