Mac VST Binary Format


#1

Hello everybody,

I try to understand which Xcode configuration builds a VST plugin binary, the one inside the bundle.

For Windows this is building a DLL file which I got running.

For Xcode I am unsure. The official documentation simply speaks of a "raw code resource".

 

Could someone please enlighten me on what the nature of the file is?
I cannot see which Xcode option would make Xcode produce this type of binary instead of e.g. an executable one.
This is mainly about understanding what happens here. The Introjucer projects work.

Thanks
Dan


#2

Mac uses Bundles.

Those are basically folders containing your DLL and some additional resources (such as those plists you see).

Dyanamic Library is plain binary with sybmols to be called. most of the plug-in data located within Contents/MacOS/your_dll

try reading on Xcode nm executable to list symbols.


#3

Okay I figured it out.

The file type we are talking about is not a "dylib" aka "dll" file but a code resource just like an executable.

It is created by running the linker with the "-bundle" flag. This is about the binary file not the bundle folder.

The difference between this bundle binary file and an executable is that the bundle file supports PIC
(https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/MachOTopics/1-Articles/dynamic_code.html).

http://lists.apple.com/archives/cocoa-dev/2010/Jan/msg01795.html
You cannot convert a non-PIC binary to PIC. The compiler and linker will have made optimizations to the non-PIC binary that you can't undo without rebuilding it from scratch.

A typical main executable is also missing the symbol tables that would be needed for other code to link to its symbols.

PluginHost no longer complains about the binary format now but loading still fails but I guess I this has something to do with my code. A good hour of debugging should take care of that.

Thanks
Dan