Merge branch 'master' of ssh://github.com/mono/mono
authorNeale Ferguson <neale@sinenomine.net>
Thu, 5 Jan 2012 17:50:18 +0000 (12:50 -0500)
committerNeale Ferguson <neale@sinenomine.net>
Thu, 5 Jan 2012 17:50:18 +0000 (12:50 -0500)
20 files changed:
mcs/build/executable.make
mcs/class/RabbitMQ.Client/src/apigen/Makefile
mcs/ilasm/Makefile
mcs/mcs/Makefile
mcs/nunit24/ConsoleRunner/nunit-console-exe/Makefile
mcs/tools/al/Makefile
mcs/tools/compiler-tester/Makefile
mcs/tools/csharp/Makefile
mcs/tools/culevel/Makefile
mcs/tools/gacutil/Makefile
mcs/tools/genxs/Makefile
mcs/tools/linker/Makefile
mcs/tools/mkbundle/Makefile
mcs/tools/mono-service/Makefile
mcs/tools/mono-xsd/Makefile
mcs/tools/monop/Makefile
mcs/tools/resgen/Makefile
mcs/tools/wsdl/Makefile
mcs/tools/xbuild/Makefile
mono/mini/mini-gc.c

index a99832211755949c8269ed802dace92291f1992c..8ca07d83d52428f96bf43cd4433df43908895521 100644 (file)
@@ -3,7 +3,6 @@
 # The rules for building a program.
 
 base_prog = $(notdir $(PROGRAM))
-prog_dir := $(filter-out . ./, $(dir $(PROGRAM)))
 ifndef sourcefile
 sourcefile := $(base_prog).sources
 endif
@@ -11,31 +10,36 @@ base_prog_config := $(wildcard $(base_prog).config.$(PROFILE))
 ifndef base_prog_config
 base_prog_config := $(wildcard $(base_prog).config)
 endif
-ifdef base_prog_config
-PROGRAM_config := $(PROGRAM).config
-endif
 
 executable_CLEAN_FILES = *.exe $(PROGRAM) $(PROGRAM).mdb $(BUILT_SOURCES)
 
 ifeq (cat,$(PLATFORM_CHANGE_SEPARATOR_CMD))
 response = $(sourcefile)
 else
-response = $(depsdir)/$(base_prog).response
+response = $(depsdir)/$(sourcefile).response
 executable_CLEAN_FILES += $(response)
 endif
 
-ifdef KEEP_OUTPUT_FILE_COPY
-       COPY_CMD = cp
+the_libdir = $(topdir)/class/lib/$(PROFILE)/
+ifdef PROGRAM_USE_INTERMEDIATE_FILE
+build_libdir = $(the_libdir)tmp/
 else
-       COPY_CMD = mv
+build_libdir = $(the_libdir)
+endif
+
+ifdef base_prog_config
+PROGRAM_config := $(build_libdir)$(PROGRAM).config
 endif
 
+the_lib = $(the_libdir)$(base_prog)
+build_lib = $(build_libdir)$(base_prog)
+
 makefrag = $(depsdir)/$(PROFILE)_$(base_prog).makefrag
 pdb = $(patsubst %.exe,%.pdb,$(PROGRAM))
 mdb = $(patsubst %.exe,%.mdb,$(PROGRAM))
 executable_CLEAN_FILES += $(makefrag) $(pdb) $(mdb)
 
-all-local: $(PROGRAM) $(PROGRAM_config)
+all-local: $(the_lib) $(PROGRAM_config)
 
 install-local: all-local
 test-local: all-local
@@ -50,10 +54,10 @@ ifndef PROGRAM_INSTALL_DIR
 PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
 endif
 
-install-local: $(PROGRAM) $(PROGRAM_config)
+install-local:
        $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
-       $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
-       test ! -f $(PROGRAM).mdb || $(INSTALL_BIN) $(PROGRAM).mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR)
+       $(INSTALL_BIN) $(the_lib) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
+       test ! -f $(the_lib).mdb || $(INSTALL_BIN) $(the_lib).mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR)
 ifdef PROGRAM_config
        $(INSTALL_DATA) $(PROGRAM_config) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
 endif
@@ -103,11 +107,16 @@ ifndef PROGRAM_COMPILE
 PROGRAM_COMPILE = $(CSCOMPILE)
 endif
 
-$(PROGRAM): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response) $(prog_dir:=/.stamp)
-       $(PROGRAM_COMPILE) -target:exe -out:$(base_prog) $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
-ifneq ($(base_prog),$(PROGRAM))
-       $(COPY_CMD) $(base_prog) $(PROGRAM)
-       test ! -f $(base_prog).mdb || $(COPY_CMD) $(base_prog).mdb $(PROGRAM).mdb
+$(the_lib): $(the_libdir)/.stamp
+
+$(build_lib): $(BUILT_SOURCES) $(EXTRA_SOURCES) $(response) $(build_libdir:=/.stamp)
+       $(PROGRAM_COMPILE) -target:exe -out:$@ $(BUILT_SOURCES) $(EXTRA_SOURCES) @$(response)
+
+ifdef PROGRAM_USE_INTERMEDIATE_FILE
+$(the_lib): $(build_lib)
+       $(Q) cp $(build_lib) $@
+       $(Q) test ! -f $(build_lib).mdb || mv $(build_lib).mdb $@.mdb
+       $(Q) test ! -f $(build_lib:.exe=.pdb) || mv $(build_lib:.exe=.pdb) $(the_lib:.exe=.pdb)
 endif
 
 ifdef PROGRAM_config
@@ -119,13 +128,17 @@ endif
 endif
 
 $(makefrag): $(sourcefile)
-       @echo Creating $@ ...
-       @sed 's,^,$(PROGRAM): ,' $< > $@
+#      @echo Creating $@ ...
+       @sed 's,^,$(build_lib): ,' $< >$@
+       @if test ! -f $(sourcefile).makefrag; then :; else \
+          cat $(sourcefile).makefrag >> $@ ; \
+          echo '$@: $(sourcefile).makefrag' >> $@; \
+          echo '$(sourcefile).makefrag:' >> $@; fi
 
 ifneq ($(response),$(sourcefile))
 $(response): $(sourcefile)
-       @echo Creating $@ ...
-       @( $(PLATFORM_CHANGE_SEPARATOR_CMD) ) <$< >$@
+       @echo Converting $(sourcefile) to $@ ...
+       @cat $(sourcefile) | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
 endif
 
 -include $(makefrag)
index 8cf0671024b5f82f91949268a90bdbf7dcf2a83a..9d5e49a318156426af592e19ce0c9142f98f731c 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS =
 
 include ../../../../build/rules.make
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/RabbitMQ.Client.Apigen.exe
+PROGRAM = RabbitMQ.Client.Apigen.exe
 
 LOCAL_MCS_FLAGS = /r:System.dll     \
                   /r:System.Xml.dll \
index ed1506c9a6f4acd02458367b32e12244a06abedb..43cee29c15b0e231810fcba9648787a453bb251e 100644 (file)
@@ -2,7 +2,7 @@ thisdir = ilasm
 SUBDIRS =
 include ../build/rules.make
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/ilasm.exe
+PROGRAM = ilasm.exe
 BUILT_SOURCES = ILParser.cs
 LOCAL_MCS_FLAGS = /lib:../class/lib/$(PROFILE) /r:../class/lib/$(PROFILE)/PEAPI.dll /r:Mono.CompilerServices.SymbolWriter.dll /r:Mono.Security.dll
 
index b2d428bb02a1bd697dd03314118c10f5fcb63760..9d7484e02af0c648393ad5c6caad686c1179fecd 100644 (file)
@@ -13,10 +13,11 @@ EXTRA_DISTFILES = \
        ikvm.cs
 
 ifeq (basic, $(PROFILE))
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/basic.exe
+PROGRAM = basic.exe
 sourcefile = mcs.exe.sources
 else
-PROGRAM = $(topdir)/class/lib/build/mcs.exe
+PROGRAM_USE_INTERMEDIATE_FILE = true
+PROGRAM = mcs.exe
 LOCAL_MCS_FLAGS += -lib:$(topdir)/class/lib/build
 endif
 
index af78ea50da138f3d2e171a3536cd9c11fc19c6ee..b09931ffef6cec8e1811c8954abed8a4f3817796 100644 (file)
@@ -2,7 +2,7 @@ thisdir = nunit24/ConsoleRunner/nunit-console-exe
 SUBDIRS = 
 include ../../../build/rules.make
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/nunit-console.exe
+PROGRAM = nunit-console.exe
 LOCAL_MCS_FLAGS = \
        /r:nunit.framework.dll /r:nunit.util.dll /r:nunit.core.dll \
        /r:nunit-console-runner.dll
index bbe782e8bc6be87f4173d3d04688778881040fd6..a4505c123f5ab7a5fbfc8cbafa8b04c0ada6ca66 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LOCAL_MCS_FLAGS = -r:Mono.Security.dll
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/al.exe
+PROGRAM = al.exe
 
 CLEAN_FILES = al.exe al.exe.mdb
 
index 062bc5acaa6bd6e2badb291eff5d483546c392fa..108940c0b1ebf61b325c71d2bbf9f23dad54dcd2 100644 (file)
@@ -2,7 +2,7 @@ thisdir = tools/compiler-tester
 SUBDIRS = 
 include ../../build/rules.make
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
+PROGRAM = compiler-tester.exe
 NO_INSTALL = yes
 
 ifeq (moonlight, $(PROFILE))
index 5948d1280b1449da362ffc670d54878b1b4a01d7..1d74ed5d9ab7c8aca9664e36895a05f771827fa1 100644 (file)
@@ -8,7 +8,7 @@ include ../../build/rules.make
 NOWARNS = -nowarn:3021
 LOCAL_MCS_FLAGS = -r:$(topdir)/class/lib/$(PROFILE)/Mono.CSharp.dll -r:$(topdir)/class/lib/$(PROFILE)/Mono.Posix.dll -r:Mono.Management.dll -unsafe $(NOWARNS)
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/csharp.exe
+PROGRAM = csharp.exe
 
 DISTFILES = repl.txt
 
index a3cd396206188ceb803b6bf2db96e83e489158e5..9e7112db79366eb512ac83f75b0544d54a6f734e 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LOCAL_MCS_FLAGS = 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/culevel.exe
+PROGRAM = culevel.exe
 
 CLEAN_FILES = culevel.exe culevel.exe.mdb
 
index aeacbd56e2efb6373342695abb4e90fa171dec0e..5fdea99a02f7b6c3a538b2bca1d5dbebb3c29d56 100644 (file)
@@ -4,6 +4,6 @@ include ../../build/rules.make
 
 LOCAL_MCS_FLAGS = -r:Mono.Security.dll 
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/gacutil.exe
+PROGRAM = gacutil.exe
 
 include ../../build/executable.make
index b9a4cdee9dfb493e7884c78d2e641b872a03fe68..21b38e8fd3c77839f1e7c09c22d5c1d03757b527 100644 (file)
@@ -3,6 +3,6 @@ SUBDIRS =
 include ../../build/rules.make
 
 LOCAL_MCS_FLAGS = -r:System.Xml.dll
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/genxs.exe
+PROGRAM = genxs.exe
 
 include ../../build/executable.make
index 7eb5d5af4f04d80209ebb242d623da6d830cc723..692976b709ff83edc5561f29088db6f03a15dbae 100644 (file)
@@ -13,7 +13,7 @@ RESOURCES = \
        Descriptors/System.Web.xml              \
        Descriptors/Mono.Posix.xml              \
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/monolinker.exe
+PROGRAM = monolinker.exe
 
 $(PROGRAM): $(RESOURCES)
 
index 7a0709c685da00c673c5fd386cd462448faf87a9..ac97a4ac9facb92580124e74d0a9eef8d05a3fd1 100644 (file)
@@ -2,7 +2,7 @@ thisdir = tools/mkbundle
 SUBDIRS = 
 include ../../build/rules.make
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/mkbundle.exe
+PROGRAM = mkbundle.exe
 
 OTHER_RES = template.c template_z.c template_main.c
 
index 0115d2718b6d5a21695b1b718fb62489667eb135..4029c28a44bf54b405f99abaa588c8db72cfc5e3 100644 (file)
@@ -2,7 +2,7 @@ thisdir = tools/mono-service
 SUBDIRS = 
 include ../../build/rules.make
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/mono-service.exe
+PROGRAM = mono-service.exe
 
 include ../../build/executable.make
 
@@ -30,7 +30,7 @@ install-local: install-extras
 uninstall-local: uninstall-extras
 
 install-extras: $(gacutil)
-       $(GACUTIL) /i $(PROGRAM) /f $(gacdir_flag) /root $(GACROOT)
+       $(GACUTIL) /i $(the_lib) /f $(gacdir_flag) /root $(GACROOT)
 
 uninstall-extras: $(gacutil)
-       -$(GACUTIL) /u $(PROGRAM:.exe=) $(gacdir_flag) /root $(GACROOT)
+       -$(GACUTIL) /u $(the_lib:.exe=) $(gacdir_flag) /root $(GACROOT)
index 22bac8b6641a614895cd92846dde350e3634209a..36bee61e1c3b3fc70b38e8ec44c07ca5e8dea0b7 100644 (file)
@@ -3,6 +3,6 @@ SUBDIRS =
 include ../../build/rules.make
 
 LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Data.dll
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/xsd.exe
+PROGRAM = xsd.exe
 
 include ../../build/executable.make
index 5ab160617db4a09651f98d5b6472b6859978d6db..a9e79a8e9fa0aad2e0e72aa162deeb42fcc2102d 100644 (file)
@@ -2,7 +2,7 @@ thisdir = tools/monop
 SUBDIRS = 
 include ../../build/rules.make
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/monop.exe
+PROGRAM = monop.exe
 
 CLEAN_FILES = monop.exe monop2.exe *.mdb
 
index 5ff56c38c7300bcbfb5a07d641cd41bc4acb161a..9e047cd103192e5d458ed88ddd65f6248dc1e57e 100644 (file)
@@ -2,7 +2,7 @@ thisdir = tools/resgen
 SUBDIRS =
 include ../../build/rules.make
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/resgen.exe
+PROGRAM = resgen.exe
 
 CLEAN_FILES = resgen.exe
 
index 4e3b9f8be79ea9a2446c0de4825d5fe0b6e8ed4a..38f789e4093ca73c95eb603b9b6d7b9c5d19a277 100644 (file)
@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LOCAL_MCS_FLAGS = -r:System.Xml.dll -r:System.Web.Services.dll
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/wsdl.exe
+PROGRAM = wsdl.exe
 
 CLEAN_FILES = wsdl.exe wsdl2.exe *.mdb
 
index eaa4d25b4a426cd9a93a9e0cbc195a219eb77196..312e41555a53f299942ae47029eb8f9815d4a2f7 100644 (file)
@@ -21,7 +21,7 @@ endif
 endif
 
 LOCAL_MCS_FLAGS = -r:$(BUILD_FRAMEWORK) -r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll -r:$(BUILD_ENGINE)
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/xbuild.exe
+PROGRAM = xbuild.exe
 
 include ../../build/executable.make
 
index fd2a8536b9330d9daa28a1c7a83cba1ccb0a4c2a..16ca226843e0dd61c3912dfad98c417b82bbb4a6 100644 (file)
@@ -568,9 +568,11 @@ thread_suspend_func (gpointer user_data, void *sigctx)
 {
        TlsData *tls = user_data;
 
-       if (!tls)
+       if (!tls) {
                /* Happens during startup */
+               tls->unwind_state.valid = FALSE;
                return;
+       }
 
        if (tls->tid != GetCurrentThreadId ()) {
                /* Happens on osx because threads are not suspended using signals */
@@ -590,6 +592,12 @@ thread_suspend_func (gpointer user_data, void *sigctx)
                tls->unwind_state.unwind_data [MONO_UNWIND_DATA_JIT_TLS] = mono_native_tls_get_value (mono_jit_tls_id);
                tls->unwind_state.unwind_data [MONO_UNWIND_DATA_DOMAIN] = mono_domain_get ();
        }
+
+       if (!tls->unwind_state.unwind_data [MONO_UNWIND_DATA_DOMAIN]) {
+               /* Happens during startup */
+               tls->unwind_state.valid = FALSE;
+               return;
+       }
 }
 
 #define DEAD_REF ((gpointer)(gssize)0x2a2a2a2a2a2a2a2aULL)
@@ -714,6 +722,9 @@ conservative_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end)
        memset (new_reg_locations, 0, sizeof (new_reg_locations));
 
        while (TRUE) {
+               if (!tls->unwind_state.valid)
+                       break;
+
                memcpy (&ctx, &new_ctx, sizeof (ctx));
 
                for (i = 0; i < MONO_MAX_IREGS; ++i) {
@@ -1042,6 +1053,9 @@ precise_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end)
        if (!tls)
                return;
 
+       if (!tls->unwind_state.valid)
+               return;
+
        for (findex = 0; findex < tls->nframes; findex ++) {
                /* Load information saved by the !precise pass */
                fi = &tls->frames [findex];