aboutsummaryrefslogtreecommitdiffstats
path: root/asm
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2020-08-27 13:01:57 -0700
committerH. Peter Anvin (Intel) <hpa@zytor.com>2020-08-27 13:06:08 -0700
commitbf79786e894ad16519e5374291205ebe71da07b8 (patch)
tree0039a1e4e04cee69c2c3d124aac70555c953e2b1 /asm
parent7497737aa2ee4cd2e4a8f2f6bafde7719980b488 (diff)
downloadnasm-bf79786e894ad16519e5374291205ebe71da07b8.tar.gz
nasm-bf79786e894ad16519e5374291205ebe71da07b8.tar.xz
nasm-bf79786e894ad16519e5374291205ebe71da07b8.zip
Add option to create reproducible output
We need the ability to produce consistent output for our own tests, anyway, so make this a user-accessible feature. This was requested in BR 3392635. This obsoletes the NASM_TEST_RUN environment variable; simply use the normal NASMENV environment variable instead. The .obj tests in travis needed to be updated in order to remove the rather pointless suffix " CONST" from the NASM signatures. Reported-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'asm')
-rw-r--r--asm/nasm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/asm/nasm.c b/asm/nasm.c
index c5d03c8a..e5ae89af 100644
--- a/asm/nasm.c
+++ b/asm/nasm.c
@@ -938,7 +938,8 @@ enum text_options {
OPT_LIMIT,
OPT_KEEP_ALL,
OPT_NO_LINE,
- OPT_DEBUG
+ OPT_DEBUG,
+ OPT_REPRODUCIBLE
};
enum need_arg {
ARG_NO,
@@ -970,6 +971,7 @@ static const struct textargs textopts[] = {
{"keep-all", OPT_KEEP_ALL, ARG_NO, 0},
{"no-line", OPT_NO_LINE, ARG_NO, 0},
{"debug", OPT_DEBUG, ARG_MAYBE, 0},
+ {"reproducible", OPT_REPRODUCIBLE, ARG_NO, 0},
{NULL, OPT_BOGUS, ARG_NO, 0}
};
@@ -1332,6 +1334,9 @@ static bool process_arg(char *p, char *q, int pass)
case OPT_DEBUG:
debug_nasm = param ? strtoul(param, NULL, 10) : debug_nasm+1;
break;
+ case OPT_REPRODUCIBLE:
+ reproducible = true;
+ break;
case OPT_HELP:
help(stdout);
exit(0);
@@ -2293,6 +2298,8 @@ static void help(FILE *out)
" --lprefix str prepend the given string to local symbols\n"
" --lpostfix str append the given string to local symbols\n"
"\n"
+ " --reproducible attempt to produce run-to-run identical output\n"
+ "\n"
" -w+x enable warning x (also -Wx)\n"
" -w-x disable warning x (also -Wno-x)\n"
" -w[+-]error promote all warnings to errors (also -Werror)\n"