goccy / go-jit Goto Github PK
View Code? Open in Web Editor NEWJIT compile library for Go
License: MIT License
JIT compile library for Go
License: MIT License
Hello, I when I try to build, I get this error
jit-insn.c: In function ‘initialize_setjmp_block’:
jit-insn.c:7222:59: error: ‘sigsetjmp’ undeclared (first use in this function); did you mean ‘sigset_t’?
7222 | value = jit_insn_call_native(func, "sigsetjmp", (void *) sigsetjmp,
| ^~~~~~~~~
| sigset_t
jit-insn.c:7222:59: note: each undeclared identifier is reported only once for each function it appears in
jit-insn.c: In function ‘jit_insn_convert’:
jit-insn.c:4283:15: note: the ABI of passing union with ‘long double’ has changed in GCC 4.4
4283 | const_value = jit_value_get_constant(value);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hi, I use this repo and run its demo code in my M1 Mac book pro. It seems it can not build up. The error is below:
# github.com/goccy/go-jit/internal/ccall jit-apply.c:357:3: error: use of unknown builtin '__builtin_apply' [-Wimplicit-function-declaration] ../../../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/jit-apply-func.h:47:19: note: expanded from macro 'jit_builtin_apply' jit-apply.c:357:3: note: did you mean '__builtin_alloca'? ../../../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/jit-apply-func.h:47:19: note: expanded from macro 'jit_builtin_apply' jit-apply.c:335:2: note: '__builtin_alloca' declared here ../../../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/jit-apply-rules.h:151:47: note: expanded from macro 'jit_apply_builder_init' /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/alloca.h:39:22: note: expanded from macro 'alloca' /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/alloca.h:40:24: note: expanded from macro '__alloca' jit-apply.c:357:3: warning: incompatible integer to pointer conversion assigning to 'jit_apply_return *' from 'int' [-Wint-conversion] ../../../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/jit-apply-func.h:47:17: note: expanded from macro 'jit_builtin_apply' jit-apply.c:362:3: error: use of unknown builtin '__builtin_apply' [-Wimplicit-function-declaration] ../../../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/jit-apply-func.h:47:19: note: expanded from macro 'jit_builtin_apply' jit-apply.c:362:3: warning: incompatible integer to pointer conversion assigning to 'jit_apply_return *' from 'int' [-Wint-conversion] ../../../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/jit-apply-func.h:47:17: note: expanded from macro 'jit_builtin_apply' jit-apply.c:397:3: error: use of unknown builtin '__builtin_apply' [-Wimplicit-function-declaration] ../../../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/jit-apply-func.h:47:19: note: expanded from macro 'jit_builtin_apply' jit-apply.c:397:3: warning: incompatible integer to pointer conversion assigning to 'jit_apply_return *' from 'int' [-Wint-conversion] ../../../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/jit-apply-func.h:47:17: note: expanded from macro 'jit_builtin_apply' jit-apply.c:401:3: error: use of unknown builtin '__builtin_apply' [-Wimplicit-function-declaration] ../../../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/jit-apply-func.h:47:19: note: expanded from macro 'jit_builtin_apply' jit-apply.c:401:3: warning: incompatible integer to pointer conversion assigning to 'jit_apply_return *' from 'int' [-Wint-conversion] ../../../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/jit-apply-func.h:47:17: note: expanded from macro 'jit_builtin_apply'
/projects/go-test ❯ go run .
# github.com/goccy/go-jit/internal/ccall
jit-dump.c: In function ‘jit_dump_value’:
jit-dump.c:151:29: note: the ABI of passing union with ‘long double’ has changed in GCC 4.4
151 | const_value = jit_value_get_constant(value);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jit-dump.c: In function ‘dump_object_code’:
jit-dump.c:722:9: warning: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
722 | system(cmdline);
| ^~~~~~~~~~~~~~~
jit-dump.c:725:9: warning: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
725 | system(cmdline);
| ^~~~~~~~~~~~~~~
# github.com/goccy/go-jit/internal/ccall
In file included from /usr/include/features.h:486,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/include/jit/jit-dump.h:24,
from ../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/include/jit/jit.h:34,
from jit-internal.h:26,
from jit-elf-read.c:23:
In function ‘read’,
inlined from ‘jit_readelf_open’ at jit-elf-read.c:877:5:
/usr/include/x86_64-linux-gnu/bits/unistd.h:38:10: warning: ‘__read_alias’ writing 48 bytes into a region of size 2 overflows the destination [-Wstringop-overflow=]
38 | return __glibc_fortify (read, __nbytes, sizeof (char),
| ^~~~~~~~~~~~~~~
In file included from jit-elf-read.c:25:
/usr/include/x86_64-linux-gnu/bits/unistd.h: In function ‘jit_readelf_open’:
jit-elf-defs.h:91:17: note: destination object ‘e_type’ of size 2
91 | Elf64_Half e_type; /* Object file type */
| ^~~~~~
In file included from /usr/include/features.h:486,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/include/jit/jit-dump.h:24,
from ../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/include/jit/jit.h:34,
from jit-internal.h:26,
from jit-elf-read.c:23:
/usr/include/x86_64-linux-gnu/bits/unistd.h:26:16: note: in a call to function ‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’
26 | extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf,
| ^~~~~~~~~~
# github.com/goccy/go-jit/internal/ccall
jit-insn.c: In function ‘initialize_setjmp_block’:
jit-insn.c:7222:66: error: ‘sigsetjmp’ undeclared (first use in this function); did you mean ‘sigset_t’?
7222 | value = jit_insn_call_native(func, "sigsetjmp", (void *) sigsetjmp,
| ^~~~~~~~~
| sigset_t
jit-insn.c:7222:66: note: each undeclared identifier is reported only once for each function it appears in
jit-insn.c: In function ‘jit_insn_convert’:
jit-insn.c:4283:29: note: the ABI of passing union with ‘long double’ has changed in GCC 4.4
4283 | const_value = jit_value_get_constant(value);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~/projects/go-test 6s ❯ sudo apt install gcc
[sudo] password for joetifa:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gcc is already the newest version (4:11.2.0-1ubuntu1).
gcc set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded.
~/projects/go-test ❯ gcc -v
~/projects/go-test ❯
~/projects/go-test ❯ go build .
# github.com/goccy/go-jit/internal/ccall
jit-dump.c: In function ‘jit_dump_value’:
jit-dump.c:151:29: note: the ABI of passing union with ‘long double’ has changed in GCC 4.4
151 | const_value = jit_value_get_constant(value);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jit-dump.c: In function ‘dump_object_code’:
jit-dump.c:722:9: warning: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
722 | system(cmdline);
| ^~~~~~~~~~~~~~~
jit-dump.c:725:9: warning: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
725 | system(cmdline);
| ^~~~~~~~~~~~~~~
# github.com/goccy/go-jit/internal/ccall
In file included from /usr/include/features.h:486,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/include/jit/jit-dump.h:24,
from ../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/include/jit/jit.h:34,
from jit-internal.h:26,
from jit-elf-read.c:23:
In function ‘read’,
inlined from ‘jit_readelf_open’ at jit-elf-read.c:877:5:
/usr/include/x86_64-linux-gnu/bits/unistd.h:38:10: warning: ‘__read_alias’ writing 48 bytes into a region of size 2 overflows the destination [-Wstringop-overflow=]
38 | return __glibc_fortify (read, __nbytes, sizeof (char),
| ^~~~~~~~~~~~~~~
In file included from jit-elf-read.c:25:
/usr/include/x86_64-linux-gnu/bits/unistd.h: In function ‘jit_readelf_open’:
jit-elf-defs.h:91:17: note: destination object ‘e_type’ of size 2
91 | Elf64_Half e_type; /* Object file type */
| ^~~~~~
In file included from /usr/include/features.h:486,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/include/jit/jit-dump.h:24,
from ../../go/pkg/mod/github.com/goccy/[email protected]/internal/ccall/include/jit/jit.h:34,
from jit-internal.h:26,
from jit-elf-read.c:23:
/usr/include/x86_64-linux-gnu/bits/unistd.h:26:16: note: in a call to function ‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’
26 | extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf,
| ^~~~~~~~~~
# github.com/goccy/go-jit/internal/ccall
jit-insn.c: In function ‘initialize_setjmp_block’:
jit-insn.c:7222:66: error: ‘sigsetjmp’ undeclared (first use in this function); did you mean ‘sigset_t’?
7222 | value = jit_insn_call_native(func, "sigsetjmp", (void *) sigsetjmp,
| ^~~~~~~~~
| sigset_t
jit-insn.c:7222:66: note: each undeclared identifier is reported only once for each function it appears in
jit-insn.c: In function ‘jit_insn_convert’:
jit-insn.c:4283:29: note: the ABI of passing union with ‘long double’ has changed in GCC 4.4
4283 | const_value = jit_value_get_constant(value);
It seems like this project is licensed as MIT, but it contains LGPL code from libjit. Those two licenses are not compatible to be used as source files in the same project. As far as I know (I am no lawyer) this project should probably link with libjit dynamically, to be able to use it legally.
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.