[Git][NTPsec/ntpsec][master] waf: quiet most mocOS warnings about -pie

Gary E. Miller gitlab at mg.gitlab.com
Thu Feb 16 23:09:00 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
9179f48b by Gary E. Miller at 2017-02-16T15:03:30-08:00
waf: quiet most mocOS warnings about -pie

- - - - -


1 changed file:

- wafhelpers/configure.py


Changes:

=====================================
wafhelpers/configure.py
=====================================
--- a/wafhelpers/configure.py
+++ b/wafhelpers/configure.py
@@ -200,6 +200,8 @@ def cmd_configure(ctx, config):
     cc_test_flags = [
         ('PIE', '-pie -fPIE'),
         ('gnu99', '-std=gnu99'),
+        # this quiets most of macOS warnings on -fpie
+        ('unused', '-Qunused-arguments'),
         ]
 
     if ctx.options.enable_debug_gdb:
@@ -228,8 +230,6 @@ def cmd_configure(ctx, config):
 
     # check if C compiler supports some flags
     for (name, ccflag) in cc_test_flags:
-        # FIXME??: on macOS can get this warning:
-        # clang: warning: argument unused during compilation: '-pie'
         ctx.check_cc(define_name='HAS_' + name,
                      cflags=ccflag,
                      fragment='int main() {}\n',
@@ -258,6 +258,11 @@ def cmd_configure(ctx, config):
             ('relrow', "-Wl,-z,relro"),  # hardening, marks some read only,
             ]
 
+    if ctx.env.HAS_unused:
+        ctx.env.CFLAGS += [
+            '-Qunused-arguments',
+            ]
+
     # XXX: -flto currently breaks link of ntpd
     if ctx.env.HAS_LTO and False:
         ctx.env.CFLAGS += [



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/9179f48bd1340b2cbf83ff1d3fa088937bea5e73
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170216/b18f16e3/attachment.html>


More information about the vc mailing list