php-llvm
php-llvm copied to clipboard
support BSD/MacOS
In macos, the dynamic library name is 'libLLVM.dylib' and it's not ELF format.
FFiMe only support ELF format so I can't generate the ffi code.
I use the llvm7.php and manually set the library path it throw some error like
Next FFI\Exception: Failed resolving C function 'LLVMInitializeAVRTargetInfo'
So one challenge here is we need some method of doing symbol extraction from a dylib. Something akin to https://lowlevelbits.org/parsing-mach-o-files/ That way FFIMe can appropriately compile the proper shared library code...
Can we use nm
? both linux and macos have this command.
nm libLLVM.dylib