From ddcd6d1b7368f2ea5691c1957c83e29ff2a71357 Mon Sep 17 00:00:00 2001 From: William Roberts Date: Mon, 8 Jun 2020 17:38:16 -0500 Subject: [PATCH] README: start a section for documenting CFLAGS Start a section in the README for documenting that custom CFLAGS yields custom results and that your mileage may vary. The first CFLAG to document that you likely want to include is -fno-semantic-interposition. Signed-off-by: William Roberts Acked-by: Stephen Smalley --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 9d64f0b5..4d33686d 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,17 @@ lacks library functions or other dependencies relied upon by your distribution. If it breaks, you get to keep both pieces. +## Setting CFLAGS + +Setting CFLAGS during the make process will cause the omission of many defaults. While the project strives +to provide a reasonable set of default flags, custom CFLAGS could break the build, or have other undesired +changes on the build output. Thus, be very careful when setting CFLAGS. CFLAGS that are encouraged to be +set when overriding are: + +- -fno-semantic-interposition for gcc or compilers that do not do this. clang does this by default. clang-10 and up + will support passing this flag, but ignore it. Previous clang versions fail. + + macOS -----