Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should install runtime header lib/tcc/include/tcclib.h #6

Open
milahu opened this issue Feb 11, 2023 · 1 comment · May be fixed by #7
Open

should install runtime header lib/tcc/include/tcclib.h #6

milahu opened this issue Feb 11, 2023 · 1 comment · May be fixed by #7

Comments

@milahu
Copy link

milahu commented Feb 11, 2023

actual

$ (cd frida-tinycc/ && find * -type f)
include/libtcc.h
lib/libtcc.so
lib/pkgconfig/libtcc.pc
lib/tcc/include/stddef.h
lib/tcc/include/stdbool.h
lib/tcc/include/varargs.h
lib/tcc/include/stdarg.h
lib/tcc/include/stdnoreturn.h
lib/tcc/include/stdalign.h
lib/tcc/include/float.h
lib/tcc/include/ptrauth.h

expected

$ (cd tinycc/ && find lib/ include/ -regextype egrep -regex '.*\.(so|h|pc)') | grep -v lib/tcc/win32/
lib/tcc/include/stdatomic.h
lib/tcc/include/tcclib.h
lib/tcc/include/stdnoreturn.h
lib/tcc/include/stddef.h
lib/tcc/include/tgmath.h
lib/tcc/include/stdbool.h
lib/tcc/include/varargs.h
lib/tcc/include/float.h
lib/tcc/include/stdalign.h
lib/tcc/include/stdarg.h
lib/tcc/include/tccdefs.h
lib/pkgconfig/libtcc.pc
lib/libtcc.so
include/libtcc.h

as produced by tinycc.nix

diff

--- actual.txt
+++ expected.txt
@@ -2,10 +2,13 @@
 lib/libtcc.so
 lib/pkgconfig/libtcc.pc
 lib/tcc/include/float.h
-lib/tcc/include/ptrauth.h
 lib/tcc/include/stdalign.h
 lib/tcc/include/stdarg.h
+lib/tcc/include/stdatomic.h
 lib/tcc/include/stdbool.h
 lib/tcc/include/stddef.h
 lib/tcc/include/stdnoreturn.h
+lib/tcc/include/tccdefs.h
+lib/tcc/include/tcclib.h
+lib/tcc/include/tgmath.h
 lib/tcc/include/varargs.h

at least this looks important

lib/tcc/include/tcclib.h

tcclib.h has for example dlclose (error: 'dlclose' undeclared)

upstream installs tcclib.h from $(TOPSRC)/tcclib.h

$(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/include")

blame

tinycc/meson.build

Lines 97 to 107 in a438164

runtime_headers = [
'include/float.h',
'include/ptrauth.h',
'include/stdalign.h',
'include/stdarg.h',
'include/stdbool.h',
'include/stddef.h',
'include/stdnoreturn.h',
'include/varargs.h',
]
install_headers(runtime_headers, install_dir: tccdir / 'include')

@milahu milahu linked a pull request Feb 11, 2023 that will close this issue
@milahu
Copy link
Author

milahu commented Feb 11, 2023

error: 'dlclose' undeclared

is actually an expected error in frida-gum when tcclib.h is installed

todo: fix frida-gum ...

[147/181] Compiling C object bindings/gumjs/libfrida-gumjs-1.0.so.p/gumcmodule.c.o
FAILED: bindings/gumjs/libfrida-gumjs-1.0.so.p/gumcmodule.c.o 
gcc -I... /build/source/build/config.h ... bindings/gumjs/libfrida-gumjs-1.0.so.p/gumcmodule.c.o ... -o bindings/gumjs/libfrida-gumjs-1.0.so.p/gumcmodule.c.o -c ../bindings/gumjs/gumcmodule.c
In file included from /nix/store/i4dqcpppyyq5yqcvw95mv5s11yfyy8pf-glib-2.74.3/lib/glib-2.0/include/glibconfig.h:9,
                 from /nix/store/7gp6sgjxwr4bzvy4r29a0rmb476pxww0-glib-2.74.3-dev/include/glib-2.0/glib/gtypes.h:34,
                 from /nix/store/7gp6sgjxwr4bzvy4r29a0rmb476pxww0-glib-2.74.3-dev/include/glib-2.0/glib/galloca.h:34,
                 from /nix/store/7gp6sgjxwr4bzvy4r29a0rmb476pxww0-glib-2.74.3-dev/include/glib-2.0/glib.h:32,
                 from ../gum/gumdefs.h:10,
                 from ../gum/gummemory.h:11,
                 from ../bindings/gumjs/gumcmodule.h:10,
                 from ../bindings/gumjs/gumcmodule.c:7:
bindings/gumjs/gumcmodule-runtime.h: In function 'gum_cmodule_get_symbols':
bindings/gumjs/gumcmodule-runtime.h:2703:70: error: 'dlclose' undeclared (first use in this function); did you mean 'pclose'?
 2703 |     g_hash_table_insert (symbols, "dlclose", GUM_FUNCPTR_TO_POINTER (dlclose));
      |                                                                      ^~~~~~~

codegen in frida-gum/bindings/gumjs/generate-runtime.py

maybe codegen should ignore symbols from tcclib.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant