projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
When saying RTS options are disabled, also say how to enable them
[ghc-hetmet.git]
/
rts
/
RtsFlags.c
diff --git
a/rts/RtsFlags.c
b/rts/RtsFlags.c
index
b99995b
..
93482f5
100644
(file)
--- a/
rts/RtsFlags.c
+++ b/
rts/RtsFlags.c
@@
-10,6
+10,7
@@
#include "PosixSource.h"
#include "Rts.h"
#include "PosixSource.h"
#include "Rts.h"
+#include "RtsOpts.h"
#include "RtsUtils.h"
#include "Profiling.h"
#include "RtsUtils.h"
#include "Profiling.h"
@@
-413,7
+414,13
@@
setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[])
char *ghc_rts = getenv("GHCRTS");
if (ghc_rts != NULL) {
char *ghc_rts = getenv("GHCRTS");
if (ghc_rts != NULL) {
- splitRtsFlags(ghc_rts, rts_argc, rts_argv);
+ if (rtsOptsEnabled) {
+ splitRtsFlags(ghc_rts, rts_argc, rts_argv);
+ }
+ else {
+ errorBelch("Warning: Ignoring GHCRTS variable as RTS options are disabled.\n Link with -rtsopts to enable them.");
+ // We don't actually exit, just warn
+ }
}
}
}
}
@@
-432,7
+439,13
@@
setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[])
break;
}
else if (strequal("+RTS", argv[arg])) {
break;
}
else if (strequal("+RTS", argv[arg])) {
- mode = RTS;
+ if (rtsOptsEnabled) {
+ mode = RTS;
+ }
+ else {
+ errorBelch("RTS options are disabled. Link with -rtsopts to enable them.");
+ stg_exit(EXIT_FAILURE);
+ }
}
else if (strequal("-RTS", argv[arg])) {
mode = PGM;
}
else if (strequal("-RTS", argv[arg])) {
mode = PGM;