Skip to content
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

Update to the latest bindgen #3

Merged
merged 1 commit into from
Mar 1, 2017
Merged

Update to the latest bindgen #3

merged 1 commit into from
Mar 1, 2017

Conversation

cholcombe973
Copy link
Contributor

This updates libffi to the latest bindgen release. This fixed my build problem with size_t not found. 👍 I have rustfmt automatically run when I save a file which changed a few things in build.rs. If you don't like that I can revert those.

@tov
Copy link
Owner

tov commented Feb 28, 2017

It looks like it's failing on Travis CI, but I can't get the log to load to see why…

@tov
Copy link
Owner

tov commented Feb 28, 2017

(Oh, and thanks!)

@cholcombe973
Copy link
Contributor Author

I wonder if it has anything to do with the S3 outage today?

@tov
Copy link
Owner

tov commented Feb 28, 2017

Oh, I dunno. I'll try again later I guess.

@cholcombe973
Copy link
Contributor Author

I think the outage is resolved at this point. Maybe just kick it off again?

@cholcombe973
Copy link
Contributor Author

cholcombe973 commented Mar 1, 2017 via email

@tov
Copy link
Owner

tov commented Mar 1, 2017

I still can’t see it on Travis, but it works for me on two different machines. I'll take it. Thanks!

@tov tov merged commit bafb8a4 into tov:master Mar 1, 2017
@cholcombe973
Copy link
Contributor Author

Sweet!

@cholcombe973
Copy link
Contributor Author

cholcombe973 commented Mar 1, 2017

So looks like on my localhost the only thing failing is max_align_t:
running 7 tests
test generated::bindgen_test_layout_ffi_cif ... ok
test generated::bindgen_test_layout__ffi_type ... ok
test generated::bindgen_test_layout_ffi_closure ... ok
test generated::bindgen_test_layout_ffi_raw ... ok
test generated::bindgen_test_layout_ffi_java_raw_closure ... ok
test generated::bindgen_test_layout_ffi_raw_closure ... ok
test generated::bindgen_test_layout_max_align_t ... FAILED

---- generated::bindgen_test_layout_max_align_t stdout ----
thread 'generated::bindgen_test_layout_max_align_t' panicked at 'assertion failed: (left == right) (left: 16, right: 32): Size of: max_align_t', src/generated.rs:183

@tov
Copy link
Owner

tov commented Mar 1, 2017

It’s a generated test, and the generated code is failing it. The generated code defines a struct

#[repr(C)]
pub struct max_align_t {
    pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
    pub __clang_max_align_nonce2: f64,
}

The test is then that the size of this struct is 32 bytes. But it's failing and getting 16? Seems like 16 is right, though.

@cholcombe973
Copy link
Contributor Author

cholcombe973 commented Mar 1, 2017 via email

@tov
Copy link
Owner

tov commented Mar 1, 2017

The problem seems to be that the C source has long double as the type of the second field, and Rust thinks that has to be aligned at 16. But it's getting translated to f64. I’ve found a minimal example for bindgen input:

typedef struct {
    long double ld;
} max_align;

I’ll put together a bug report.

@cholcombe973
Copy link
Contributor Author

cholcombe973 commented Mar 1, 2017 via email

@tov
Copy link
Owner

tov commented Mar 1, 2017

Looks like they may know about it, and this may be the fix?: rust-lang/rust-bindgen#468

@tov
Copy link
Owner

tov commented Mar 1, 2017

Not the fix; possibly the cause?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants