krakjoe / jitfu Goto Github PK
View Code? Open in Web Editor NEWCreating native instructions in PHP since 2014
Creating native instructions in PHP since 2014
It's currently a bit messy to get libjit and jitfu both running together: may add a git submodule?
Simple enough, take this bit of code, pasted here as reference:
zend_function_entry php_jit_type_methods[] = {
PHP_ME(Type, __construct, php_jit_type_construct_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(Type, getIdentifier, php_jit_no_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(Type, getIndirection, php_jit_no_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(Type, isPointer, php_jit_no_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(Type, dump, php_jit_type_dump_arginfo, ZEND_ACC_PUBLIC)
PHP_ME(Type, of, php_jit_type_of_arginfo, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_FE_END
};
and create a stub class of it to allow doc generation:
throw new \Exception('Do not manually include');
/**
* Stub class - do not manually include
*/
class Type
{
public function __construct() {}
public function getIdentifier() {}
public function getIndirection() {}
public function isPointer() {}
public function dump() {}
public function of() {}
}
If all I have to look for is PHP_ME
then I can do it myself and PR.
It can also be on a separate package that just requires the extension (if this metadata is not wanted here).
During installation, I was first told yacc command not found
. This was fixed by installing byacc
. Then, I got this after re-running make
:
vagrant@homestead:~/Code/libijt-fu$ make
cd . && /bin/bash ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make all-recursive
make[1]: Entering directory `/home/vagrant/Code/libijt-fu'
Making all in tools
make[2]: Entering directory `/home/vagrant/Code/libijt-fu/tools'
make all-am
make[3]: Entering directory `/home/vagrant/Code/libijt-fu/tools'
/bin/bash ../build-aux/ylwrap gen-rules-parser.y y.tab.c gen-rules-parser.c y.tab.h `echo gen-rules-parser.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output gen-rules-parser.output -- yacc -d
yacc: e - line 1712 of "/home/vagrant/Code/libijt-fu/tools/gen-rules-parser.y", syntax error
%error-verbose
^
make[3]: *** [gen-rules-parser.c] Error 1
make[3]: Leaving directory `/home/vagrant/Code/libijt-fu/tools'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/vagrant/Code/libijt-fu/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vagrant/Code/libijt-fu'
make: *** [all] Error 2
Setup: Vagrant, Ubuntu 14.04 x64. Specifically, Homestead Improved.
I have built libjit from current Git master (./configure --prefix=/usr/local/libjit
, make
, make install
).
When I try to configure the jitfu build (phpize
, ./configure --with-jitfu=/usr/local/libjit
), I get the following
$ ./configure --with-jitfu=/usr/local/libjit
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php-5.6
checking for PHP includes... -I/usr/local/php-5.6/include/php -I/usr/local/php-5.6/include/php/main -I/usr/local/php-5.6/include/php/TSRM -I/usr/local/php-5.6/include/php/Zend -I/usr/local/php-5.6/include/php/ext -I/usr/local/php-5.6/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php-5.6/lib/php/extensions/debug-non-zts-20131226
checking for PHP installed headers prefix... /usr/local/php-5.6/include/php
checking if debug is enabled... yes
checking if zts is enabled... yes
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking for JIT-Fu support... yes, shared
checking for jit_context_create in -ljit... no
configure: error: wrong libjit version or libjit not found
Is there a way to support "native" objects or structures ?
I see there is a Struct object defined but there are no examples.
Thanks
I tried http://ftp.gnu.org/old-gnu/dotgnu/libjit/libjit-0.1.2.tar.gz with no luck.
/home/reeze/jitfu/jitfu.c: In function 'php_jit_exception_type':
/home/reeze/jitfu/jitfu.c:82:8: error: 'JIT_RESULT_UNDEFINED_LABEL' undeclared (first use in this function)
/home/reeze/jitfu/jitfu.c:82:8: note: each undeclared identifier is reported only once for each function it appears in
/home/reeze/jitfu/jitfu.c:83:8: error: 'JIT_RESULT_MEMORY_FULL' undeclared (first use in this function)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.