too long lines were shrinked: [428/1485] x86_64-pc-linux-gnu-gcc -Ilibrz/bin/librz_bin.so.0.7.1.p -I. -I../rizin-v0.7.1 -Ilibrz -I../rizin-v0.7.1/librz -Ilibrz/include -I../rizin-v0.7.1/librz/include -I../rizin-v0.7.1/librz/bin/format -Isubprojects/yxml -I../rizin-v0.7.1/subprojects/yxml -Ilibrz/util/sdb/src -I../rizin-v0.7.1/li [429/1485] x86_64-pc-linux-gnu-gcc -Ilibrz/type/librz_type.so.0.7.1.p -I. -I../rizin-v0.7.1 -Ilibrz -I../rizin-v0.7.1/librz -Ilibrz/include -I../rizin-v0.7.1/librz/include -I../rizin-v0.7.1/librz/type/parser -Ilibrz/util/sdb/src -I../rizin-v0.7.1/librz/util/sdb/src -fdiagnostics-color=always -D_FILE [430/1485] x86_64-pc-linux-gnu-gcc -o librz/type/librz_type.so.0.7.1 librz/type/librz_type.so.0.7.1.p/base.c.o librz/type/librz_type.so.0.7.1.p/format.c.o librz/type/librz_type.so.0.7.1.p/function.c.o librz/type/librz_type.so.0.7.1.p/helpers.c.o librz/type/librz_type.so.0.7.1.p/path.c.o librz/type/ FAILED: librz/type/librz_type.so.0.7.1 x86_64-pc-linux-gnu-gcc -o librz/type/librz_type.so.0.7.1 librz/type/librz_type.so.0.7.1.p/base.c.o librz/type/librz_type.so.0.7.1.p/format.c.o librz/type/librz_type.so.0.7.1.p/function.c.o librz/type/librz_type.so.0.7.1.p/helpers.c.o librz/type/librz_type.so.0.7.1.p/path.c.o librz/type/librz_type. /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: librz/type/librz_type.so.0.7.1.p/parser_c_cpp_parser.c.o: in function `type_parse_string': c_cpp_parser.c:(.text+0x24): undefined reference to `ts_parser_new' /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: c_cpp_parser.c:(.text+0x40): undefined reference to `ts_parser_set_language' /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: c_cpp_parser.c:(.text+0x57): undefined reference to `ts_parser_parse_string' ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 23.0_mig17to23_spl2mrged-20240323-143215 ------------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-10 [2] x86_64-pc-linux-gnu-13 * clang/llvm (if any): clang version 18.1.2 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/18/bin Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg /usr/lib/llvm/18 18.1.2 Python 3.11.8 Available Ruby profiles: [1] ruby31 (with Rubygems) [2] ruby33 (with Rubygems) * Available Rust versions: [1] rust-bin-1.76.0 [2] rust-1.76.0 * The following VMs are available for generation-2: 1) Eclipse Temurin JDK 11.0.22_p7 [openjdk-bin-11] 2) Eclipse Temurin JDK 17.0.10_p7 [openjdk-bin-17] 3) Eclipse Temurin JDK 21.0.2_p13 [openjdk-bin-21] *) Eclipse Temurin JDK 8.402_p06 [openjdk-bin-8] Available Java Virtual Machines: [1] openjdk-bin-8 system-vm [2] openjdk-bin-11 [3] openjdk-bin-17 [4] openjdk-bin-21 The Glorious Glasgow Haskell Compilation System, version 9.2.8 php cli (if any): go version go1.22.1 linux/amd64 HEAD of ::gentoo commit 6acb667fc6a29f43f09f0559ecb696f21e9b6e69 Author: Repository mirror & CI <repomirrorci@gentoo.org> Date: Sun Mar 31 17:04:07 2024 +0000 2024-03-31 17:04:06 UTC emerge -qpvO dev-util/rizin [ebuild N ] dev-util/rizin-0.7.1 USE="(-test)"
Created attachment 889091 [details] emerge-info.txt
Created attachment 889092 [details] dev-util:rizin-0.7.1:20240331-172919.log.xz
Created attachment 889093 [details] emerge-history.txt.xz
Created attachment 889094 [details] environment
Created attachment 889095 [details] etc.clang.tar.xz
Created attachment 889096 [details] etc.portage.tar.xz
Created attachment 889097 [details] qlist-info.txt.xz
Created attachment 889098 [details] temp.tar.xz
Can't reproduce with GCC-14 and 0.7.1-r1. Maybe consequence of migration in progress?
If you dev-libs/tree-sitter-c is installed on the system it will try build against it, in that case pkg-conf file doesn't include -ltree-sitter leading to this issue. If you dont have tree-sitter-c then it build against its vendored subproject statically getting around this. Simplest solution to me appears to be dev-libs/tree-sitter-c appending -ltree-sitter to ADDITIONAL_LIBS otherwise the rizin buildsystem will have to be modified. https://github.com/tree-sitter/tree-sitter-c/blob/master/bindings/c/tree-sitter-c.pc.in#L10
Thanks, I can reproduce if I have tree-sitter-c installed. Looks like it's an automagic dependency but falls back to a bundled tree-sitter-c subproject, forked from before the problematic pkgconfig configuration was introduced, so we don't hit the problem there. Unfortunately, the use of the system tree-sitter-c is configurable with the same knob as tree-sitter and falls back to automagic, so we'll need a unqiue flag to support the scenario of system tree-sitter + bundled tree-sitter-c.
(In reply to John Helmert III from comment #11) > Thanks, I can reproduce if I have tree-sitter-c installed. Looks like it's > an automagic dependency but falls back to a bundled tree-sitter-c > subproject, forked from before the problematic pkgconfig configuration was > introduced, so we don't hit the problem there. > > Unfortunately, the use of the system tree-sitter-c is configurable with the > same knob as tree-sitter and falls back to automagic, so we'll need a unqiue > flag to support the scenario of system tree-sitter + bundled tree-sitter-c. Actually, scratch that, I missed that these changes aren't actually released yet, so we just need the ldflags hack with the released version and we can try pre-empting the upstream tree-sitter-c automagic with the unique configure flag.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db5243a984b4a04b871269f63ceb19ebaf4105ce commit db5243a984b4a04b871269f63ceb19ebaf4105ce Author: John Helmert III <ajak@gentoo.org> AuthorDate: 2024-09-02 05:58:00 +0000 Commit: John Helmert III <ajak@gentoo.org> CommitDate: 2024-09-02 06:00:32 +0000 dev-util/rizin: fix tree-sitter-c automagic Bug: https://bugs.gentoo.org/928301 Signed-off-by: John Helmert III <ajak@gentoo.org> dev-util/rizin/{rizin-0.7.3.ebuild => rizin-0.7.3-r1.ebuild} | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Whoops, looking again it looks like rizin actually is using tree-sitter symbols directly, but it doesn't specify the linkage itself (ie it's indirect through tree-sitter-c). Made a pair of PRs to address both this and the bundled tree-sitter-c issue: https://github.com/rizinorg/rizin/pull/4602 https://github.com/rizinorg/rizin/pull/4603 Closing since fixed in tree.