SoftSec-KAIST / BinKit

Binary Code Similarity Analysis (BCSA) Benchmark
MIT License
134 stars 24 forks source link

"Branch out of range" error when compiling to mips_64 with clang-4.0 #10

Open Bowen-n opened 1 year ago

Bowen-n commented 1 year ago

I have successfully cross-compiled most of the gnu software following the workflow. However, for some of the software, "Branch out of range" error occurs when compiling to mips_64 with clang-4.0 (as well as clang-obfus-xxx).

For example, when compiling tar-1.30 with clang-4.0 (O0) to mips_64, it shows:

...
Making install in gnu
make[1]: Entering directory '/home/binkit/dataset/gnu/sources/tar/tar-1.30_clang-4.0_mips_64_O0_normal/gnu'
make  install-recursive
make[2]: Entering directory '/home/binkit/dataset/gnu/sources/tar/tar-1.30_clang-4.0_mips_64_O0_normal/gnu'
make[3]: Entering directory '/home/binkit/dataset/gnu/sources/tar/tar-1.30_clang-4.0_mips_64_O0_normal/gnu'
  CC       parse-datetime.o
/tmp/parse-datetime-41f91c.s: Assembler messages:
/tmp/parse-datetime-41f91c.s:44857: Error: branch out of range
/tmp/parse-datetime-41f91c.s:44960: Error: branch out of range
/tmp/parse-datetime-41f91c.s:45061: Error: branch out of range
/tmp/parse-datetime-41f91c.s:47476: Error: branch out of range
clang-4.0: error: assembler command failed with exit code 1 (use -v to see invocation)
Makefile:1897: recipe for target 'parse-datetime.o' failed
make[3]: *** [parse-datetime.o] Error 1
make[3]: Leaving directory '/home/binkit/dataset/gnu/sources/tar/tar-1.30_clang-4.0_mips_64_O0_normal/gnu'
Makefile:1922: recipe for target 'install-recursive' failed
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory '/home/binkit/dataset/gnu/sources/tar/tar-1.30_clang-4.0_mips_64_O0_normal/gnu'
Makefile:2076: recipe for target 'install' failed
make[1]: *** [install] Error 2
make[1]: Leaving directory '/home/binkit/dataset/gnu/sources/tar/tar-1.30_clang-4.0_mips_64_O0_normal/gnu'
Makefile:1388: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

I have tried my best to google it but I haven't found any solution. I wonder if you have encountered similar problem before and do you have suggestions to solve it?

0xdkay commented 1 year ago

Hello @Bowen-n , sorry for the late reply. We did not meet such an issue during our compilation. Could you explain more about your steps and compilation environment, so that we can look into it together?