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
Conversation
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
@swift-ci please smoke test |
build_target = "s390x-unknown-linux" | ||
elif platform.machine() == 'ppc64le': | ||
build_target = 'powerpc64le-unknown-linux' | ||
elif platform.machine().startswith("armv7"): |
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.
Is this correct? The previous code was checking this: platform.machine() == 'arm'
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.
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' |
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.
Similarly, the previous code has this target triple: arm-linux-gnueabihf
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.
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.
Great, thanks! |
Is it possible to add this PR to the "swift-4.1-branch" ? |
@futurejones Nope, Swift 4.1 is already released! https://swift.org/blog/swift-4-1-released/ |
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.