[Git][NTPsec/ntpsec][master] 5 commits: Fix (harmless) omission in --disable-dns-lookup cleanup

Hal Murray gitlab at mg.gitlab.com
Mon Jan 28 00:46:30 UTC 2019


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
3cdc73ba by Hal Murray at 2019-01-28T00:45:51Z
Fix (harmless) omission in --disable-dns-lookup cleanup

Spotted by Dave Morgan.  Thanks.

- - - - -
56e0be34 by Hal Murray at 2019-01-28T00:45:51Z
Add requirement of pthreads and removal of --disable-dns-lookup

It used to be that we almost didn't need pthreads if
dns lookup was disabled.  libcrypto drags it in via pthread_once.

- - - - -
6f18951d by Hal Murray at 2019-01-28T00:45:51Z
Add ChaCha20 and Poly1305 to attic/digest-find

- - - - -
3767609d by Hal Murray at 2019-01-28T00:45:51Z
Remove totally unused libraries

Everything in attic gets linked with the same set of libraries
even though most are not used by a particular routine.

- - - - -
bbabf502 by Hal Murray at 2019-01-28T00:45:51Z
Simplify libpthread processing

- - - - -


6 changed files:

- NEWS
- attic/digest-find.c
- attic/wscript
- ntpd/ntp_io.c
- − wafhelpers/check_pthread.py
- wscript


Changes:

=====================================
NEWS
=====================================
@@ -12,6 +12,8 @@ on user-visible changes.
 
 == Repository head ==
 
+Pthread support is now required.  --disable-dns-lookup is gone.
+
 NIST lockclock mode is now a runtime option set by the (previously unused)
 flag1 mode bit of the local-clock driver.
 


=====================================
attic/digest-find.c
=====================================
@@ -29,6 +29,7 @@ const char* digests[] = {
   "RMD160", "RIPEMD160",
   "SHA224", "SHA256", "SHA384", "SHA512",
   "MDC2", "GOST", "DSS1",
+  "ChaCha20", "Poly1305",
   NULL };
 
 unsigned char pkt[100];


=====================================
attic/wscript
=====================================
@@ -9,6 +9,6 @@ def build(ctx):
             features="c cprogram bld_include src_include",
             source=[name + ".c"],
             includes=["%s/%s/" % (bldnode, name)],
-            use="ntp M SSL CRYPTO RT THR PTHREAD",
+            use="ntp M CRYPTO RT PTHREAD",
             install_path=None,
         )


=====================================
ntpd/ntp_io.c
=====================================
@@ -2266,7 +2266,6 @@ io_handler(void)
 	  errno = EINTR;
 	}
 	pthread_sigmask(SIG_SETMASK, &runMask, NULL);
-	sigprocmask(SIG_SETMASK, &runMask, NULL);
 
 	if (nfound > 0) {
 		input_handler(&rdfdes);


=====================================
wafhelpers/check_pthread.py deleted
=====================================
@@ -1,71 +0,0 @@
-from waflib.Logs import pprint
-
-PTHREAD_FRAG = """
-#include <pthread.h>
-int main(void) {
-        pthread_mutex_t mutex;
-        pthread_mutex_init(&mutex, NULL);
-        pthread_mutex_destroy(&mutex);
-        return 0;
-}
-
-"""
-
-
-def check_pthread_header_lib(ctx):
-    ctx.check(header_name="pthread.h", includes=ctx.env.PLATFORM_INCLUDES,
-              mandatory=False, comment="pthread header")
-    ctx.check(feature="c cshlib", lib="pthread",
-              libpath=ctx.env.PLATFORM_LIBPATH, mandatory=False,
-              comment="pthread library")
-    # FreeBSD uses libthr rather than libpthread
-    # There may be some magic to translate
-    ctx.check_cc(lib="thr", mandatory=False,
-                 comment="thr library, required by some operating systems.")
-
-    if (ctx.get_define("HAVE_PTHREAD_H") and
-            (ctx.env.LIB_PTHREAD or ctx.env.LIB_THR)):
-        ctx.env.PTHREAD_HEADER_LIB = True
-
-
-def check_pthread_run(ctx):
-    if ctx.env.ENABLE_CROSS:
-        if ctx.env.PTHREAD_HEADER_LIB:  # XXX Remove when variant builds exist
-            ctx.define("HAVE_PTHREAD", 1, comment="pthread support")
-            ctx.env.PTHREAD_ENABLE = True
-        return
-
-    ctx.check(
-        fragment=PTHREAD_FRAG,
-        define_name="HAVE_PTHREAD",
-        features="c",
-        use="PTHREAD THR",
-        msg="Checking if pthread works",
-        includes=ctx.env.PLATFORM_INCLUDES,
-        export_includes=ctx.env.PLATFORM_INCLUDES,
-        mandatory=False,
-        comment="pthread support"
-    )
-
-    check_sanity(ctx, ctx.env.PTHREAD_HEADER_LIB, "pthread")
-
-    # XXX if pthread is part of 'libc' this will pass
-    # even if the header isn't detected.
-    if not ctx.get_define("HAVE_PTHREAD"):
-        ctx.fatal("Error: POSIX threads are required in order to build.")
-    else:
-        ctx.env.PTHREAD_ENABLE = True
-        ctx.define("HAVE_PTHREAD", 1, comment="pthread support")
-
-
-def check_sanity(ctx, cond, lib):
-    define = "HAVE_%s" % lib.upper()
-
-    if cond and (not ctx.get_define(define)):
-        pprint("RED",
-               "Warning %s headers detected, binaries do not build/run"
-               % lib)
-    elif (not cond) and ctx.get_define(define):
-        pprint("RED",
-               "Warning %s headers not detected, binaries build/run"
-               % lib)


=====================================
wscript
=====================================
@@ -296,6 +296,7 @@ def configure(ctx):
     # may depend on some libs, like -lssp
     ctx.check_cc(lib="m", comment="Math library")
     ctx.check_cc(lib="rt", mandatory=False, comment="realtime library")
+    ctx.check_cc(lib="pthread", mandatory=False, comment="threads library")
     ctx.check_cc(lib="execinfo", mandatory=False,
                  comment="BSD backtrace library")
     ret = ctx.check_cc(lib="bsd", mandatory=False,
@@ -802,16 +803,10 @@ int main(int argc, char **argv) {
             ctx.check_cc(header_name="seccomp.h")
             ctx.check_cc(lib="seccomp")
 
-    from wafhelpers.check_pthread import check_pthread_header_lib
-    check_pthread_header_lib(ctx)
-
     if not ctx.options.disable_mdns_registration:
         ctx.check_cc(header_name="dns_sd.h", lib="dns_sd", mandatory=False,
                      uselib_store="DNS_SD")
 
-    from wafhelpers.check_pthread import check_pthread_run
-    check_pthread_run(ctx)
-
     # Solaris needs -lsocket and -lnsl for socket code
     if ctx.env.DEST_OS == "sunos":
         ctx.check(features="c cshlib", lib="socket", mandatory=False)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/937d2b9675890e5dfbb47f64bc4e0a36f4e44e12...bbabf50256a5940f8466e40bc03179b8d176bd5a

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/937d2b9675890e5dfbb47f64bc4e0a36f4e44e12...bbabf50256a5940f8466e40bc03179b8d176bd5a
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20190128/24e16d26/attachment-0001.html>


More information about the vc mailing list