Uh oh!
There was an error while loading. Please reload this page.
add support for FreeBSD cross-compilation - #34000
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sdmaclea
left a comment
There was a problem hiding this comment.
I think there is a misunderstanding on the intended purpose of Host and Target.
We are using the gcc/gdb/llvm/lldb model for the definitions of Build, Host, Target.
Build the OS that the compiler is running on.Host the OS of the machine where the compiled code will run.Target the machine the which the running code will compile/debug.
In most cases TargetOS == HostOS. We have a few components which run on a different machine than their target. So far these are code generation and debug tools. For example we have a crossgen which can run on x64, but generate code for Arm64. I am also working on debugger tools which will run on Windows but debug a Linux runtime.
I think you are just trying to enable cross compilation of the runtime on Linux targeting FreeBSD. In this case the HostOS and the TargetOS should both be set to FreeBSD.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
wfurt
commented
Mar 25, 2020
Where is that definition? I only see use of Host and Target OS and ARCH through out the project files. And we already for example build Linux on Windows. |
wfurt
commented
Mar 25, 2020
I check and for the `linuxdac' target on Windows and I see CLR_CMAKE_HOST_OS=Windows_NT and CLR_CMAKE_TARGET_OS=Linux. (CLR_CMAKE_BUILD_OS is not set) |
Yes. That command line option builds a DAC on a There is very little mention of /cc @jkotas. |
sdmaclea
commented
Mar 25, 2020
|
sdmaclea
commented
Mar 25, 2020
One source of confusion is that by default |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
wfurt
commented
Mar 26, 2020
This should be hopefully ready for final pass. I made change @jkotas suggested to always pass |
Uh oh!
There was an error while loading. Please reload this page.
| @@ -1,4 +1,5 @@ | |||
| set(TARGET_ARCH_NAME $ENV{TARGET_BUILD_ARCH}) | |||
| set(CROSS_ROOTFS $ENV{ROOTFS_DIR}) | |||
There was a problem hiding this comment.
isn't this already set by eng/common/cross/toolchain.cmake ?
There was a problem hiding this comment.
That does not seems to be set soon enough and build fails. src/coreclr/tryrun.cmake has same line.
Uh oh!
There was an error while loading. Please reload this page.
@wfurt, @janvorli, a related question: In order to support non-Linux/macOS Unix, the requirements are:
With this PR changes, would we be able to get ./build.sh -cross -os FreeBSD -configuration Releasesuch that the produced |
wfurt
commented
Mar 31, 2020
perf leg failure seems unrelated. |
wfurt
commented
Mar 31, 2020
yes, I think so. for #3 all you needs to do is to avoid cross-genned or use environmental variables to suppress R2R. I was planning to feed cross-compiled runtime + SDK back to source-build. That may be good test. |
ericstj
commented
Apr 1, 2020
This change appears to be causing failures in all PRs due to passing |
am11
commented
Apr 1, 2020
Looks like runtime/src/coreclr/build-runtime.cmd Line 150 in 2ad6913 |
jkotas
commented
Apr 1, 2020
@wfurt The link to the issue tracking the unrelated failure should be added next time. https://github.com/dotnet/runtime/blob/master/docs/pr-guide.md#what-to-do-if-you-determine-the-failure-is-unrelated |
jaredpar
commented
Apr 1, 2020
This leg was also failing and was not addressed in the justification for merging. |
This change allows to cross-compile FreeBSD on Linux using
./build.sh -cross -os FreeBSD(depends on dotnet/arcade#5114 and dotnet/arcade#5100)
In general, this is using existing cross-compilation support. However, when we cross-compile for different CPU architecture, we can use host and target somewhat interchangeably. As we build arm Linux on x64 Linux) With this we need cleaner (and correct) separation. With the example above,
__HostOSandCLR_CMAKE_HOST_OSis set toLinuxwhile__TargetOSandCLR_CMAKE_TARGET_OSis set toFreeBSD. With that in mind,CLR_CMAKE_HOST_LINUXshould not be used to determine target options as well as created binaries are not runnable on host even if CPU architecture is same.-fuse-ld=lldis no longer needed with clang90 - both native and cross-compiled build.So far there is no CI. I did verify that generated pal/src/config.h is identical with one produced by running native build on FreeBSD.