diff --git a/usr.bin/crunch/crunchgen/crunchgen.c b/usr.bin/crunch/crunchgen/crunchgen.c index dcaff9d7a91f..a036de76c47d 100644 --- a/usr.bin/crunch/crunchgen/crunchgen.c +++ b/usr.bin/crunch/crunchgen/crunchgen.c @@ -102,7 +102,7 @@ static int goterror = 0; static const char *pname = "crunchgen"; -static int verbose, readcache, useobjs, oneobj, pie; /* options */ +static int verbose, readcache, useobjs, oneobj, pie, sanitizer; /* options */ static int reading_cache; static char *machine; static char *makeobjdirprefix; @@ -157,13 +157,14 @@ main(int argc, char **argv) if (argc > 0) pname = argv[0]; - while ((optc = getopt(argc, argv, "m:c:d:e:fopqD:L:Ov:")) != -1) { + while ((optc = getopt(argc, argv, "m:c:d:e:fopqsD:L:Ov:")) != -1) { switch(optc) { case 'f': readcache = 0; break; case 'p': pie = 1; break; case 'q': verbose = 0; break; case 'O': oneobj = 0; break; case 'o': useobjs = 1, oneobj = 0; break; + case 's': sanitizer = 1; break; case 'm': (void)estrlcpy(outmkname, optarg, sizeof(outmkname)); break; case 'c': (void)estrlcpy(outcfname, optarg, sizeof(outcfname)); break; @@ -922,6 +923,8 @@ top_makefile_rules(FILE *outmk) if (!pie) fprintf(outmk, "NOPIE=\n"); + if (!sanitizer) + fprintf(outmk, "NOSANITIZER=\n"); fprintf(outmk, "NOMAN=\n\n"); fprintf(outmk, "DBG=%s\n", dbg);