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]>
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

This PR is stale because it has been open 90 days with no activity. This PR will be closed in 30 days unless new comments are made or the stale label is removed. To skip these checks, apply the "lifecycle/frozen" label.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants