-
Notifications
You must be signed in to change notification settings - Fork 369
Add x64 arch and freebsd arm64 in cross toolchain #9834
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
Conversation
This makes it easier to investigate issues like dotnet/runtime#71338 using docker on linux, mac or windows (without installing FreeBSD arm64). This script is used at https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/main/src/ubuntu/18.04/cross/freebsd/12/hooks/pre-build to produce docker images for runtime build prerequisites. |
set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0") | ||
endif() | ||
elseif(FREEBSD) | ||
set(triple "aarch64-unknown-freebsd12") |
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.
From my tests, isn't set(TOOLCHAIN "llvm")
also needed here, as later eng/native/configuretools.cmake
will fail while looking for objcopy
?
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.
TOOLCHAIN
is used to indicate triplet for other platforms. For freebsd-x64, it should be the same value before and after this refactoring. The arm64 block is a copy of refactored x64 block.
For compile to even start, I think that also lines: And also thanks @am11 for starting this - as for docker images with arm64, I assume there will be a need for separate PR to add those Dockerfiles, right? |
Just as a heads up from the readme.txt on FreeBSD's download FTP:
so |
set(CMAKE_SYSTEM_PROCESSOR x86_64) | ||
if(LINUX) | ||
set(TOOLCHAIN "x86_64-linux-gnu") | ||
if(TIZEN) |
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'm not sure if there's x64 Tizen. I have thought Tizen is only arm / x86. @alpencolt am I 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.
According to Wikipedia https://en.wikipedia.org/wiki/Tizen, x86-64 is supported. Here are the downloadable packages for x86_64: https://download.tizen.org/live/Tizen/standard/x86_64/
@sec, thanks. I have updated the |
What about a place to add |
For the diff --git a/eng/native/configuretools.cmake b/eng/native/configuretools.cmake
index 6697524c659..8476d82cca8 100644
--- a/eng/native/configuretools.cmake
+++ b/eng/native/configuretools.cmake
@@ -54,7 +54,11 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER)
set(TOOLSET_PREFIX ${ANDROID_TOOLCHAIN_PREFIX})
elseif(CMAKE_CROSSCOMPILING AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD AND
CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv8l|armv7l|armv6l|aarch64|arm|s390x|ppc64le)$")
- set(TOOLSET_PREFIX "${TOOLCHAIN}-")
+ if(FREEBSD)
+ set(TOOLSET_PREFIX "llvm-")
+ else()
+ set(TOOLSET_PREFIX "${TOOLCHAIN}-")
+ endif()
else()
set(TOOLSET_PREFIX "")
endif() |
objcopy configuration does not belong to toolchain.cmake. We set them in runtime/eng/native/configuretools.cmake. For more info on what "toolchain file" is for in cmake, see https://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html#toolchain-files. |
@sec, yes, we can add that after this PR is merged.
|
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.
LGTM, thank you!
Currently we recognize x64 architecture in cross toolchain for FreeBSD and illumos, but we do not treat it the same way as other architectures in the script. This PR moves x64 to the same plan as other architectures and adjusts the code flow.
Also added FreeBSD arm64.