Skip to content

Fix Tizen linking flags used during ILCompiler build#129844

Open
gbalykov wants to merge 1 commit into
dotnet:mainfrom
gbalykov:fix-tizen-link-args
Open

Fix Tizen linking flags used during ILCompiler build#129844
gbalykov wants to merge 1 commit into
dotnet:mainfrom
gbalykov:fix-tizen-link-args

Conversation

@gbalykov

Copy link
Copy Markdown
Member

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.
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 25, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

@am11

am11 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Looks good. Is it for cross-publish only or does it work on Tizen machine as well (assuming SDK works on Tizen)?

@gbalykov

Copy link
Copy Markdown
Member Author

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. CrossCompileArch is used for cross/native builds check in src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets, however, CrossCompileArch is only set if _hostArchitecture != _targetArchitecture. This is not true for cross build to tizen x64, that's why there's no such check in this patch.

</Exec>

<!-- tizen's gcc toolchain needs extra linker args -->
<Exec Command="test -f &quot;$(SysRoot)/etc/os-release&quot; &amp;&amp; grep -q ID=tizen &quot;$(SysRoot)/etc/os-release&quot;" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(SysRoot)' != ''">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it be better to detect Tizen using the RID instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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&quot;$(_TizenToolchainPath)&quot;" Condition="'$(_IsTizenExitCode)' == '0'" />
<LinkerArg Include="-L&quot;$(SysRoot)/$(_TizenToolchainLibDir)&quot;" Condition="'$(_IsTizenExitCode)' == '0'" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@am11 am11 Jun 25, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants