-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[monodroid] Add libjava-interop sources to runtime sources #1675
[monodroid] Add libjava-interop sources to runtime sources #1675
Conversation
It depends on dotnet/java-interop#319, so it will not build yet. |
src/monodroid/monodroid.props
Outdated
<_HostUnixCFlags>$(_CommonCFlags) -Wa,--noexecstack</_HostUnixCFlags> | ||
<_HostUnixLdFlags>-Wall -lstdc++ -lz -shared -fpic</_HostUnixLdFlags> | ||
<_HostCommonWinCFlags>$(_CommonCFlags) -DWINDOWS -DNTDDI_VERSION=NTDDI_VISTA -D_WIN32_WINNT=_WIN32_WINNT_VISTA -fomit-frame-pointer</_HostCommonWinCFlags> | ||
<_HostCommonWinLdFlags>-Wall -lstdc++ -lz -shared -fpic -ldl -lmman -pthread -lwsock32 -lole32 -luuid -lshlwapi -lpsapi</_HostCommonWinLdFlags> | ||
<_UnixAdditionalSourceFiles>$(MonoSourceFullPath)\support\nl.c jni\debug.c jni\monodroid-networkinfo.c jni\xamarin_getifaddrs.c</_UnixAdditionalSourceFiles> | ||
<_HostAdditionalSourceFiles>$(JavaInteropSourceDirectory)\src\java-interop\java-interop-gc-bridge-mono.c $(JavaInteropSourceDirectory)\src\java-interop\java-interop.c $(JavaInteropSourceDirectory)\src\java-interop\java-interop-mono.c</_HostAdditionalSourceFiles> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files shouldn't be limited to "the host"; they should be present in all versions, i.e. part of @(_CFile)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to increase the device runtime size yet. I have added it to all runtimes then. Let see if it works.
On desktop the jnimarshalmethod-gen.exe
crashes now, hopefully I can fix it today.
2eabca6
to
53b4bd3
Compare
53b4bd3
to
38285a3
Compare
src/monodroid/jni/dylib-mono.h
Outdated
@@ -249,6 +250,7 @@ typedef void (*monodroid_mono_set_signal_chaining_fptr)(mono_bool cha | |||
typedef MonoString* (*monodroid_mono_string_new_fptr)(MonoDomain *domain, const char *text); | |||
typedef void* (*monodroid_mono_thread_attach_fptr) (MonoDomain *domain); | |||
typedef void (*monodroid_mono_thread_create_fptr) (MonoDomain *domain, void* func, void* arg); | |||
typedef MonoThread* (*monodroid_mono_thread_current) (void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This typedef should have an _fptr
suffix.
src/monodroid/jni/dylib-mono.h
Outdated
@@ -312,6 +314,7 @@ struct DylibMono { | |||
|
|||
monodroid_mono_domain_foreach_fptr mono_domain_foreach; | |||
monodroid_mono_thread_create_fptr mono_thread_create; | |||
monodroid_mono_thread_current mono_thread_current; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be last in the struct, as per the comment at the beginning of the struct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh, I missed that comment. It is needed for ABI compatibility I guess. Fixed.
Also add `MonoThread` and `mono_thread_current` to *dylib*. Fixed `monodroid_mono_class_get_field_from_name_fptr` signature, where we were missing *const* for 2nd argument. Used relevant types in the `monodroid_mono_class_from_mono_type_fptr` signature.
38285a3
to
2da3bcd
Compare
This reverts commit 88ef36b. Commit 88ef36b broke the [full master build][0] because the `java-interop` sources don't build under Windows: [0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/1010/ "/Users/builder/android-toolchain/mxe-b9cbb53/bin/x86_64-w64-mingw32.static-gcc" -o "…/xamarin-android/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/lib/host-mxe-Win64/libmono-android.debug.dll" ... /var/folders/x8/jnqh86dn7t90f9wccp0g0hqh0000gn/T//ccpnkdsJ.o: In function `ji_realpath': (TaskId:1201) …/xamarin-android/external/Java.Interop/src/java-interop/java-interop-gc-bridge-mono.c:158: undefined reference to `realpath' collect2 : error : ld returned 1 exit status […/xamarin-android/src/monodroid/monodroid.csproj] Revert the inclusion of `java-interop` sources until they're buildable under MXE/Windows.
Context: https://github.com/xamarin/xamarin-android/projects/1 Bumps to Java.Interop/master/5c35bcb0 Begin merging the `Java.Interop/src/java-interop` library code into `src/monodroid` so that we can eventually unify the GC Bridge logic between the two repos. Add `MonoThread` and `mono_thread_current()` to `dylib-mono.h`. Fixed `monodroid_mono_class_get_field_from_name_fptr()` signature, where we were missing `const` for 2nd argument. Used relevant types in the `monodroid_mono_class_from_mono_type_fptr()` signature.
Context: https://github.com/xamarin/xamarin-android/projects/1 Bumps to Java.Interop/master/5c35bcb0 Begin merging the `Java.Interop/src/java-interop` library code into `src/monodroid` so that we can eventually unify the GC Bridge logic between the two repos. Add `MonoThread` and `mono_thread_current()` to `dylib-mono.h`. Fixed `monodroid_mono_class_get_field_from_name_fptr()` signature, where we were missing `const` for 2nd argument. Used relevant types in the `monodroid_mono_class_from_mono_type_fptr()` signature.
Also add
MonoThread
andmono_thread_current
to dylib.Fixed
monodroid_mono_class_get_field_from_name_fptr
signature, wherewe were missing const for 2nd argument.
Used relevant types in the
monodroid_mono_class_from_mono_type_fptr
signature.