public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Eero Tamminen <eero.t.tamminen@intel.com>
Subject: [igt-dev] [PATCH i-g-t 5/5] meson: Use -D_FORTIFY_SOURCE=2 on optimized builds
Date: Thu,  9 May 2019 13:03:26 +0300	[thread overview]
Message-ID: <20190509100326.29224-5-arkadiusz.hiler@intel.com> (raw)
In-Reply-To: <20190509100326.29224-1-arkadiusz.hiler@intel.com>

Some distribution enable _FORTIFY_SOURCE implicitly if user sets of -O1
greater in the CFLAGS, which may cause surprise compile failures.

Let's fortify explicitly and for everyone with default build, since the
checks provided are good.

Cc: Eero Tamminen <eero.t.tamminen@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 meson.build | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meson.build b/meson.build
index 2a5a8580..2d1f5c50 100644
--- a/meson.build
+++ b/meson.build
@@ -255,6 +255,13 @@ config.set10('HAVE_MEMFD_CREATE', have)
 add_project_arguments('-D_GNU_SOURCE', language : 'c')
 add_project_arguments('-include', 'config.h', language : 'c')
 
+# FEATURE_TEST_MACROS(7)
+# performs lightweight overflow checks on quite a few libc functions
+# requires -O optimizations
+if  ['debugoptimized', 'release', 'minsize'].contains(get_option('buildtype'))
+	add_project_arguments('-D_FORTIFY_SOURCE=2', language : 'c')
+endif
+
 config.set('PACKAGE_NAME', meson.project_name())
 config.set_quoted('PACKAGE_VERSION', meson.project_version())
 config.set_quoted('PACKAGE', meson.project_name())
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-05-09 10:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 10:03 [igt-dev] [PATCH i-g-t 1/5] meson/cc: Disable memory-allocating builtins Arkadiusz Hiler
2019-05-09 10:03 ` [igt-dev] [PATCH i-g-t 2/5] lib/tests/igt_subtest_group: Operate within defined behavior Arkadiusz Hiler
2019-05-09 10:31   ` Ser, Simon
2019-05-09 11:11     ` Arkadiusz Hiler
2019-05-09 11:30       ` Ser, Simon
2019-05-09 10:03 ` [igt-dev] [PATCH i-g-t 3/5] runner_tests: " Arkadiusz Hiler
2019-05-09 10:43   ` Petri Latvala
2019-05-09 10:03 ` [igt-dev] [PATCH i-g-t 4/5] meson: Change the default build type to debugoptimized Arkadiusz Hiler
2019-05-09 10:03 ` Arkadiusz Hiler [this message]
2019-05-09 11:37 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] meson/cc: Disable memory-allocating builtins Patchwork
2019-05-09 14:54 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-05-10  5:07   ` Arkadiusz Hiler
2019-05-09 20:35 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] meson/cc: Disable memory-allocating builtins (rev2) Patchwork
2019-05-10  4:46 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-05-10  8:28 ` [igt-dev] [PATCH i-g-t 1/5] meson/cc: Disable memory-allocating builtins Daniel Vetter

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

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

  git send-email \
    --in-reply-to=20190509100326.29224-5-arkadiusz.hiler@intel.com \
    --to=arkadiusz.hiler@intel.com \
    --cc=eero.t.tamminen@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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