radareorg/r2ghidra

Build failure when compiling x86-64.slaspec

Opened this issue · 16 comments

Build Log:

...
Compiling (2 of 2) ../ghidra-native/src/Processors/x86/data/languages/x86-64.slaspec
WARN  247 NOP constructors found
WARN  Use -n switch to list each individually
WARN  201 unnecessary extensions/truncations were converted to copies
WARN  Use -u switch to list each individually
WARN  13 operations wrote to temporaries that were not read
WARN  Use -t switch to list each individually
Unrecoverable error: Child has as many Patterns as parent
make[1]: *** [deps.mk:121: sleigh-build] Error 2
make[1]: Leaving directory '/usr/src/r2ghidra-5.5.2/ghidra'
make: *** [Makefile:9: all] Error 2

There's no need to build the sleigh files to use r2ghidra, they are distributed in the release page as a zip (and compiled in the CI). but this shouldnt be failing, so i'll take a look. thanks for reporting!

it builds fine for me, im unable to reproduce your problems, can you try again and confirm with a clean checkout? :?

Sorry, I failed to mention I was compiling 5.5.2 and ghidra-native 0.1.3, I'll try again with 5.5.4 and 0.1.5 respectively.

Still failing with:

Compiling 2 slaspec files in ../ghidra-native/src/Processors/x86
Compiling (1 of 2) ../ghidra-native/src/Processors/x86/data/languages/x86.slaspec
WARN  221 NOP constructors found
WARN  Use -n switch to list each individually
WARN  201 unnecessary extensions/truncations were converted to copies
WARN  Use -u switch to list each individually
WARN  10 operations wrote to temporaries that were not read
WARN  Use -t switch to list each individually
Compiling (2 of 2) ../ghidra-native/src/Processors/x86/data/languages/x86-64.slaspec
WARN  247 NOP constructors found
WARN  Use -n switch to list each individually
WARN  201 unnecessary extensions/truncations were converted to copies
WARN  Use -u switch to list each individually
WARN  13 operations wrote to temporaries that were not read
WARN  Use -t switch to list each individually
Unrecoverable error: Child has as many Patterns as parent
make[1]: *** [deps.mk:121: sleigh-build] Error 2
make[1]: Leaving directory '/usr/src/r2ghidra-5.5.4/ghidra'
make: *** [Makefile:9: all] Error 2

Build steps:

  • unpack r2ghidra
  • unpack ghidra-native
  • apply patches (make -C ghidra-native patch)
  • ./configure && make

Unpack? Are you building from tarballs?

the ci (and me) always test this from git. Maybe is this the issue? Can u confirm?

R2ghidra is known to not compile in ubuntu18 because the compiler shipped there have bugs. I never tried r2g on musl. But that could be affecting too. Which compiler are you using? Try with clang

GCC 10.3.0, I can't upgrade to GCC 11 because it has a bug in libstdc++. I'll try with clang-13.

I'm getting exactly the same error when compiling with clang 13.

From where's the error exactly coming from? what does it mean?

This error is generated by sleighc, you can grep the ghidra code for this string.

i can compile the sleigh files in my alpine machine which runs gcc++9 and musl. So not sure where your issue is coming from. Try running make in r2ghidra/ghidra or remove the executable there and run make again. I did a clean checkout right now and tested all your steps and it builds fine for me so i cant repro

I'm still running into the same issue.

Thats part of ghidra. Not r2ghidra.. and i assume there must be a problem with your memory or compiler. Can you please tell me whcich compiler and version and how much ram do u have so i can try to repro?

Nvm u tried gcc and clang :? just read the backlog. When you say musl based distro do you mean alpine? I would like to be able to repro..