Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 928301 - dev-util/rizin-0.7.1 - c_cpp_parser.c:(.text+<snip>): undefined reference to ts_parser_new
Summary: dev-util/rizin-0.7.1 - c_cpp_parser.c:(.text+<snip>): undefined reference to ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: John Helmert III
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: c99-porting
  Show dependency tree
 
Reported: 2024-03-31 17:32 UTC by Toralf Förster
Modified: 2024-09-24 10:48 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,20.10 KB, text/plain)
2024-03-31 17:32 UTC, Toralf Förster
Details
dev-util:rizin-0.7.1:20240331-172919.log.xz (dev-util:rizin-0.7.1:20240331-172919.log.xz,17.10 KB, application/x-xz)
2024-03-31 17:32 UTC, Toralf Förster
Details
emerge-history.txt.xz (emerge-history.txt.xz,95.74 KB, application/x-xz)
2024-03-31 17:32 UTC, Toralf Förster
Details
environment (environment,121.75 KB, text/plain)
2024-03-31 17:32 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.16 KB, application/x-xz)
2024-03-31 17:32 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,51.75 KB, application/x-xz)
2024-03-31 17:32 UTC, Toralf Förster
Details
qlist-info.txt.xz (qlist-info.txt.xz,95.56 KB, application/x-xz)
2024-03-31 17:32 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,27.92 KB, application/x-xz)
2024-03-31 17:32 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2024-03-31 17:32:00 UTC
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)"
Comment 1 Toralf Förster gentoo-dev 2024-03-31 17:32:01 UTC
Created attachment 889091 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2024-03-31 17:32:02 UTC
Created attachment 889092 [details]
dev-util:rizin-0.7.1:20240331-172919.log.xz
Comment 3 Toralf Förster gentoo-dev 2024-03-31 17:32:03 UTC
Created attachment 889093 [details]
emerge-history.txt.xz
Comment 4 Toralf Förster gentoo-dev 2024-03-31 17:32:05 UTC
Created attachment 889094 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2024-03-31 17:32:05 UTC
Created attachment 889095 [details]
etc.clang.tar.xz
Comment 6 Toralf Förster gentoo-dev 2024-03-31 17:32:06 UTC
Created attachment 889096 [details]
etc.portage.tar.xz
Comment 7 Toralf Förster gentoo-dev 2024-03-31 17:32:07 UTC
Created attachment 889097 [details]
qlist-info.txt.xz
Comment 8 Toralf Förster gentoo-dev 2024-03-31 17:32:09 UTC
Created attachment 889098 [details]
temp.tar.xz
Comment 9 NHO 2024-05-12 12:39:10 UTC
Can't reproduce with GCC-14 and 0.7.1-r1. Maybe consequence of migration in progress?
Comment 10 Alfred Wingate 2024-08-02 04:18:19 UTC
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
Comment 11 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2024-09-02 05:42:04 UTC
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.
Comment 12 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2024-09-02 05:51:01 UTC
(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.
Comment 13 Larry the Git Cow gentoo-dev 2024-09-02 06:00:43 UTC
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(-)
Comment 14 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2024-09-02 18:46:09 UTC
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.