changeset 651:5709381df7e8

Added -nodefaultlib switch do disable implicitly linked standard lib modules
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sun, 05 Oct 2008 18:55:43 +0200
parents aa6a0b7968f7
children c8fcde3337b0
files dmd/mars.c dmd/mars.h
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/mars.c	Sun Oct 05 17:28:15 2008 +0200
+++ b/dmd/mars.c	Sun Oct 05 18:55:43 2008 +0200
@@ -224,6 +224,7 @@
   -J<path>       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 @@
         }
         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 @@
 	    global.params.linkswitches->push(arg);
 	}
     }
-    else
+    else if (!global.params.noDefaultLib)
     {
 	char *arg;
 	arg = (char *)mem.malloc(64);
--- a/dmd/mars.h	Sun Oct 05 17:28:15 2008 +0200
+++ b/dmd/mars.h	Sun Oct 05 18:55:43 2008 +0200
@@ -150,6 +150,7 @@
     char llvmAnnotate;
     char useInlineAsm;
     char fqnNames; // use fully qualified object names
+    char noDefaultLib;
 };
 
 struct Global