Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makefile: update CPPFLAGS & CFLAGS #294

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

makefile: update CPPFLAGS & CFLAGS #294

wants to merge 1 commit into from

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/1544736761-7920-1-git-send-email-william.c.roberts@intel.com/

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 <zhixu.liu@gmail.com>
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