Stripping symbols on plugins

Hi,

I'm having no luck on stripping symbols on plugin built in "Release". I tried "strip -x -S filename.component" but I get an error:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: can't map file: /Volumes/Data/temp/Mac/filename.component (Invalid argument)

I'm on XCode 5.1.1, Juce 3.2 with all commits until few days before Juce 4.

Any advice?

Thanks!

plugin.component is the packge, try plugin.component/Contents/MacOS/plugin

Hi,

Any mac-savy kind soul could help me call “strip” with the right arguments to strip symbols in .vst, .vst3, .component plugins and .app?

My guess is:
strip -x plugin.component/Contents/MacOS/plugin
strip -x plugin.vst/Contents/MacOS/plugin
strip -x plugin.vst3/Contents/MacOS/plugin
strip -x appname.app/Contents/MacOS/appname

Am I missing something?

What options would you recommend me to use? Is “-x” enough?

Thanks much

strip -x should do it but for minimal binary size and symbol exposure, I recommend checking these options as well:
GCC_GENERATE_DEBUGGING_SYMBOLS GCC_INLINES_ARE_PRIVATE_EXTERN GCC_SYMBOLS_PRIVATE_EXTERN

1 Like

So I guess my question should be, is it necessary to call strip later or it should be enough to configure Xcode with the right flags?

I’m getting the following error when I call strip -x on vst , vst3 and the app:
fatal error: file not in an order that can be processed (link edit information does not fill the __LINKEDIT segment): /xxx/Release/xxx.app/Contents/MacOS/xxx](xxx.app/Contents/MacOS/xxx)(for architecture x86_64)

I have “Strip Local Symbols” enabled in the Projucer project. Would you recommend me to add anything else in “Custom Xcode Flags”?
GCC_INLINES_ARE_PRIVATE_EXTERN = YES,
GCC_SYMBOLS_PRIVATE_EXTERN = YES

At Cmake strip plugin binaries the following flags are also suggested. Any experiences with these ones?
XCODE_ATTRIBUTE_DEPLOYMENT_POSTPROCESSING = YES,
XCODE_ATTRIBUTE_STRIP_INSTALLED_PRODUCT = YES

PS: Feel free to PM if you want to keep your settings private.

Many thanks!

For the macOS release build, I have it working with the following flags in my cmake project:

set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g")
set (CMAKE_XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Release] "YES")
set (CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT[variant=Release] "dwarf-with-dsym")
set (CMAKE_XCODE_ATTRIBUTE_DEPLOYMENT_POSTPROCESSING[variant=Release] "YES")

and strip the symbols as a post build action with strip -x ${PRODUCT_NAME}.${artifact_extension}/Contents/MacOS/${PRODUCT_NAME}.

Can’t remember why but also had to disable the copy plugin after build option for the release build so it does not interfere with the symbols stuff.

3 Likes