X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghc-inplace.c;fp=compiler%2Fghc-inplace.c;h=abedefe3cb96caaeef70dbae0f1f0159a8b8006c;hb=db7a768882134defdd282bd626b29bead6e62b00;hp=0000000000000000000000000000000000000000;hpb=552eb456fcaeee5b69ec70555b5a269dd7daf535;p=ghc-hetmet.git diff --git a/compiler/ghc-inplace.c b/compiler/ghc-inplace.c new file mode 100644 index 0000000..abedefe --- /dev/null +++ b/compiler/ghc-inplace.c @@ -0,0 +1,21 @@ + +#include +#include +#include +#include + +int main(int argc, char **argv) { + char **args; + args = malloc(sizeof(char *) * (argc + 3)); + if (args == NULL) { + fprintf(stderr, "Malloc failed\n"); + exit(1); + } + args[0] = GHC_PATH; + args[1] = "-B" TOP_ABS; + args[2] = "-fhardwire-lib-paths"; + memcpy(args + 3, argv + 1, sizeof(char *) * (argc - 1)); + args[argc+2] = NULL; + execv(GHC_PATH, args); + return 0; +}