Skip to content

Improve host architecture detection #322

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
Dec 14, 2017

Conversation

uraimo
Copy link
Contributor

@uraimo uraimo commented Nov 23, 2017

This PR improves host detection to provide the same logic being used in Swift.
Instead of using the specific ${CMAKE_SYSTEM_PROCESSOR} directly, this value should be used to choose a more generic variant.
No changes needed for ${SWIFT_OS}.

This PR also fixes an issue on ARM, where at the moment SWIFT_RUNTIME_LIBDIR points to .../armv7l/ instead of .../armv7/.

/cc @compnerd

CMakeLists.txt Outdated
set(SWIFT_HOST_ARCH "i686")
else()
message(FATAL_ERROR "Unrecognized architecture on host system: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
Copy link
Member

Choose a reason for hiding this comment

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

I think we should extract this into a separate function and put it into a support module incase we need this elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, added an additional function to the SwiftSupport.cmake module, since it's related to the architecture naming used by Swift.

# Usage:
# get_swift_host_arch(result_var_name)
#
# If the current architecture is supportedi by Swift, sets ${result_var_name}
Copy link
Member

Choose a reason for hiding this comment

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

typo: supportedi -> supported

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks!

@MadCoder
Copy link
Contributor

MadCoder commented Dec 4, 2017

please squash the pull request

@MadCoder
Copy link
Contributor

MadCoder commented Dec 4, 2017

@swift-ci please test

@uraimo
Copy link
Contributor Author

uraimo commented Dec 4, 2017

Squashed.

@MadCoder
Copy link
Contributor

MadCoder commented Dec 4, 2017

Gah of course the results of the tests are hidden now. stupid UI

@MadCoder
Copy link
Contributor

MadCoder commented Dec 4, 2017

@swift-ci please test

@MadCoder MadCoder merged commit 7e7a579 into swiftlang:master Dec 14, 2017
@uraimo uraimo mentioned this pull request May 22, 2018
ktopley-apple pushed a commit that referenced this pull request Dec 6, 2018
Improve host architecture detection

Signed-off-by: Daniel A. Steffen <[email protected]>
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.

4 participants