BinKit icon indicating copy to clipboard operation
BinKit copied to clipboard

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

Open Bowen-n opened this issue 1 year ago • 1 comments

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?

Bowen-n avatar Apr 12 '23 11:04 Bowen-n