[ffigen] Only use `objc_msgSend` variants on x64 (#836)

`objc_msgSend_stret` and `objc_msgSend_fpret` are only available on x64, so just use the normal `objc_msgSend` on arm64.

We can only check the ABI at runtime, so for the stret and fpret variants we need to emit both the variant and the normal `objc_msgSend` function. Then we can decide which to use when the method is invoked at runtime.

This runtime check is complicated by the fact that `objc_msgSend_stret` has a different signature than `objc_msgSend` has for the same method. This is because `objc_msgSend_stret` takes a pointer to the return type as its first arg. If it wasn't for this signature difference we could just change the function name string we pass to `DynamicLibrary.lookup`.

Fixes #829
5 files changed
tree: f4ecb7149d577ea6bed927e9931a43af2e266dd3
  1. .github/
  2. pkgs/
  3. tools/
  4. AUTHORS
  5. CONTRIBUTING.md
  6. LICENSE
  7. README.md
README.md

Coverage Status

Overview

This repository is home to Dart packages related to FFI and native assets building and bundling.

Packages

PackageDescriptionVersion
ffigenGenerator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files.pub package
jniA library to access JNI from Dart and Flutter that acts as a support library for package:jnigen.pub package
jnigenA Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine.pub package
native_assets_builderThis package is the backend that invokes top-level build.dart scripts.pub package
native_assets_cliA library that contains the argument and file formats for implementing a native assets CLI.pub package
native_toolchain_cA library to invoke the native C compiler installed on the host machine.pub package

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

For additional information about contributing, see our contributing page.