Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/crunch/crunchgen Introduce a new option -S in crunch...



details:   https://anonhg.NetBSD.org/src/rev/849d45503418
branches:  trunk
changeset: 834063:849d45503418
user:      kamil <kamil%NetBSD.org@localhost>
date:      Wed Jul 25 23:41:28 2018 +0000

description:
Introduce a new option -S in crunchgen(1)

The -S argument enables sanitization with a sanitizer in libc.

diffstat:

 usr.bin/crunch/crunchgen/crunchgen.1 |   4 +++-
 usr.bin/crunch/crunchgen/crunchgen.c |  13 +++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diffs (73 lines):

diff -r 9aebc4c4ece1 -r 849d45503418 usr.bin/crunch/crunchgen/crunchgen.1
--- a/usr.bin/crunch/crunchgen/crunchgen.1      Wed Jul 25 23:34:25 2018 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.1      Wed Jul 25 23:41:28 2018 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: crunchgen.1,v 1.35 2018/06/21 10:55:54 kamil Exp $
+.\"    $NetBSD: crunchgen.1,v 1.36 2018/07/25 23:41:28 kamil Exp $
 .\"
 .\" Copyright (c) 1994 University of Maryland
 .\" All Rights Reserved.
@@ -131,6 +131,8 @@
 Status messages are suppressed.
 .It Fl s
 Enable sanitization.
+.It Fl S
+Enable sanitization with a sanitizer in libc.
 .It Fl v Ar varspec
 Append a variable specification to the on-the fly generated Makefile.
 .El
diff -r 9aebc4c4ece1 -r 849d45503418 usr.bin/crunch/crunchgen/crunchgen.c
--- a/usr.bin/crunch/crunchgen/crunchgen.c      Wed Jul 25 23:34:25 2018 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.c      Wed Jul 25 23:41:28 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crunchgen.c,v 1.87 2018/06/21 10:55:54 kamil Exp $     */
+/*     $NetBSD: crunchgen.c,v 1.88 2018/07/25 23:41:28 kamil Exp $     */
 /*
  * Copyright (c) 1994 University of Maryland
  * All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: crunchgen.c,v 1.87 2018/06/21 10:55:54 kamil Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.88 2018/07/25 23:41:28 kamil Exp $");
 #endif
 
 #include <stdlib.h>
@@ -102,7 +102,9 @@
 
 static const char *pname = "crunchgen";
 
-static int verbose, readcache, useobjs, oneobj, pie, sanitizer;        /* options */
+/* options */
+static int verbose, readcache, useobjs, oneobj, pie, libcsanitizer, sanitizer;
+
 static int reading_cache;
 static char *machine;
 static char *makeobjdirprefix;
@@ -165,6 +167,7 @@
        case 'O':       oneobj = 0; break;
        case 'o':       useobjs = 1, oneobj = 0; break;
        case 's':       sanitizer = 1; break;
+       case 'S':       libcsanitizer = 1; break;
 
        case 'm':       (void)estrlcpy(outmkname, optarg, sizeof(outmkname)); break;
        case 'c':       (void)estrlcpy(outcfname, optarg, sizeof(outcfname)); break;
@@ -923,6 +926,8 @@
 
     if (!pie)
            fprintf(outmk, "NOPIE=\n");
+    if (!libcsanitizer)
+           fprintf(outmk, "NOLIBCSANITIZER=\n");
     if (!sanitizer)
            fprintf(outmk, "NOSANITIZER=\n");
     fprintf(outmk, "NOMAN=\n\n");
@@ -1020,7 +1025,7 @@
        for (lst = vars; lst != NULL; lst = lst->next)
            fprintf(outmk, "%s\\n", lst->str);
        fprintf(outmk, "'\\\n");
-       fprintf(outmk, MAKECMD "%s ", sanitizer ? "" : "NOSANITIZER=");
+       fprintf(outmk, MAKECMD "%s %s ", libcsanitizer ? "" : "NOLIBCSANITIZER=", sanitizer ? "" : "NOSANITIZER=");
        if (p->objs)
            fprintf(outmk, "${%s_OBJS} ) \n\n", p->ident);
        else



Home | Main Index | Thread Index | Old Index