lief-project / LIEF

LIEF - Library to Instrument Executable Formats

Home Page:https://lief-project.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LIEF-0.14.0/api/python/src/Abstract/pyBinary.cpp:129:9: error: unable to find string literal operator ‘operator""_p’ with ‘const char [33]’, ‘long unsigned int’ arguments

blshkv opened this issue · comments

Describe the bug
0.14.0 python bindings fail to compile

To Reproduce
Steps to reproduce the behavior:
Try to compile python bindings

Expected behavior
compiles

Environment (please complete the following information):

  • System and Version : Gentoo (Pentoo) latest
  • Target format (PE, ELF, Mach-O)

Additional context

[455/662] /usr/bin/x86_64-pc-linux-gnu-g++ -D_GLIBCXX_USE_CXX11_ABI=1 -DpyLIEF_EXPORTS -I/var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/api/python/src -I/usr/include/python3.12 -I/usr/lib/python3.12/site-packages/nanobind/include -I/var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/include -I/var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/api/c/include -I/var/tmp/portage/dev-util/lief-0.14.0/work/lief-0.14.0_build/include -isystem /var/tmp/portage/dev-util/lief-0.14.0/work/lief-0.14.0_build/lief_spdlog_project-prefix/src/lief_spdlog_project/include  -O2 -pipe -frecord-gcc-switches -O3 -DNDEBUG -std=gnu++17 -fPIC -fvisibility=hidden -fno-stack-protector -ffunction-sections -fdata-sections -MD -MT api/python/CMakeFiles/pyLIEF.dir/src/Abstract/pyBinary.cpp.o -MF api/python/CMakeFiles/pyLIEF.dir/src/Abstract/pyBinary.cpp.o.d -o api/python/CMakeFiles/pyLIEF.dir/src/Abstract/pyBinary.cpp.o -c /var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/api/python/src/Abstract/pyBinary.cpp
FAILED: api/python/CMakeFiles/pyLIEF.dir/src/Abstract/pyBinary.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -D_GLIBCXX_USE_CXX11_ABI=1 -DpyLIEF_EXPORTS -I/var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/api/python/src -I/usr/include/python3.12 -I/usr/lib/python3.12/site-packages/nanobind/include -I/var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/include -I/var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/api/c/include -I/var/tmp/portage/dev-util/lief-0.14.0/work/lief-0.14.0_build/include -isystem /var/tmp/portage/dev-util/lief-0.14.0/work/lief-0.14.0_build/lief_spdlog_project-prefix/src/lief_spdlog_project/include  -O2 -pipe -frecord-gcc-switches -O3 -DNDEBUG -std=gnu++17 -fPIC -fvisibility=hidden -fno-stack-protector -ffunction-sections -fdata-sections -MD -MT api/python/CMakeFiles/pyLIEF.dir/src/Abstract/pyBinary.cpp.o -MF api/python/CMakeFiles/pyLIEF.dir/src/Abstract/pyBinary.cpp.o.d -o api/python/CMakeFiles/pyLIEF.dir/src/Abstract/pyBinary.cpp.o -c /var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/api/python/src/Abstract/pyBinary.cpp
/var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/api/python/src/Abstract/pyBinary.cpp: In function ‘void LIEF::py::create(nanobind::module_&) [with T = LIEF::Binary]’:
/var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/api/python/src/Abstract/pyBinary.cpp:129:9: error: unable to find string literal operator ‘operator""_p’ with ‘const char [33]’, ‘long unsigned int’ arguments
  129 |         "(self) -> list[Union[str,bytes]]"_p)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/api/python/src/Abstract/pyBinary.cpp:206:9: error: unable to find string literal operator ‘operator""_p’ with ‘const char [30]’, ‘long unsigned int’ arguments
  206 |         "abstract(self) -> lief.Binary"_p,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/dev-util/lief-0.14.0/work/LIEF-0.14.0/api/python/src/Abstract/pyBinary.cpp:219:9: error: unable to find string literal operator ‘operator""_p’ with ‘const char [71]’, ‘long unsigned int’ arguments
  219 |         "concrete(self) -> lief.ELF.Binary | lief.PE.Binary | lief.MachO.Binary"_p,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

NOTICE

If the issue does not contain enough information to be reproduced,
it will be flagged as incomplete
and closed.

/NOTICE

You need to use the nanobind version that is shipped with LIEF: third-party/nanobind-1.7.0.r7.gfd1f04b.zip

ah, it compiles with that fork, thanks.
I was sure that you pushed whatever fix you wrote to a newer v1.8.0. But you didn't.
Could you push it, please?

At Gentoo, we try to unbundle all third-party tools, compile as separate packages and track their bugs separately too, that's what I'm using
LIEF_EXTERNAL_NANOBINDS option.

I was sure that you pushed whatever fix you wrote to a newer v1.8.0. But you didn't.
Could you push it, please?

Actually there is not Git repo for LIEF's changes on nanobind. The sources are available in the .zip though.

You should consider this version as strongly bound to LIEF and I guess that from a packaging perspective, it does not make really sense (IMHO) to have this modified version of nanobind without LIEF.