Zori
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
[ Adding random folk who probably know more than me here. +rvargas, +joi, +jyasskin and can correct any misinformation ]If you want to ship code to actual users with something like -rdynamic that exports *all* symbols, then that's probably a no-go. I think there are two main things to watch out for here: binary bloat and startup time regression. I don't have a good sense for the *actual* costs here, but for your kind of change, we actually have reasonable performance tests that will catch any noticeable regression, so you can test it out. Binary bloat is possible because you are exporting symbols that previously were known to be unused, and therefore stripped. If they're being exported, then it becomes possible for them to get called, so it may prevent them from getting stripped from the binary. Startup time regression is possible because of increased work on the part of the dynamic loader due to the extra symbols.
Thanks for the comment. To give a little background, Zori is trying to enable chrome to load a DLL which can speak to chrome using a private automation interface. For the interface, Zori is trying to decide between:
1) Exporting symbols from the executable and linking appropriately when building the automation DLL
class AUTO_EXPORT Tab {
void LoadUrl(const std::string& url);
};
On mac, when building chrome we'd need to do something like -Wl,-exported_symbols_list, <file containing automation symbols>. When building the shared object we'd need to use -bundle_loader.
On linux, I'm not sure how we could restrict chrome to just exporting a few symbols and not all of them through rdynamic.
Thanks for the comment. To give a little background, Zori is trying to enable chrome to load a DLL which can speak to chrome using a private automation interface. For the interface, Zori is trying to decide between:
1) Exporting symbols from the executable and linking appropriately when building the automation DLL
class AUTO_EXPORT Tab {
void LoadUrl(const std::string& url);
};
On mac, when building chrome we'd need to do something like -Wl,-exported_symbols_list, <file containing automation symbols>. When building the shared object we'd need to use -bundle_loader.
On linux, I'm not sure how we could restrict chrome to just exporting a few symbols and not all of them through rdynamic. Maybe we could strip everything out we don't need? When building the shared object we shouldn't have to do anything since gcc won't complain about undefined symbols.
On windows, I think it should just work.
2) Don't do any exporting, just rely on the vtable and pass in a function pointer to instantiate an object (or something similar)
// In the module:void AUTO_EXPORT Init(Tab* (*create_tab_func)()) {create_tab_func()->LoadUrl("www.google.com");}// In shared header:
class Tab {
virtual void LoadUrl(const std::string& url) = 0;
};