-
Notifications
You must be signed in to change notification settings - Fork 707
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
codegen: Use target pointer size consistently for layout calculations #1289
Conversation
e7d8082
to
b69ecbf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
let triple; | ||
let pointer_width; | ||
unsafe { | ||
let ti = clang_getTranslationUnitTargetInfo(tu.x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, nice -- this is the API you sent patches upstream to add, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right :)
len; | ||
field_layout.align = mem::size_of::<*mut ()>(); | ||
// access, since they won't be properly aligned, but there's not too | ||
// much we can do about it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For posterity, we can use #[repr(align(..))]
to fix this ultra hack now (given a new enough target rust).
ci/before_install.sh
Outdated
@@ -1,36 +1,60 @@ | |||
set -ex | |||
set -e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having -x
is useful for debugging CI runs -- is there a particular reason you removed it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, the script was taken from clang-sys, and they removed it upstream. But I'll re-add.
Plus fix the check that avoids us generating explicit alignment fields for structs aligned to more than pointer-size. Fixes rust-lang#1291
@bors-servo r=fitzgen |
📌 Commit de0d850 has been approved by |
codegen: Use target pointer size consistently for layout calculations Assuming new enough libclang, this PR makes cross-compilation do layout calculations properly. Fixes #1284
☀️ Test successful - status-travis |
Assuming new enough libclang, this PR makes cross-compilation do layout calculations properly.
Fixes #1284