Skip to content

Incorrect binding code for va_list generated when targeting aarch64 #1262

Open
@pcc

Description

@pcc

Expected Behavior

Declarations using va_list are ignored when targeting aarch64, same as on x86.

Actual Behavior

Code is generated that causes a build error.

When targeting aarch64 Linux:

  cargo:warning=/home/pcc/autocxx-va-list-test/target/debug/build/autocxx-va-list-test-b0bfa856bea115b4/out/autocxx-build-dir/cxx/gen0.cxx: In function ‘void cxxbridge1$Test$foo(Test&, std::array<long unsigned int, 4>*)’:
  cargo:warning=/home/pcc/autocxx-va-list-test/target/debug/build/autocxx-va-list-test-b0bfa856bea115b4/out/autocxx-build-dir/cxx/gen0.cxx:137:60: error: cannot convert ‘void (Test::*)(va_list)’ to ‘void (Test::*)(std::array<long unsigned int, 4>)’ in initialization
  cargo:warning=  137 |   void (::Test::*foo$)(::std::array<::std::uint64_t, 4>) = &::Test::foo;
  cargo:warning=      |                                                            ^~~~~~~~~~~~

When targeting aarch64 Android:

warning: /usr/local/google/home/pcc/src/autocxx-va-list-test/target/aarch64-linux-android/debug/build/autocxx-va-list-test-6c15445a434365c7/out/autocxx-build-dir/cxx/gen0.cxx:137:18: error: cannot initialize a variable of type 'void (Test::*)(::std::array< ::std::uint64_t, 4>)' with an rvalue of type 'void (Test::*)(va_list)': type mismatch at 1st parameter ('::std::array< ::std::uint64_t, 4>' (aka 'array<unsigned long, 4>') vs 'va_list' (aka '__builtin_va_list'))
warning:   void (::Test::*foo$)(::std::array<::std::uint64_t, 4>) = &::Test::foo;
warning:                  ^                                         ~~~~~~~~~~~~
warning: 1 error generated.

Steps to Reproduce the Problem

  1. Download the attached project autocxx-va-list-test.tar.gz and extract it somewhere

Either:

  1. On a native aarch64 Linux machine, run cargo build

or:

  1. Download Android NDK r25c from https://developer.android.com/ndk/downloads and extract it somewhere
  2. Build targeting Android by passing the path to the NDK to the included script: ./cargo-build-android.sh /path/to/android-ndk-r25c

Specifications

  • Version: 0.25.0
  • Platform: x86 Linux host/aarch64 Android target, native aarch64 Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions