bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Robbie Harwood <rharwood@redhat.com>
To: bug-gnulib@gnu.org
Cc: Peter Jones <pjones@redhat.com>, Robbie Harwood <rharwood@redhat.com>
Subject: [PATCH 07/11] Make CFLAGS less painful
Date: Mon, 25 Oct 2021 17:55:40 -0400	[thread overview]
Message-ID: <20211025215543.111906-8-rharwood@redhat.com> (raw)
In-Reply-To: <20211025215543.111906-1-rharwood@redhat.com>

From: Peter Jones <pjones@redhat.com>

Signed-off-by: Peter Jones <pjones@redhat.com>
[rharwood@redhat.com: make rpm gunk conditional]
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
 gnulib-tool | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnulib-tool b/gnulib-tool
index 9c4a6c17e..24cdbe2da 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -3841,18 +3841,23 @@ func_emit_lib_Makefile_am ()
     cppflags_part1=
   fi
   if $for_test; then
-    cppflags_part2=" -DGNULIB_STRICT_CHECKING=1"
+    cppflags_part2=" \$(HOST_CPPFLAGS) -DGNULIB_STRICT_CHECKING=1 -D_GLIBCXX_ASSERTIONS "
   else
-    cppflags_part2=
+    cppflags_part2=" \$(HOST_CPPFLAGS) -D_GLIBCXX_ASSERTIONS "
+  fi
+  rpm_extra_cflags=
+  if test -f "/usr/lib/rpm/redhat/redhat-hardened-cc1" && test -f "/usr/lib/rpm/redhat/redhat-annobin-cc1"; then
+    rpm_extra_cflags="-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1"
   fi
   if test -z "$makefile_name"; then
     echo
     echo "AM_CPPFLAGS =$cppflags_part1$cppflags_part2"
-    echo "AM_CFLAGS ="
+    echo "AM_CFLAGS = \$(HOST_CFLAGS) -fexceptions -fstack-protector-strong -fno-strict-aliasing $rpm_extra_cflags -Wp,-D_GLIBCXX_ASSERTIONS -Wp,-DGNULIB_STRICT_CHECKING=1 -W -Wall -Wextra -Wno-undef -Wno-missing-field-initializers -Wno-unused-parameter -Werror -Wno-error=vla -Wno-error=type-limits -Werror=format-security -Werror=trampolines -Wno-error=format-nonliteral -Wno-error=cast-align "
   else
     if test -n "$cppflags_part1$cppflags_part2"; then
       echo
       echo "AM_CPPFLAGS +=$cppflags_part1$cppflags_part2"
+      echo "AM_CFLAGS = \$(HOST_CFLAGS) -fexceptions -fstack-protector-strong -fno-strict-aliasing $rpm_extra_cflags -Wp,-D_GLIBCXX_ASSERTIONS -Wp,-DGNULIB_STRICT_CHECKING=1 -W -Wall -Wextra -Wno-undef -Wno-missing-field-initializers -Wno-unused-parameter -Werror -Wno-error=vla -Wno-error=type-limits -Werror=format-security -Werror=trampolines -Wno-error=format-nonliteral -Wno-error=cast-align "
     fi
   fi
   echo
-- 
2.33.0



  parent reply	other threads:[~2021-10-25 22:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 21:55 [PATCH 00/11] Code hygiene fixes from grub Robbie Harwood
2021-10-25 21:55 ` [PATCH 01/11] Fix base64 module to work with grub codebase Robbie Harwood
2021-10-27 11:15   ` Simon Josefsson via Gnulib discussion list
2021-10-28 19:32     ` Robbie Harwood
2021-11-09 18:35       ` Simon Josefsson via Gnulib discussion list
2021-11-09 18:52       ` Paul Eggert
2021-11-09 19:34         ` Robbie Harwood
2021-11-23 16:24           ` Daniel Kiper
2021-12-09 15:43             ` Daniel Kiper
2021-10-25 21:55 ` [PATCH 02/11] argp-parse.c (__argp_input): Don't crash if pstate is NULL Robbie Harwood
2021-10-25 21:55 ` [PATCH 03/11] gnulib/regexec: Fix possible null-dereference Robbie Harwood
2021-10-25 21:55 ` [PATCH 04/11] gnulib/regexec: Resolve unused variable Robbie Harwood
2021-10-25 21:55 ` [PATCH 05/11] Fix width computation Robbie Harwood
2021-10-25 21:55 ` [PATCH 06/11] Make gnulib's regcomp not abort() Robbie Harwood
2021-10-25 21:55 ` Robbie Harwood [this message]
2021-10-25 21:55 ` [PATCH 08/11] Fix __argp_fmtstream_point()'s return type and comparisons with it Robbie Harwood
2021-10-25 21:55 ` [PATCH 09/11] Fix up a bunch of "gcc -Werror=sign-compare" complaints Robbie Harwood
2021-10-25 21:55 ` [PATCH 10/11] Paper over a stringop-overflow warning about wide char handling Robbie Harwood
2021-10-25 21:55 ` [PATCH 11/11] Fixup for -Werror=ignored-qualifiers issues Robbie Harwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211025215543.111906-8-rharwood@redhat.com \
    --to=rharwood@redhat.com \
    --cc=bug-gnulib@gnu.org \
    --cc=pjones@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).