-
Notifications
You must be signed in to change notification settings - Fork 200
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
[NativeAOT-LLVM] Implement most of globalization #2490
Conversation
Package the globalization data into a static library and use that at user link time.
<Target Name="BuildNativeCommon" | ||
DependsOnTargets="GenerateNativeVersionFile"> | ||
<ItemGroup> | ||
<_IcuArtifacts Condition="'$(_IcuDir)' != '' and '$(TargetsAppleMobile)' != 'true'" | ||
Include="$(_IcuDir)/lib/libicuuc.a; | ||
$(_IcuDir)/lib/libicui18n.a; | ||
$(_IcuDir)/lib/libicudata.a; | ||
$(_IcuDir)/lib/*.dat" /> | ||
</ItemGroup> | ||
|
||
<Copy SourceFiles="@(_IcuArtifacts)" DestinationFolder="$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'native', '$(_BuildNativeOutConfig)'))" SkipUnchangedFiles="true" /> | ||
</Target> |
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 hope to upstream changes to this file, and perhaps remove the duplicate copying done by wasm.proj
/wasi.proj
.
<!-- We want to put 'warn-unresolved-symbols' here, but wasm-ld crashs on that. Oops. --> | ||
<CustomLinkerArg Include="-Wl,--unresolved-symbols=ignore-all" /> |
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.
Will have to debug and file a bug on LLVM about this (if it hasn't been fixed already)...
Edit: there is one already - llvm/llvm-project#53987.
@dotnet/nativeaot-llvm |
FYI: Likely conflict with dotnet/runtime#97216 |
In ".align X", "X" is a power of two. Also, use a zero-sized end symbol. Symbols need not have > 0 sizes.
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.
Nice, thanks
How this works:
icudt.dat
and friends).libSystem.Native.a
and friends.Overall few changes are required, but this is notably different from what Mono does, which runs some code at runtime startup that locates the ICU data (either by downloading it, or from the file system, or from the single-file bundle). It means that our
DotNetJsApi
case will still use the static data, but do that startup thing too. We can cross the bridge of reconciling these two approaches onceDotNetJsApi
gets a little more mature.Another part not yet working is the time zone data, which uses Mono-specific bundling mechanism. It is the last undefined symbol for
HelloWasm
targeting WASI, I will tackle it separately (in #2491).