Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

'TranslationUnit::parse failed' on aarch64-apple-ios since Bindgen 0.31 #1211

Copy link
Copy link
Closed
@appaquet

Description

@appaquet
Issue body actions

On my way trying to bump bindgen in my project from 0.26.3 to 0.32.1, found out that bindgen isn't working anymore from version 0.31 on the aarch64-apple-ios target, but is still working on other iOS and MacOS targets. I use Bindgen from a build.rs, which gets compiled for each target my project supports and fails on aarch64-apple-ios. Using the command line bindgen gives me the same result.

My setup:

  • MacOS 10.13.2 with Apple LLVM 9.0.0
  • Rust 1.23.0

My header:

typedef struct _foo_context foo_context;
foo_context* foo_new(char* bar);

Bindgen Invocation:

$  RUST_BACKTRACE=1 bindgen --no-layout-tests --dump-preprocessed-input test.h -- --target=aarch64-apple-ios

Actual Results:

error: unknown target triple 'unknown-apple-macosx10.4.0', please use -triple or -arch

Found out a mention that "arm64" instead of "aarch64" could be passed to clang, which apparently works:

$ RUST_BACKTRACE=1 bindgen --no-layout-tests --dump-preprocessed-input test.h -- --target=arm64-apple-ios

Gives me

/* automatically generated by rust-bindgen */

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _foo_context {
    _unused: [u8; 0],
}
pub type foo_context = _foo_context;
extern "C" {
 # [ link_name = "\u{1}_foo_new" ]
    pub fn foo_new(bar: *mut ::std::os::raw::c_char) -> *mut foo_context;
}

And it also works like before on all the other architectures I use:

aarch64-linux-android
armv7-apple-ios
armv7-linux-androideabi
armv7s-apple-ios
i386-apple-ios
i686-linux-android
x86_64-apple-darwin
x86_64-apple-ios
x86_64-linux-android

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.