# HG changeset patch # User lindquist # Date 1214603902 -7200 # Node ID 0baca2feb5542c324efc131481c4e3a75c68db2c # Parent 2b72433d5c8ca0fdb5f8d4ead60b845ea2885497 [svn r327] Fixed some more MinGW32 issues. It's now very close to working. Fixed problems with inline asm like: mov EAX, FS:4 , which incidentally is used in the runtime to get the stack bottom, on Windows. diff -r 2b72433d5c8c -r 0baca2feb554 bin/llvmdc.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/llvmdc.ini Fri Jun 27 23:58:22 2008 +0200 @@ -0,0 +1,4 @@ + +[Environment] + +DFLAGS=-I%@P%/../tango -L-L%@P%/../lib -R%@P%/../lib diff -r 2b72433d5c8c -r 0baca2feb554 dmd/mars.c --- a/dmd/mars.c Fri Jun 27 22:04:35 2008 +0200 +++ b/dmd/mars.c Fri Jun 27 23:58:22 2008 +0200 @@ -1066,7 +1066,7 @@ { if (global.params.link) //status = runLINK(); - linkExecutable(); + linkExecutable(argv[0]); if (global.params.run) { diff -r 2b72433d5c8c -r 0baca2feb554 gen/d-asm-i386.h --- a/gen/d-asm-i386.h Fri Jun 27 22:04:35 2008 +0200 +++ b/gen/d-asm-i386.h Fri Jun 27 23:58:22 2008 +0200 @@ -1929,7 +1929,7 @@ if (operand->constDisplacement) { if (operand->symbolDisplacement.dim) insnTemplate->writebyte('+'); - addOperand2("${",":a}", Arg_Integer, newIntExp(operand->constDisplacement), asmcode); + addOperand(fmt, Arg_Integer, newIntExp(operand->constDisplacement), asmcode); if (opInfo->operands[i] & Opr_Dest) asmcode->clobbersMemory = 1; } diff -r 2b72433d5c8c -r 0baca2feb554 gen/linker.cpp --- a/gen/linker.cpp Fri Jun 27 22:04:35 2008 +0200 +++ b/gen/linker.cpp Fri Jun 27 23:58:22 2008 +0200 @@ -1,6 +1,9 @@ #include "gen/llvm.h" #include "llvm/Linker.h" #include "llvm/System/Program.h" +#if _WIN32 +#include "llvm/Support/SystemUtils.h" +#endif #include "root.h" #include "mars.h" @@ -35,7 +38,7 @@ static llvm::sys::Path gExePath; -int linkExecutable() +int linkExecutable(const char* argv0) { Logger::println("*** Linking executable ***"); @@ -43,11 +46,10 @@ std::string errstr; // find the llvm-ld program - llvm::sys::Path ldpath = llvm::sys::Program::FindProgramByName("llvm-ld"); + llvm::sys::Path ldpath = llvm::sys::Program::FindProgramByName("llvm-ld"); if (ldpath.isEmpty()) { - error("linker program not found"); - fatal(); + ldpath.set("llvm-ld"); } // build arguments @@ -83,12 +85,15 @@ // create path to exe llvm::sys::Path exedir(gExePath); exedir.set(gExePath.getDirname()); - exedir.createDirectoryOnDisk(true, &errstr); - if (!errstr.empty()) + if (!exedir.exists()) { - error("failed to create path to linking output\n%s", errstr.c_str()); - fatal(); - } + exedir.createDirectoryOnDisk(true, &errstr); + if (!errstr.empty()) + { + error("failed to create path to linking output: %s\n%s", exedir.c_str(), errstr.c_str()); + fatal(); + } + } // strip debug info if (!global.params.symdebug) diff -r 2b72433d5c8c -r 0baca2feb554 gen/linker.h --- a/gen/linker.h Fri Jun 27 22:04:35 2008 +0200 +++ b/gen/linker.h Fri Jun 27 23:58:22 2008 +0200 @@ -17,9 +17,10 @@ /** * Link an executable. + * @param argv0 the argv[0] value as passed to main * @return 0 on success. */ -int linkExecutable(); +int linkExecutable(const char* argv0); /** * Delete the executable that was previously linked with linkExecutable. diff -r 2b72433d5c8c -r 0baca2feb554 tango/lib/gc/basic/gcx.d --- a/tango/lib/gc/basic/gcx.d Fri Jun 27 22:04:35 2008 +0200 +++ b/tango/lib/gc/basic/gcx.d Fri Jun 27 23:58:22 2008 +0200 @@ -54,7 +54,10 @@ private import cstring = tango.stdc.string : memcpy, memmove, memset; private import tango.stdc.stdio; -private import tango.stdc.posix.pthread; +version(Posix) +{ + private import tango.stdc.posix.pthread; +} version (GNU) { diff -r 2b72433d5c8c -r 0baca2feb554 test/arrays15.d --- a/test/arrays15.d Fri Jun 27 22:04:35 2008 +0200 +++ b/test/arrays15.d Fri Jun 27 23:58:22 2008 +0200 @@ -1,5 +1,5 @@ -module arrays; - +module arrays15; + extern(C) int printf(char*, ...); void integer()