Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ void Run (DirectoryAssemblyResolver res)
string managedKey = type.FullName.Replace ('/', '.');
string javaKey = JavaNativeTypeManager.ToJniName (type, cache).Replace ('/', '.');

#if ENABLE_MARSHAL_METHODS
Console.WriteLine ($"##G2: {type.FullName} -> {javaKey}");
#endif
acw_map.Write (type.GetPartialAssemblyQualifiedName (cache));
acw_map.Write (';');
acw_map.Write (javaKey);
Expand Down Expand Up @@ -384,6 +387,9 @@ bool CreateJavaSources (IEnumerable<TypeDefinition> javaTypes, TypeDefinitionCac

bool ok = true;
foreach (var t in javaTypes) {
#if ENABLE_MARSHAL_METHODS
Console.WriteLine ($"##G0: JCW for {t.FullName}");
#endif
if (t.IsInterface) {
// Interfaces are in typemap but they shouldn't have JCW generated for them
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class Arm32LlvmIrGenerator : LlvmIrGenerator
public override int PointerSize => 4;
protected override string Triple => "armv7-unknown-linux-android"; // NDK appends API level, we don't need that

static readonly LlvmFunctionAttributeSet commonAttributes = new LlvmFunctionAttributeSet {
new FramePointerFunctionAttribute ("all"),
new TargetCpuFunctionAttribute ("generic"),
new TargetFeaturesFunctionAttribute ("+armv7-a,+d32,+dsp,+fp64,+neon,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,-aes,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fullfp16,-sha2,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"),
};

public Arm32LlvmIrGenerator (AndroidTargetArch arch, StreamWriter output, string fileName)
: base (arch, output, fileName)
{}
Expand All @@ -25,5 +31,13 @@ protected override void AddModuleFlagsMetadata (List<LlvmIrMetadataItem> flagsFi
base.AddModuleFlagsMetadata (flagsFields);
flagsFields.Add (MetadataManager.AddNumbered (LlvmIrModuleMergeBehavior.Error, "min_enum_size", 4));
}

protected override void InitFunctionAttributes ()
{
base.InitFunctionAttributes ();

FunctionAttributes[FunctionAttributesXamarinAppInit].Add (commonAttributes);
FunctionAttributes[FunctionAttributesJniMethods].Add (commonAttributes);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class Arm64LlvmIrGenerator : LlvmIrGenerator
public override int PointerSize => 8;
protected override string Triple => "aarch64-unknown-linux-android"; // NDK appends API level, we don't need that

static readonly LlvmFunctionAttributeSet commonAttributes = new LlvmFunctionAttributeSet {
new FramePointerFunctionAttribute ("non-leaf"),
new TargetCpuFunctionAttribute ("generic"),
new TargetFeaturesFunctionAttribute ("+neon,+outline-atomics"),
};

public Arm64LlvmIrGenerator (AndroidTargetArch arch, StreamWriter output, string fileName)
: base (arch, output, fileName)
{}
Expand All @@ -29,5 +35,13 @@ protected override void AddModuleFlagsMetadata (List<LlvmIrMetadataItem> flagsFi
flagsFields.Add (MetadataManager.AddNumbered (LlvmIrModuleMergeBehavior.Error, "sign-return-address-all", 0));
flagsFields.Add (MetadataManager.AddNumbered (LlvmIrModuleMergeBehavior.Error, "sign-return-address-with-bkey", 0));
}

protected override void InitFunctionAttributes ()
{
base.InitFunctionAttributes ();

FunctionAttributes[FunctionAttributesXamarinAppInit].Add (commonAttributes);
FunctionAttributes[FunctionAttributesJniMethods].Add (commonAttributes);
}
}
}
Loading