diff mbox series

README: start a section for documenting CFLAGS

Message ID 20200602185507.3784-1-william.c.roberts@intel.com (mailing list archive)
State Superseded
Headers show
Series README: start a section for documenting CFLAGS | expand

Commit Message

William Roberts June 2, 2020, 6:55 p.m. UTC
From: William Roberts <william.c.roberts@intel.com>

Start a section in the README for documenting that custom CFLAGS yeilds
CUSTOM results and that your mileage may vary. The first CFLAG to
document that you likely want to include is -fsemantic-interposition.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
 README.md | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Stephen Smalley June 4, 2020, 7:03 p.m. UTC | #1
On Tue, Jun 2, 2020 at 2:55 PM <bill.c.roberts@gmail.com> wrote:
>
> From: William Roberts <william.c.roberts@intel.com>
>
> Start a section in the README for documenting that custom CFLAGS yeilds
> CUSTOM results and that your mileage may vary. The first CFLAG to
> document that you likely want to include is -fsemantic-interposition.

Spelling error (yields), capitalization (CUSTOM), and it should be
-fno-semantic-interposition.

>
> Signed-off-by: William Roberts <william.c.roberts@intel.com>
> ---
>  README.md | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/README.md b/README.md
> index 9d64f0b5cf90..f37a9f91f51e 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 default CFLAGS. While the project strives
> +to provide a sane set of default CFLAGS, custom CFLAGS could break the build, or have other undesired changes
> +on the build output. Thus, be very careful when setting CFLAGS. CFLAGS that we encourage to be set when
> +overriding CFLAGS are:
> +
> +- -fsemantic-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.
> +
> +

-fno-semantic-interposition.  Also overly repetitive use of CFLAGS above.
diff mbox series

Patch

diff --git a/README.md b/README.md
index 9d64f0b5cf90..f37a9f91f51e 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 default CFLAGS. While the project strives
+to provide a sane set of default CFLAGS, custom CFLAGS could break the build, or have other undesired changes
+on the build output. Thus, be very careful when setting CFLAGS. CFLAGS that we encourage to be set when
+overriding CFLAGS are:
+
+- -fsemantic-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
 -----