There's more than one way to do things | |
PerlMonks |
Re^8: XSLoader/DynaLoader Can't Locate Libraryby wbirkett (Acolyte) |
on Jun 16, 2020 at 16:05 UTC ( [id://11118142]=note: print w/replies, xml ) | Need Help?? |
Bliako, you are correct, my solution was not robust. It failed completely on newer versions of macOS with SIP (system integrity protection). It seems that moving the dylib to a non-standard location is a security risk known as "dylib hijacking." Apple has added checks to prevent this. https://www.virusbulletin.com/virusbulletin/2015/03/dylib-hijacking-os-x I was able to find a proper solution by linking the the Rmath library into the XS bundle. When compiling the Rmath dylib, an archive file is also produced – libRmath.a. This file is a compilation of the object (.o) code that went into the dylib. I changed a couple of lines in my Makefile.PL, removing the '-lRmath' from the 'LIBS' entry, and adding a new 'MYEXTLIB' line,
This change compiles the library code into the XS bundle, so the dylib is no longer required in my distribution. Everything works fine now. I sure wish there was better documentation for making XS modules. Thanks, again, for your help.
In Section
Seekers of Perl Wisdom
|
|