Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Enable global invariant on OSX#10470

Merged
tarekgh merged 5 commits intodotnet:masterfrom
tarekgh:EnableGlobalInvariantOnMac
Mar 25, 2017
Merged

Enable global invariant on OSX#10470
tarekgh merged 5 commits intodotnet:masterfrom
tarekgh:EnableGlobalInvariantOnMac

Conversation

@tarekgh
Copy link
Member

@tarekgh tarekgh commented Mar 24, 2017

Fixes #10329

While building System.Globalization.native for OSX, we used to statically link to ICU library

Users/tarek/oss/coreclr/bin/Product/OSX.x64.Release/System.Globalization.Native.dylib:
        ...
	/usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 57.1.0)
        ...

The change here is instead of static linking to ICU library, we'll dynamic loading the library at run time. This will allow us to not load the ICU library at all when running in the Globalization Invariant mode.

Technically we didn't change from where we load the ICU library.

@tarekgh
Copy link
Member Author

tarekgh commented Mar 24, 2017

@jkotas @janvorli could you please have a look?

CC @danmosemsft

@tarekgh
Copy link
Member Author

tarekgh commented Mar 24, 2017

@dotnet-bot test Ubuntu x64 corefx_baseline

SET(FEATURE_FIXED_ICU_VERSION 1)

add_definitions(-DOSX_ICU_LIBRARY_PATH=\"${ICUCORE}\")
add_definitions(-DOSX_PLATFORM)
Copy link
Member

Choose a reason for hiding this comment

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

This define is not necessary, use __APPLE__ instead which is defined by the OSX headers. We use the same in CoreCLR and CoreRT.

Copy link
Member Author

Choose a reason for hiding this comment

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

good I'll do that

// This method shouldn't get called at all if we are running in globalization invariant mode
// return 0 if failed to load ICU and 1 otherwise
extern "C" int32_t GlobalizationNative_LoadICU()
#ifdef OSX_PLATFORM
Copy link
Member

Choose a reason for hiding this comment

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

None of the functions / version constants above are needed on OSX, could you please ifdef them out?

Copy link
Member Author

Choose a reason for hiding this comment

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

will do that too


#else

bool InitializeICULinks(char* symbolName, char* symbolVersion)
Copy link
Member

Choose a reason for hiding this comment

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

Why is the name InitializeICULinks? I'm not sure what the "links" means. Would you mind renaming it to FindICULibs? That would represent better what the function does.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not good in naming. I used links to include the libraries and symbols. but I can change it as you suggested as I don't have strong opinion on that :-)

@tarekgh
Copy link
Member Author

tarekgh commented Mar 25, 2017

@dotnet-bot test Ubuntu x64 corefx_baseline

@tarekgh
Copy link
Member Author

tarekgh commented Mar 25, 2017

@janvorli I have addressed all your feedback. thanks.

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@tarekgh
Copy link
Member Author

tarekgh commented Mar 25, 2017

#10264

@tarekgh
Copy link
Member Author

tarekgh commented Mar 25, 2017

thanks @janvorli for your review.

@tarekgh tarekgh merged commit 094f808 into dotnet:master Mar 25, 2017
@tarekgh tarekgh deleted the EnableGlobalInvariantOnMac branch March 25, 2017 17:41
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants