Skip to content

[android] Fix PIC test for Android ARMv7/AArch64 #23614

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

Merged
merged 1 commit into from
Apr 9, 2019

Conversation

drodriguez
Copy link
Contributor

For the AArch64 test, the only change is making the @page piece
optional. LLVM doesn't seem to generate that part when targetting
Android.

For the ARMv7 tests, it is a little bit more complicated. Android seems
to use a different structure for PIC, which involve two labels and
instructions which are not movw/movt. To keep the iOS test undisturbed,
I added an extra check for the target-sdk-name. That allows iOS to be
the same, and Android to have their own checks. For Linux (the only
other SDK I can find that targets ARMv7), I used the Android solution,
because that seems to be what LLVM generates when using
armv7-none-linux.

@drodriguez drodriguez requested a review from compnerd March 28, 2019 00:59
@compnerd
Copy link
Member

compnerd commented Apr 2, 2019

I think I would rather see it duplicated. Making the @page suffix optional means that it can accidentally become position dependent and it would still pass.

@drodriguez drodriguez force-pushed the android-fix-pic-test branch from 8b6626f to 8d41b22 Compare April 2, 2019 22:17
@drodriguez
Copy link
Contributor Author

Split the test into Linux/Windows/Android (iOS should use arm64 instead of aarch64). Only the Android part do not contain @PAGE.

@futurejones
Copy link
Contributor

@drodriguez @compnerd This test also needs fixing for Linux/AArch64
https://bugs.swift.org/browse/SR-9986
Change // aarch64-linux: adrp [[REG1:x[0-9]+]], ($s4main6globalSivp@PAGE)
to // aarch64-linux: adrp [[REG1:x[0-9]+]], ($s4main6globalSivp) the same as for aarch64-android
Can we get this added to this PR?
Thanks.

For the AArch64 test, the only change is making the @page piece
optional. LLVM doesn't seem to generate that part when targetting
Android or Linux.

For the ARMv7 tests, it is a little bit more complicated. Android seems
to use a different structure for PIC, which involve two labels and
instructions which are not movw/movt. To keep the iOS test undisturbed,
I added an extra check for the target-sdk-name. That allows iOS to be
the same, and Android to have their own checks. For Linux (the only
other SDK I can find that targets ARMv7), I used the Android solution,
because that seems to be what LLVM generates when using
armv7-none-linux.
@drodriguez drodriguez force-pushed the android-fix-pic-test branch from 8d41b22 to 0dee84a Compare April 5, 2019 01:49
@drodriguez
Copy link
Contributor Author

Done. I wonder if Windows do not have the @PAGE marker neither. I have left it there, just in case.

@compnerd: can you restart the tests and review this again for merging (last Android AArch64 test failing!)

@futurejones
Copy link
Contributor

Great, thanks.

@compnerd
Copy link
Member

compnerd commented Apr 8, 2019

@swift-ci please test

@compnerd
Copy link
Member

compnerd commented Apr 8, 2019

CC: @aschwaighofer @rjmccall

@swift-ci
Copy link
Contributor

swift-ci commented Apr 8, 2019

Build failed
Swift Test Linux Platform
Git Sha - 8b6626f07988e4090d263234da304e9f21fa9b3c

Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me.

@drodriguez drodriguez merged commit 530605d into swiftlang:master Apr 9, 2019
@drodriguez drodriguez deleted the android-fix-pic-test branch April 9, 2019 21:41
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.

5 participants