Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@@ -24,10 +24,11 @@ test-simple: simple.exe
mono --debug $(the_lib) --cross default simple.exe -o foo && ./foo
mono --debug $(the_lib) --sdk `dirname \`which mono\``/.. simple.exe -o foo && ./foo
-rm DEMO.zip
mono-package-runtime `dirname \`which mono\``/.. DEMO
$(topdir)/../scripts/mono-package-runtime `dirname \`which mono\``/.. DEMO
mkdir -p ~/.mono/targets/DEMO
unzip -d ~/.mono/targets/DEMO DEMO.zip
mono --debug $(the_lib) --cross DEMO simple.exe -o foo && ./foo
mono --debug $(the_lib) --cross DEMO simple.exe -o foo | grep "Assembly.*mscorlib.dll"
./foo
simple.exe: Makefile
echo 'class X { static void Main () { System.Console.WriteLine ("OK");}}' > simple.cs && mcs simple.cs

View File

@@ -49,6 +49,7 @@ class MakeBundle {
static string machine_config_file = null;
static string config_dir = null;
static string style = "linux";
static bool bundled_header = false;
static string os_message = "";
static bool compress;
static bool nomain;
@@ -347,6 +348,9 @@ class MakeBundle {
else
environment.Add (env.Substring (0, p), env.Substring (p+1));
break;
case "--bundled-header":
bundled_header = true;
break;
default:
sources.Add (args [i]);
break;
@@ -700,10 +704,10 @@ class MakeBundle {
using (StreamWriter tc = new StreamWriter (File.Create (temp_c))) {
string prog = null;
#if XAMARIN_ANDROID
tc.WriteLine ("/* This source code was produced by mkbundle, do not edit */");
tc.WriteLine ("\n#ifndef NULL\n#define NULL (void *)0\n#endif");
tc.WriteLine (@"
if (bundled_header) {
tc.WriteLine ("/* This source code was produced by mkbundle, do not edit */");
tc.WriteLine ("\n#ifndef NULL\n#define NULL (void *)0\n#endif");
tc.WriteLine (@"
typedef struct {
const char *name;
const unsigned char *data;
@@ -712,10 +716,10 @@ typedef struct {
void mono_register_bundled_assemblies (const MonoBundledAssembly **assemblies);
void mono_register_config_for_assembly (const char* assembly_name, const char* config_xml);
");
#else
tc.WriteLine ("#include <mono/metadata/mono-config.h>");
tc.WriteLine ("#include <mono/metadata/assembly.h>\n");
#endif
} else {
tc.WriteLine ("#include <mono/metadata/mono-config.h>");
tc.WriteLine ("#include <mono/metadata/assembly.h>\n");
}
if (compress) {
tc.WriteLine ("typedef struct _compressed_data {");
@@ -1082,14 +1086,14 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
static void LoadLocalizedAssemblies (List<string> assemblies)
{
var other = i18n.Select (x => "I18N." + x + (x.Length > 0 ? "." : "") + "dll");
bool error = false;
string error = null;
foreach (string name in other) {
try {
Assembly a = LoadAssembly (name);
if (a == null) {
error = true;
error = "Failed to load " + name;
continue;
}
@@ -1105,8 +1109,8 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
}
}
if (error) {
Error ("Couldn't load one or more of the i18n assemblies.");
if (error != null) {
Error ("Couldn't load one or more of the i18n assemblies: " + error);
Environment.Exit (1);
}
}
@@ -1114,10 +1118,10 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
static readonly Universe universe = new Universe ();
static readonly Dictionary<string, string> loaded_assemblies = new Dictionary<string, string> ();
static readonly string resourcePathSeparator = (Path.DirectorySeparatorChar == '\\') ? $"\\{Path.DirectorySeparatorChar}" : $"{Path.DirectorySeparatorChar}";
public static string GetAssemblyName (string path)
{
string resourcePathSeparator = style == "windows" ? "\\\\" : "/";
string name = Path.GetFileName (path);
// A bit of a hack to support satellite assemblies. They all share the same name but
@@ -1159,7 +1163,7 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
Assembly a = universe.LoadFile (path);
foreach (AssemblyName an in a.GetReferencedAssemblies ()) {
LoadAssembly (an.FullName);
a = LoadAssembly (an.Name);
if (!QueueAssembly (files, a.CodeBase))
return false;
}
@@ -1221,7 +1225,6 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
static void Error (string msg, params object [] args)
{
Console.Error.WriteLine ("ERROR: {0}", string.Format (msg, args));
throw new Exception ();
Environment.Exit (1);
}
@@ -1239,6 +1242,7 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
" --skip-scan Skip scanning assemblies that could not be loaded (but still embed them).\n" +
" --i18n ENCODING none, all or comma separated list of CJK, MidWest, Other, Rare, West.\n" +
" -v Verbose output\n" +
" --bundled-header Do not attempt to include 'mono-config.h'. Define the entry points directly in the generated code\n" +
"\n" +
"--simple Simple mode does not require a C toolchain and can cross compile\n" +
" --cross TARGET Generates a binary for the given TARGET\n"+