Skip to content

Commit

Permalink
[ios] pass --enable-monotouch to cross compilers so icall defintions …
Browse files Browse the repository at this point in the history
…are visible to it (mono#12834)

This fixes a regression introduced by mono@5187b0b

The AOT compiler wasn't aware of the icalls since they are guarded by `ENABLE_MONOTOUCH`. Passing `--enable-monotouch` to configure of the AOT compiler enables that define, so it can properly resolve those icalls. However, to avoid `zlib` dependency for the cross compilers, we stub
them out.
  • Loading branch information
lewurm authored and akoeplinger committed Feb 7, 2019
1 parent 0e65799 commit 21c65aa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions mono/metadata/icall.c
Original file line number Diff line number Diff line change
Expand Up @@ -7362,31 +7362,51 @@ G_EXTERN_C gint32 WriteZStream (gpointer stream, gpointer buffer, gint32 lengt
gpointer
ves_icall_System_IO_Compression_DeflateStreamNative_CreateZStream (gint32 compress, MonoBoolean gzip, gpointer feeder, gpointer data)
{
#ifdef MONO_CROSS_COMPILE
return NULL;
#else
return CreateZStream (compress, gzip, feeder, data);
#endif
}

gint32
ves_icall_System_IO_Compression_DeflateStreamNative_CloseZStream (gpointer stream)
{
#ifdef MONO_CROSS_COMPILE
return 0;
#else
return CloseZStream (stream);
#endif
}

gint32
ves_icall_System_IO_Compression_DeflateStreamNative_Flush (gpointer stream)
{
#ifdef MONO_CROSS_COMPILE
return 0;
#else
return Flush (stream);
#endif
}

gint32
ves_icall_System_IO_Compression_DeflateStreamNative_ReadZStream (gpointer stream, gpointer buffer, gint32 length)
{
#ifdef MONO_CROSS_COMPILE
return 0;
#else
return ReadZStream (stream, buffer, length);
#endif
}

gint32
ves_icall_System_IO_Compression_DeflateStreamNative_WriteZStream (gpointer stream, gpointer buffer, gint32 length)
{
#ifdef MONO_CROSS_COMPILE
return 0;
#else
return WriteZStream (stream, buffer, length);
#endif
}

#endif
Expand Down
1 change: 1 addition & 0 deletions sdks/builds/ios.mk
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ _ios-$(1)_CONFIGURE_FLAGS= \
--enable-dtrace=no \
--enable-icall-symbol-map \
--enable-minimal=com,remoting \
--enable-monotouch \
--disable-crash-reporting

$$(eval $$(call CrossRuntimeTemplate,ios,$(1),$(2)-apple-darwin10,$(3)-darwin,$(4),$(5),$(6)))
Expand Down

0 comments on commit 21c65aa

Please sign in to comment.