View Full Version : Iplug OSX symbol exports
Just in case anybody wants to produce Release binaries without all the function names in (it halves the size) under OSX, here's what you need to do:
- enable "Symbols Hidden By Default" in the xcode settings.
- find the definition of EXPORT used for APPLE in IPlug_include_in_plug_hdr.h (it's blank at the moment) and change it to:
#define EXPORT __attribute__ ((visibility("default")))
- also check that debug symbols is off in all the Release builds, and both lice and IPlug have "Symbols Hidden by default" and maybe also "Hidden inline functions"
Then you should be able to strip the binaries as normal.
cerberus
09-02-2010, 10:56 PM
- enable "Symbols Hidden By Default" in the xcode settings.
this worked great until i tried to build an audio unit. it seems that is
one thing which could cause an audio unit to load in a disabled
state in reaper, and not be able to be activated at all.
-disabling- "Symbols Hidden By Default" in the xcode settings solved it.
=======
also... my plug-in does not show up in hosts in 10.5 or 10.4.
i can't get the iplug example project to work in 10.5 or 10.4 either....
perhaps it is another one of these changes which i've made?
olilarkin
12-20-2010, 07:19 AM
anyone got this working with audiounits?
oli
No. However, I have been able to strip away most symbols (I think), which reduced my binary size from 2.1 MB to 1 MB.
olilarkin
12-24-2010, 10:39 AM
No. However, I have been able to strip away most symbols (I think), which reduced my binary size from 2.1 MB to 1 MB.
how did you do that?
how did you do that?
By tweaking Xcode's strip settings for my project. I have attached a screenshot of (hopefully all) the relevant options.
olilarkin
12-24-2010, 11:19 AM
thanks
olilarkin
03-13-2011, 05:12 AM
are you enabling "Symbols Hidden By Default" on the static library release build too?
thanks,
olilarkin
03-13-2011, 06:01 AM
adding this in IPlug_include_in_plug_src.h
extern "C"
{
__attribute__ ((visibility("default"))) ComponentResult PLUG_ENTRY(ComponentParameters* params, void* pPlug)
{
return IPlugAU::IPlugAUEntry(params, pPlug);
}
__attribute__ ((visibility("default"))) ComponentResult PLUG_VIEW_ENTRY(ComponentParameters* params, void* pView)
{
return IPlugAU::IPlugAUCarbonViewEntry(params, pView);
}
fixes the problem with aus not validating when stripping symbols
are you enabling "Symbols Hidden By Default" on the static library release build too?
No. Do you think I should?
fixes the problem with aus not validating when stripping symbols
What problem is that exactly?
olilarkin
03-13-2011, 03:17 PM
No. Do you think I should?
- not sure, maybe it gets stripped anyway, look at the binary size. obviously the majority of the symbols are in the library
What problem is that exactly?
The Plugin_AU_Entry and Plugin_AU_ViewEntry symbols were getting hidden, and with my set up at least this meant it wouldn't validate
Thanks.
The Plugin_AU_Entry and Plugin_AU_ViewEntry symbols were getting hidden, and with my set up at least this meant it wouldn't validate
I have already applied cc_'s EXPORT fix from the 1st post in this thread, which I think addresses the same problem.
olilarkin
03-13-2011, 03:45 PM
sorry i could have written this:
extern "C"
{
EXPORT ComponentResult PLUG_ENTRY(ComponentParameters* params, void* pPlug)
{
return IPlugAU::IPlugAUEntry(params, pPlug);
}
EXPORT ComponentResult PLUG_VIEW_ENTRY(ComponentParameters* params, void* pView)
{
return IPlugAU::IPlugAUCarbonViewEntry(params, pView);
}
now if you do what cc says at the top it works with aus
search in the project for EXPORT and you will see where it is used
cerberus
03-13-2011, 03:53 PM
could someone please clarify which code is effective and exactly where it ought to go?
also i have just noticed "#elif"; i'm wondering if that can be used in one's main.cpp
to specify code that needs to run only for audio units?
are you enabling "Symbols Hidden By Default" on the static library release build too?
I have just re-checked, but hiding symbols by default in the static library doesn't do anything for the binary size of your final component. (In fact, I don't think it even does anything for static libs, because it's a linker thing [right?], not a librarian thing.)
now if you do what cc says at the top it works with aus
Well, this is what confuses me: It already worked for me without your fix. With the extra EXPORTs it still works, but somehow I don't seem to need them.
could someone please clarify which code is effective and exactly where it ought to go?
I think you only need to do what cc_ wrote in the 1st post.
also i have just noticed "#elif"; i'm wondering if that can be used in one's main.cpp
to specify code that needs to run only for audio units?
Assuming you have included the necessary IPlug headers, you can indeed do things like this:
#ifdef AU_API
// AU specific stuff goes here
#endif
Or:
#if defined(VST_API)
// VST specific stuff goes here
#elif defined(AU_API)
// AU specific stuff goes here
#endif
olilarkin
03-14-2011, 02:45 AM
Well, this is what confuses me: It already worked for me without your fix. With the extra EXPORTs it still works, but somehow I don't seem to need them.
hmm...
thinking about it this morning, maybe your plugin.exp file is getting processed and mine isn't, that might explain why i had to do this to get the au working
oli
I do have Exported Symbols File set to MyProject.exp, so this could well be.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.