Skip to content

[ffi] Support 32-bit ARM. #35760

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

Closed
dcharkes opened this issue Jan 25, 2019 · 5 comments
Closed

[ffi] Support 32-bit ARM. #35760

dcharkes opened this issue Jan 25, 2019 · 5 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.

Comments

@dcharkes
Copy link
Contributor

Support dart:ffi on Arm and Android

@dcharkes dcharkes added this to the Dart VM FFI Flutter MVP milestone Jan 25, 2019
@kevmoo kevmoo added the area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. label Jan 25, 2019
@mit-mit mit-mit removed this from the Dart VM FFI Flutter MVP milestone Mar 11, 2019
@dcharkes
Copy link
Contributor Author

Landed in d14dfc5.

@sjindel-google
Copy link
Contributor

ARM32 support hasn't landed yet.

@dcharkes dcharkes changed the title dart:ffi Arm & Android dart:ffi Arm32 & Android Mar 21, 2019
@sjindel-google
Copy link
Contributor

Re-naming this issue to be more precise about the scope.
Nothing VM-specific needs to be done to accomodate Android anymore.

@sjindel-google sjindel-google changed the title dart:ffi Arm32 & Android [ffi] Support 32-bit ARM. Mar 25, 2019
@dcharkes
Copy link
Contributor Author

dcharkes commented Jun 20, 2019

This landed in https://dart-review.googlesource.com/c/sdk/+/97631 2 months ago.

@sortie and I tried to import dart:ffi in arm32 on an arm64 linux device but it refused with import of dart:ffi with --enable-ffi=false. Using arm64 on the same device worked fine. This was Dart 2.4.0-dev.0.1.

I'm not sure why it should be disabled on arm32 Linux:

  static bool IsFfiEnabled() {
    // dart:ffi is not implemented for the following configurations
#if defined(TARGET_ARCH_DBC) && !defined(ARCH_IS_64_BIT)
    // TODO(36809): Support SimDBC32.
    return false;
#elif defined(TARGET_ARCH_DBC) &&                                              \
    !(defined(HOST_ARCH_X64) || defined(HOST_ARCH_ARM64))
    // TODO(36809): Support ia32 and arm.
    return false;
#elif defined(TARGET_ARCH_DBC) && defined(HOST_ARCH_X64) &&                    \
    defined(HOST_OS_WINDOWS)
    // TODO(35773): Support x64 Windows.
    return false;
#elif defined(TARGET_ARCH_ARM) &&                                              \
    !(defined(TARGET_OS_ANDROID) || defined(TARGET_OS_MACOS_IOS))
    // TODO(36309): Support hardfp calling convention.
    return false;
#elif !defined(TARGET_OS_LINUX) && !defined(TARGET_OS_MACOS) &&                \
    !defined(TARGET_OS_ANDROID) && !defined(TARGET_OS_WINDOWS)
    return false;
#else
    // dart:ffi is also not implemented for precompiled in which case
    // FLAG_enable_ffi is set to false by --precompilation.
    // Once dart:ffi is supported on all targets, only users will set this flag
    return FLAG_enable_ffi;
#endif
  }

@sjindel-google any thoughts on this?

@sjindel-google
Copy link
Contributor

#36309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
Projects
None yet
Development

No branches or pull requests

4 participants