# HG changeset patch # User Christian Kamm # Date 1220375677 -7200 # Node ID f75b16f1e405b15a00047e4505c63796ca696ea3 # Parent 68d7df3f9b05bffc1cf8573ee6f4194909fc36d8# Parent aaba4f7c6d8a87f95b62ef3ad94c80e3cd298f9a Automated merge with http://hg.dsource.org/projects/llvmdc diff -r 68d7df3f9b05 -r f75b16f1e405 bin/llvmdc.conf --- a/bin/llvmdc.conf Sun Aug 31 18:51:14 2008 +0200 +++ b/bin/llvmdc.conf Tue Sep 02 19:14:37 2008 +0200 @@ -1,4 +1,4 @@ [Environment] -DFLAGS=-I%@P%/../tango -I%@P%/../tango/lib/common -L-L%@P%/../lib -R%@P%/../lib +DFLAGS=-I%@P%/../tango -I%@P%/../tango/lib/common -L-L%@P%/../lib diff -r 68d7df3f9b05 -r f75b16f1e405 bin/llvmdc.ini --- a/bin/llvmdc.ini Sun Aug 31 18:51:14 2008 +0200 +++ b/bin/llvmdc.ini Tue Sep 02 19:14:37 2008 +0200 @@ -1,2 +1,2 @@ [Environment] -DFLAGS=-I%@P%/../tango -I%@P%/../tango/lib/common -L-L%@P%/../lib -R%@P%/../lib +DFLAGS=-I%@P%/../tango -I%@P%/../tango/lib/common -L-L%@P%/../lib diff -r 68d7df3f9b05 -r f75b16f1e405 dmd/mars.c --- a/dmd/mars.c Sun Aug 31 18:51:14 2008 +0200 +++ b/dmd/mars.c Tue Sep 02 19:14:37 2008 +0200 @@ -223,11 +223,10 @@ -ignore ignore unsupported pragmas\n\ \n\ Path options:\n\ - -R provide path to the directory containing the runtime library\n\ -I where to look for imports\n\ -J where to look for string imports\n\ - -debuglib=name set symbolic debug library to name (currently ignored)\n\ - -defaultlib=name set default library to name (currently ignored)\n\ + -defaultlib=name set default library for non-debug build\n\ + -debuglib=name set default library for debug build\n\ \n\ Misc options:\n\ -v verbose\n\ @@ -321,9 +320,6 @@ global.params.runtimeImppath = 0; global.params.useInlineAsm = 1; - global.params.defaultlibname = "phobos"; - global.params.debuglibname = global.params.defaultlibname; - // Predefine version identifiers #if IN_LLVM VersionCondition::addPredefinedGlobalIdent("LLVM"); @@ -553,10 +549,6 @@ global.params.fileImppath = new Array(); global.params.fileImppath->push(p + 2); } - else if (p[1] == 'R') - { - global.params.runtimePath = p+2; - } else if (memcmp(p + 1, "debug", 5) == 0 && p[6] != 'l') { // Parse: @@ -637,11 +629,15 @@ } else if (memcmp(p + 1, "defaultlib=", 11) == 0) { - global.params.defaultlibname = p + 1 + 11; + if(!global.params.defaultlibnames) + global.params.defaultlibnames = new Array(); + global.params.defaultlibnames->push(p + 1 + 11); } else if (memcmp(p + 1, "debuglib=", 9) == 0) { - global.params.debuglibname = p + 1 + 9; + if(!global.params.debuglibnames) + global.params.debuglibnames = new Array(); + global.params.debuglibnames->push(p + 1 + 9); } else if (strcmp(p + 1, "run") == 0) { global.params.run = 1; @@ -696,6 +692,29 @@ return EXIT_FAILURE; } + Array* libs; + if (global.params.symdebug) + libs = global.params.debuglibnames; + else + libs = global.params.defaultlibnames; + + if (libs) + { + for (int i = 0; i < libs->dim; i++) + { + char *arg = (char *)mem.malloc(64); + strcpy(arg, "-l"); + strncat(arg, (char *)libs->data[i], 64); + global.params.linkswitches->push(arg); + } + } + else + { + char *arg = (char *)mem.malloc(64); + strcpy(arg, "-ltango-base-llvmdc-native"); + global.params.linkswitches->push(arg); + } + if (global.params.run) global.params.quiet = 1; diff -r 68d7df3f9b05 -r f75b16f1e405 dmd/mars.h --- a/dmd/mars.h Sun Aug 31 18:51:14 2008 +0200 +++ b/dmd/mars.h Tue Sep 02 19:14:37 2008 +0200 @@ -111,8 +111,8 @@ bool dump_source; - char *defaultlibname; // default library for non-debug builds - char *debuglibname; // default library for debug builds + Array *defaultlibnames; // default libraries for non-debug builds + Array *debuglibnames; // default libraries for debug builds char *xmlname; // filename for XML output @@ -147,7 +147,6 @@ char disassemble; char llvmInline; char llvmAnnotate; - char *runtimePath; char useInlineAsm; char fqnPaths; // use fully qualified object names }; diff -r 68d7df3f9b05 -r f75b16f1e405 gen/linker.cpp --- a/gen/linker.cpp Sun Aug 31 18:51:14 2008 +0200 +++ b/gen/linker.cpp Tue Sep 02 19:14:37 2008 +0200 @@ -169,22 +169,6 @@ args.push_back(p); } - // runtime library - // must be linked in last to null terminate the moduleinfo appending list - std::string runtime_path(global.params.runtimePath); - - // path seperator can be \ on windows, but we check for / -#if _WIN32 - int i=0; - while ((i = runtime_path.find("\\", i)) > 0) - runtime_path.replace(i, 1, "/"); -#endif - - if (*runtime_path.rbegin() != '/') - runtime_path.append("/"); - runtime_path.append("libtango-base-llvmdc-native.a"); - args.push_back(runtime_path.c_str()); - // print link command? if (!global.params.quiet || global.params.verbose) {