Discussion:
C calling convention
John Dallman
2018-07-13 15:55:19 UTC
Permalink
The source I'm porting to NDK has a fairly sophisticated text formatter,
which is basically a printf that can be extended with custom functions at
run-time. It needs to understand the C calling convention for the platform.

Does Android on ARM use the standard ARM Ltd calling conventions for 32-bit
and 64-bit?

Our only existing ARM platform is iOS, which uses standard the ARM
convention for 32-bit. 64-bit iOS uses a simplified version of the ARM
convention, which is quite different for variadic functions. If Android is
to ARM standards, I'll have to implement that.

Thanks,

John
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgkjYhz_ada0pD-SXLRGzWvVjgZjeJgygs8VyQ92vBXQEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
J Decker
2018-07-13 23:13:43 UTC
Permalink
varadic arguments should always be used through va_arg in stdarg.h
Post by John Dallman
The source I'm porting to NDK has a fairly sophisticated text formatter,
which is basically a printf that can be extended with custom functions at
run-time. It needs to understand the C calling convention for the platform.
Does Android on ARM use the standard ARM Ltd calling conventions for
32-bit and 64-bit?
Our only existing ARM platform is iOS, which uses standard the ARM
convention for 32-bit. 64-bit iOS uses a simplified version of the ARM
convention, which is quite different for variadic functions. If Android is
to ARM standards, I'll have to implement that.
Thanks,
John
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/CAH1xqgkjYhz_ada0pD-SXLRGzWvVjgZjeJgygs8VyQ92vBXQEA%40mail.gmail.com
<https://groups.google.com/d/msgid/android-ndk/CAH1xqgkjYhz_ada0pD-SXLRGzWvVjgZjeJgygs8VyQ92vBXQEA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAA2GJqWBLR09SbCb4fMeeZAvQ2CaNBZ7mXgnbEH1pVqi48qLRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
John Dallman
2018-07-16 09:21:54 UTC
Permalink
va_arg, sadly, is not enough to cope with our needs. We use it, but we
normally have to read the calling convention documentation, and implement
parts of it.

I'm just looking for confirmation that Android uses the ARM standard
calling convention. This is for C-to-C calls, not JNI.

Thanks,

John
Post by J Decker
varadic arguments should always be used through va_arg in stdarg.h
Post by John Dallman
The source I'm porting to NDK has a fairly sophisticated text formatter,
which is basically a printf that can be extended with custom functions at
run-time. It needs to understand the C calling convention for the platform.
Does Android on ARM use the standard ARM Ltd calling conventions for
32-bit and 64-bit?
Our only existing ARM platform is iOS, which uses standard the ARM
convention for 32-bit. 64-bit iOS uses a simplified version of the ARM
convention, which is quite different for variadic functions. If Android is
to ARM standards, I'll have to implement that.
Thanks,
John
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/CAH1xqgkjYhz_ada0pD-SXLRGzWvVjgZjeJgygs8VyQ92vBXQEA%40mail.gmail.com
<https://groups.google.com/d/msgid/android-ndk/CAH1xqgkjYhz_ada0pD-SXLRGzWvVjgZjeJgygs8VyQ92vBXQEA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/CAA2GJqWBLR09SbCb4fMeeZAvQ2CaNBZ7mXgnbEH1pVqi48qLRA%40mail.gmail.com
<https://groups.google.com/d/msgid/android-ndk/CAA2GJqWBLR09SbCb4fMeeZAvQ2CaNBZ7mXgnbEH1pVqi48qLRA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgmKoeuWA_RTs8fxWLH5EuAqM4Sz7UBFeOZfHcNbyua2ag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Glenn Kasten
2018-07-17 16:16:43 UTC
Permalink
I think it uses the default relevant ABI of gcc and clang. But this is not
a "confirmation", just an assumption.
Post by John Dallman
va_arg, sadly, is not enough to cope with our needs. We use it, but we
normally have to read the calling convention documentation, and implement
parts of it.
I'm just looking for confirmation that Android uses the ARM standard
calling convention. This is for C-to-C calls, not JNI.
Thanks,
John
Post by J Decker
varadic arguments should always be used through va_arg in stdarg.h
Post by John Dallman
The source I'm porting to NDK has a fairly sophisticated text formatter,
which is basically a printf that can be extended with custom functions at
run-time. It needs to understand the C calling convention for the platform.
Does Android on ARM use the standard ARM Ltd calling conventions for
32-bit and 64-bit?
Our only existing ARM platform is iOS, which uses standard the ARM
convention for 32-bit. 64-bit iOS uses a simplified version of the ARM
convention, which is quite different for variadic functions. If Android is
to ARM standards, I'll have to implement that.
Thanks,
John
--
You received this message because you are subscribed to the Google
Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/CAH1xqgkjYhz_ada0pD-SXLRGzWvVjgZjeJgygs8VyQ92vBXQEA%40mail.gmail.com
<https://groups.google.com/d/msgid/android-ndk/CAH1xqgkjYhz_ada0pD-SXLRGzWvVjgZjeJgygs8VyQ92vBXQEA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/CAA2GJqWBLR09SbCb4fMeeZAvQ2CaNBZ7mXgnbEH1pVqi48qLRA%40mail.gmail.com
<https://groups.google.com/d/msgid/android-ndk/CAA2GJqWBLR09SbCb4fMeeZAvQ2CaNBZ7mXgnbEH1pVqi48qLRA%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/5a5d07a4-abfc-43ed-905a-c7d1b0d18897%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...