diff mbox series

[v2] README: start a section for documenting CFLAGS

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

Commit Message

William Roberts June 8, 2020, 3:37 p.m. UTC
From: William Roberts <william.c.roberts@intel.com>

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 -fsemantic-interposition.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
v2:
  - Fixed commit message spelling of yields.
  - Reduced usages of CFLAGS in documentation.

 README.md | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Stephen Smalley June 8, 2020, 4:21 p.m. UTC | #1
On Mon, Jun 8, 2020 at 11:37 AM <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 yields
> CUSTOM results and that your mileage may vary. The first CFLAG to
> document that you likely want to include is -fsemantic-interposition.

CUSTOM is all-caps for some reason, and it should be
-fno-semantic-interposition.

> diff --git a/README.md b/README.md
> index 9d64f0b5cf90..eb8e170ea1f7 100644
> --- a/README.md
> +++ b/README.md
> +
> +- -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
William Roberts June 8, 2020, 10:34 p.m. UTC | #2
On Mon, Jun 8, 2020 at 11:21 AM Stephen Smalley
<stephen.smalley.work@gmail.com> wrote:
>
> On Mon, Jun 8, 2020 at 11:37 AM <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 yields
> > CUSTOM results and that your mileage may vary. The first CFLAG to
> > document that you likely want to include is -fsemantic-interposition.
>
> CUSTOM is all-caps for some reason, and it should be

Meant to emphasize CUSTOM RESULTS, but it only really emphasizes
it correctly if RESULTS is also capitalized (which it wasn't).

> -fno-semantic-interposition.

Argh, I forgot to change that, sorry.

>
> > diff --git a/README.md b/README.md
> > index 9d64f0b5cf90..eb8e170ea1f7 100644
> > --- a/README.md
> > +++ b/README.md
> > +
> > +- -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
diff mbox series

Patch

diff --git a/README.md b/README.md
index 9d64f0b5cf90..eb8e170ea1f7 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:
+
+- -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
 -----