php-llvm icon indicating copy to clipboard operation
php-llvm copied to clipboard

support BSD/MacOS

Open windrunner414 opened this issue 5 years ago • 2 comments

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'

windrunner414 avatar Apr 25 '19 02:04 windrunner414

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...

ircmaxell avatar Apr 25 '19 18:04 ircmaxell

Can we use nm? both linux and macos have this command. nm libLLVM.dylib

windrunner414 avatar Apr 26 '19 10:04 windrunner414