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

Automatic generation of method export file for shared libraries #4986

Closed
tonerdo opened this issue Nov 22, 2017 · 6 comments
Closed

Automatic generation of method export file for shared libraries #4986

tonerdo opened this issue Nov 22, 2017 · 6 comments

Comments

@tonerdo
Copy link
Contributor

tonerdo commented Nov 22, 2017

At this time when building a shared library on Windows (.dll) you have to specify the path to a handcrafted .def file. The compiler should automatically generate a def file on Windows for all methods marked with the NativeCallable attributes

Parent issue: #1285

@jkotas
Copy link
Member

jkotas commented Nov 22, 2017

automatically generate a def file on Windows for all methods

All methods in user supplied assemblies. NativeCallable entry points used internally by the implementation should be excluded.

@tonerdo
Copy link
Contributor Author

tonerdo commented Nov 23, 2017

Working on this first

@jkotas
Copy link
Member

jkotas commented Nov 23, 2017

BTW: The non-Windows platforms have .def file equivalent as well. It is passed to the linker using -exported_symbols_list on Mac or --version-script on Linux. E.g. we use it when building coreclr.dll to control what gets exported: https://github.com/dotnet/coreclr/blob/master/src/dlls/mscoree/coreclr/CMakeLists.txt#L42

@tonerdo
Copy link
Contributor Author

tonerdo commented Nov 23, 2017

Will take a look, thanks

tonerdo added a commit to tonerdo/corert that referenced this issue Dec 20, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 20, 2017
@tonerdo
Copy link
Contributor Author

tonerdo commented Dec 20, 2017

Currently we don't need to specify a definition file on Unix for NativeCallable methods because all symbols are exported by default. Are you looking at exported_symbols_list and --version-script as a means to export ONLY NativeCallable methods that the developer defines?

@jkotas
Copy link
Member

jkotas commented Dec 21, 2017

Yes, either that or making the CoreRT symbols hidden by default - emit the CoreRT symbols on Unix with the same set of flags as clang emits them with -fvisibility=hidden.

Exporting all symbols by default bloats the binary a lot. This is primarily a binary size optimization, a pretty significant one I think.

tonerdo added a commit to tonerdo/corert that referenced this issue Dec 24, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 24, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 24, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 25, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 25, 2017
@tonerdo tonerdo changed the title Automatic generation of DEF file for Windows dll Automatic generation of method export file for shared libraries Dec 26, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 27, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 28, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 28, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 31, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 31, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Dec 31, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Jan 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants