Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Conversation

@SedarG
Copy link
Contributor

@SedarG SedarG commented Jan 26, 2017

….Globalization.Native.a

Replacing the dummy globalization implementation for unix with the actual one

@jkotas, PTAL,

/cc @dotnet/corert-contrib

….Globalization.Native.a

Replacing the dummy globalization implementation for unix with the actual one
else
{

// lifted from https://github.com/dotnet/coreclr/blob/master/src/vm/comutilnative.cpp#L3009-L3032
Copy link
Member

Choose a reason for hiding this comment

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

Nit: A lot of code in CoreRT CoreLib was lifted from somewhere in CoreCLR. We do not include the links to where it was lifted from. (Also, the link you have added will become bogus pretty quickly as the original file will change.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do.

<Compile Include="System\Runtime\InteropServices\Marshal.cs" />
<Compile Include="System\Runtime\InteropServices\MarshalAdapter.cs" />
<Compile Include="System\Runtime\InteropServices\MarshalImpl.cs" />
<Compile Include="System\Runtime\InteropServices\MarshalAsAttribute.cs" />
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add forwarders for these from System.Private.Interop to System.Private.CoreLib so that the existing ProjectN corefx drop does not break?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do.

@jkotas
Copy link
Member

jkotas commented Jan 26, 2017

@shrah @yizhang82 Do you see any issues with the moved interop types?

@jkotas
Copy link
Member

jkotas commented Jan 26, 2017

@tarekgh Could you please take a look at the globalization changes as well?

@jkotas
Copy link
Member

jkotas commented Jan 26, 2017

LGTM otherwise

return IndexOfOrdinal(source, target, startIndex, count, ignoreCase: false);
}

if (_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options) && source.IsFastSort() && target.IsFastSort())
Copy link
Member

Choose a reason for hiding this comment

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

why removed this code? my understanding this can still work.

Copy link
Member

Choose a reason for hiding this comment

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

I guess we should keep the exact code we have in coreclr under \mscorlib\corefx\System\Globalization. right?

Copy link
Member

Choose a reason for hiding this comment

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

do we have limitation in corert for keeping such code?

Copy link
Member

Choose a reason for hiding this comment

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

The IsFastSort, etc. bits are not cached in object pre-header in CoreRT. I agree we should keep the CoreCLR specific code under #if CORECLR so that we can share the sources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do.

@MichalStrehovsky
Copy link
Member

The OSX failures seem to be due to some missing libraries (libICU?). We might need to add them to src\BuildIntegration\Microsoft.NETCore.Native.Unix.props.

Is this the fix for issue #2184?

@tarekgh
Copy link
Member

tarekgh commented Jan 26, 2017

other than my comment, LGTM

</ItemGroup>
<!-- Dummy globalization implementation -->
<!-- Dummy globalization implementation
<ItemGroup Condition="'$(TargetsUnix)'=='true'">
Copy link
Member

Choose a reason for hiding this comment

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

Could you please change the Condition to be false instead of commenting out the whole block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do.

@yizhang82
Copy link
Contributor

@jkotas No concerns with the type move. @SedarG has chatted with me before hand. It looks good to me.

@SedarG
Copy link
Contributor Author

SedarG commented Jan 27, 2017

The OSX failures seem to be due to some missing libraries (libICU?).

It looks like that. the missing symbols are from ICU. however they are being referenced from libSystem.Globalization.Native.a. so I'm not sure about the right fix, static linking ICU to the globalization pal or app.exe

Is this the fix for issue #2184?

Yes!. It does fix #2184. Thanks

@jkotas
Copy link
Member

jkotas commented Jan 27, 2017

static linking ICU to the globalization pal or app.exe

Dynamically link against icucore. Same as what we are doing in the standalone shim:

https://github.com/dotnet/coreclr/blob/decdf7d5a2ad1b8163d5d6756a1c43a6a028f438/src/corefx/System.Globalization.Native/CMakeLists.txt#L104

<ItemGroup>
<AdditionalNativeLibrary Include="$(IlcPath)/sdk/libSystem.Private.CoreLib.Native.a" />
<AdditionalNativeLibrary Include="$(IlcPath)/framework/System.Native.a" />
<AdditionalNativeLibrary Include="$(IlcPath)/framework/libSystem.Globalization.Native.a" />
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have this inconsistency in library naming? We have System.Native.a, but libSystem.Globalization.Native.a. On CoreCLR, none of the shared libraries that are named with System.XXXX have the lib prefix, so it seems strange to have it for some of the static ones.

Copy link
Member

Choose a reason for hiding this comment

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

I agree we should fix the names to be consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

isn't libXXX more adopted naming convention in the industry? Why did we name those libs as such on CoreCLR in the first place? Shall we fix libSystem.Globalization.Native.a or System.Native.a ?

Copy link
Member

Choose a reason for hiding this comment

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

We have made this choice a long time ago so that the shared library name matches the corresponding managed assembly. You can see the quite long discussion here: dotnet/coreclr#745

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the pointer @janvorli. I'll update libSystem.Globalization.Native.a name

@SedarG
Copy link
Contributor Author

SedarG commented Jan 27, 2017

I've updated the PR according to the feedback. The only change that I didn't include is renaming System.Globalization.Native.a, which requires a change on CoreCLR and a follow-up on CoreRT. I'll handle that separately.

@jkotas
Copy link
Member

jkotas commented Jan 29, 2017

@dotnet-bot test Windows_NT Release please

@jkotas jkotas merged commit d652ab4 into dotnet:master Jan 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants