Repository navigation
Fix Tizen linking flags used during ILCompiler build - #129844
Conversation
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
|
Looks good. Is it for cross-publish only or does it work on Tizen machine as well (assuming SDK works on Tizen)? |
Currently I'm checking cross build case. |
Without this change linker flags set in src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets in SetupOSSpecificProps do not consider tizen platform specifics, which are set in toolchain.cmake.
cb38d60 to
5460876
Compare
Re-reading this part, are you saying that it's only tizen x64 that has the problem and this is because we don't set CrossCompileArch (the TargetTriple property ends up being empty and we're not passing If so, does adding |
|
Cross-compiling linux-musl-x64, openbsd-x64 or freebsd-x64 on linux-x64 would infer cross build based on composite "target and host OS + arch combination are not same". Tizen is odd one out because we decided to identify. I don't think what we have in main is flawed, but rather, it's either:
If it's 2, then we shouldn't detect distros. There are over 600 linux distros and we will end up maintaining the database here. Best to figure out why we think tizen needs a different flag. If it's 1. then we should just support |
What I wonder is if E.g. what if we updated this line to also check if a SysRoot was provided: |
|
In our engineering infra (to build runtime), we set In BuildIntegration, we can make it all pinned to Sysroot and update these as well: eng/common/native/LocateNativeCompiler.targets: <SysRoot Condition="'$(CrossBuild)' == 'true'">$(ROOTFS_DIR)</SysRoot>
eng/targetingpacks.targets: <SysRoot Condition="('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)') and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot>(needs testing) TL;DR, it is not straight-forward CrossBuild=>Sysroot currently, but it can be done. |
Yes, only x64 tizen build has this problem. However, adding Initially I also thought whether cross compilation can just be set based on presence of SysRoot, but decided to not do this since it will affect other platforms. |
I meant more in the shipping native AOT targets. If one invokes the native AOT targets with a SysRoot, we probably should be in a "this is a crossbuild" mode as far as invoking the linker is concerned.
If that doesn't work, it kind of seems like the cross toolchain is broken. We already have a precedent for reading (Now that I'm looking at it, I find the Alpine os-release precedent also suspicious because we know we're targeting Alpine from the RID and now we're constructing part of the Alpine triple from the RID and the other part from reading os-release. But that's also pre-existing so...) |
Point was, only changing that condition will break runtime CI because Sysroot and
That's because of a bug in clang driver that we had to use -alpine- (vendored) triplet on armv7 that doesn't work for non-Alpine linux-musl targets #101213. |
|
Thank you! |
Without this change linker flags set in src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets in SetupOSSpecificProps do not consider tizen platform specifics, which are set in toolchain.cmake.
Without this change linker flags set in src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets in SetupOSSpecificProps do not consider tizen platform specifics, which are set in toolchain.cmake.