juicysfplugin | Audio plugin to play soundfonts
kandi X-RAY | juicysfplugin Summary
kandi X-RAY | juicysfplugin Summary
Demo track: mp3, FLAC, FLAC +Soundgoodizer.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of juicysfplugin
juicysfplugin Key Features
juicysfplugin Examples and Code Snippets
Community Discussions
Trending Discussions on juicysfplugin
QUESTION
I built an audio plugin. I target .app
and .component
.
I dynamically link against a brew-installed library, libfluidsynth
.
I copied libfluidsynth
into the .app
/ .component
.
I used install_name_tool
to re-link the binary to point to the bundled libfluidsynth
.
libfluidsynth
depends on glib
, gthread
, intl
.
I copied those libraries into the bundle, re-linked libfluidsynth
to prefer the bundled copy.
I also did the same for those libraries and their dependencies.
Here's a quick peek at what that looks like:
...ANSWER
Answered 2018-Mar-15 at 02:14Okay, I got it working.
macOS load-time linking is documented at man dyld
.
The problem is that I told my binary to look for libraries relative to @executable_path
.
This works fine for .app, because the .app's binary is the executable.
But for my .vst and .component plugins, the binary is loaded into a different executable: the audio plugin host.
So, if we want to lookup a library relative to our binary (juicysfplugin.component/Contents/MacOS/juicysfplugin
), we need to use @loader_path
, not @executable_path
.
Now, onto the other mysteries… why did the load-time linker ignore my install path (@executable_path/../Frameworks/libfluidsynth.1.7.1.dylib
), and instead look for find fluidsynth under /usr/local/lib/libfluidsynth.1.7.1.dylib
?
It's because of DYLD_FALLBACK_LIBRARY_PATH
!
It is used as the default location for libraries not found in their install path. By default, it is set to
$(HOME)/lib:/usr/local/lib:/lib:/usr/lib
.
I believe that it failed to find the library in the install path. It then looked for that leaf file name — libfluidsynth.1.7.1.dylib
— under a few directories, including /usr/local/lib
(which succeded).
Why didn't I see the failed file lookups in opensnoop? Probably it uses a different syscall than open
/open_nocancel
/open_extended
. For example, running stat
on a file does not show up in opensnoop.
It's also possible that the load-time linking is done by a dyld
process. SIP would disallow attaching DTrace to this process.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install juicysfplugin
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page