From 81b93325ca4dc8c4414bdcd44f552ffa6d56332e Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Sun, 5 Oct 2008 18:55:43 +0200 Subject: [PATCH] Added -nodefaultlib switch do disable implicitly linked standard lib modules --- dmd/mars.c | 5 ++++- dmd/mars.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dmd/mars.c b/dmd/mars.c index dbbd5345..a611aad8 100644 --- a/dmd/mars.c +++ b/dmd/mars.c @@ -224,6 +224,7 @@ Path options:\n\ -J where to look for string imports\n\ -defaultlib=name set default library for non-debug build\n\ -debuglib=name set default library for debug build\n\ + -nodefaultlib don't add a default library for linking implicitly\n\ \n\ Misc options:\n\ -v verbose\n\ @@ -428,6 +429,8 @@ int main(int argc, char *argv[]) } else if (strcmp(p + 1, "noasm") == 0) global.params.useInlineAsm = 0; + else if (strcmp(p + 1, "nodefaultlib") == 0) + global.params.noDefaultLib = 1; else if (p[1] == 'o') { switch (p[2]) @@ -709,7 +712,7 @@ int main(int argc, char *argv[]) global.params.linkswitches->push(arg); } } - else + else if (!global.params.noDefaultLib) { char *arg; arg = (char *)mem.malloc(64); diff --git a/dmd/mars.h b/dmd/mars.h index 219c39c9..d7c3481e 100644 --- a/dmd/mars.h +++ b/dmd/mars.h @@ -150,6 +150,7 @@ struct Param char llvmAnnotate; char useInlineAsm; char fqnNames; // use fully qualified object names + char noDefaultLib; }; struct Global