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

[SR-7612] Add host target triple for arm64/aarch64 machines. #1587

Merged
merged 2 commits into from Jun 1, 2018
Merged

[SR-7612] Add host target triple for arm64/aarch64 machines. #1587

merged 2 commits into from Jun 1, 2018

Conversation

futurejones
Copy link
Contributor

@futurejones futurejones commented May 30, 2018

Added host target triple for arm64/aarch64.
Fixed incorrect armv7 triple.
Refactored bootstrap "compute the build paths"
Refactored Triple.swift "os and machine" dif's

New OS's and processor/machine types are currently being added in an addhoc manner. Refactoring the Utilities/bootstrap and Triple.swift addresses [SR-7612]. While this solution is still hardcoded it provides conformity between machines and a consistent naming type for triples.
i.e [machine][OS] - x86Linux, arm64Linux.
This will provide an easy path for adding new machines and OS's in the future.

Added support for arm64/aarch64
Fixed incorrect armv7 triple
Refactored "Compute the build paths"
Added support for arm64/aarch64
Added triples for currently supported machines
Fixed incorrect armv7 triple
Refactored os and arch dif's
@futurejones futurejones changed the title Add host target triple for arm64/aarch64 machines. [SR-7612] Add host target triple for arm64/aarch64 machines. May 30, 2018
@ankitspd
Copy link
Member

@swift-ci please smoke test

build_target = "s390x-unknown-linux"
elif platform.machine() == 'ppc64le':
build_target = 'powerpc64le-unknown-linux'
elif platform.machine().startswith("armv7"):
Copy link
Member

Choose a reason for hiding this comment

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

Is this correct? The previous code was checking this: platform.machine() == 'arm'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes,
platform.machine() == 'arm' will fail on some machines.
e.g. RaspberryPi3 platform.machine() returns 'armv7l'
By using .startswith("armv7") we can identify the arm machines that are compatible with the 'armv7-unknown-linux-gnueabihf' triple.
.startswith() has also been included in https://github.com/uraimo/buildSwiftOnARM/blob/master/swiftpm.diffs/1546.diff

elif platform.machine() == 'ppc64le':
build_target = 'powerpc64le-unknown-linux'
elif platform.machine().startswith("armv7"):
build_target = 'armv7-unknown-linux-gnueabihf'
Copy link
Member

Choose a reason for hiding this comment

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

Similarly, the previous code has this target triple: arm-linux-gnueabihf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes,
This change has also been included in https://github.com/uraimo/buildSwiftOnARM/blob/master/swiftpm.diffs/1546.diff
It has been tested on a variety of armv7 boards such as RaspberryPi, Asus Tinkerboard, ODROID Xu4.

@ankitspd ankitspd merged commit 4f59f05 into apple:master Jun 1, 2018
@ankitspd
Copy link
Member

ankitspd commented Jun 1, 2018

Great, thanks!

@futurejones futurejones deleted the bootstrap-triple-arm64 branch June 6, 2018 06:59
@futurejones futurejones restored the bootstrap-triple-arm64 branch June 18, 2018 22:35
@futurejones
Copy link
Contributor Author

Is it possible to add this PR to the "swift-4.1-branch" ?

@ankitspd
Copy link
Member

@futurejones Nope, Swift 4.1 is already released! https://swift.org/blog/swift-4-1-released/

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.

None yet

2 participants