Fix Tizen linking flags used during ILCompiler build#129844
Conversation
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.
|
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. |
| </Exec> | ||
|
|
||
| <!-- tizen's gcc toolchain needs extra linker args --> | ||
| <Exec Command="test -f "$(SysRoot)/etc/os-release" && grep -q ID=tizen "$(SysRoot)/etc/os-release"" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(SysRoot)' != ''"> |
There was a problem hiding this comment.
Would it be better to detect Tizen using the RID instead?
There was a problem hiding this comment.
targetOS is derived using RID, and in this context, it’s linux-x64. Just like alpine case above, we need to distinguish this “distro” for additional toolchain path for cross publishing.
|
|
||
| <!-- Tizen requires additional linker args --> | ||
| <LinkerArg Include="-B"$(_TizenToolchainPath)"" Condition="'$(_IsTizenExitCode)' == '0'" /> | ||
| <LinkerArg Include="-L"$(SysRoot)/$(_TizenToolchainLibDir)"" Condition="'$(_IsTizenExitCode)' == '0'" /> |
There was a problem hiding this comment.
Are these things really necessary? We have not been passing standard library paths in other platforms. We pass --sysroot which should set these things up.
There was a problem hiding this comment.
Some of these maybe necessary, since Tizen might not be using regular/defacto locations in some cases (clang defines them at: https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Gnu.cpp). @gbalykov, could you please try removing a line, then publish an app on armv7l, arm64 and x64 to see if that line was needed; rinse and repeat to minimize this patch? Typically we only need a few linker related args not everything which was needed to build runtime repo.
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.