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

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 #1015

Closed
blshkv opened this issue Jan 24, 2024 · 3 comments
Assignees

Comments

@blshkv
Copy link

blshkv commented Jan 24, 2024

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

@romainthomas
Copy link
Member

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

@blshkv
Copy link
Author

blshkv commented Jan 24, 2024

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.

@romainthomas
Copy link
Member

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.

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

No branches or pull requests

2 participants