facebookarchive / BOLT

Binary Optimization and Layout Tool - A linux command-line utility used for optimizing performance of binaries
2.52k stars 178 forks source link

Lit tests fail with rebased branch. #148

Open Sameeranjoshi opened 3 years ago

Sameeranjoshi commented 3 years ago

While I was trying to run ninja check-bolt on the rebased branch following tests fail.


********************
********************
Failed Tests (17):
  BOLT :: X86/debugTypesBug.s
  BOLT :: X86/fix-branches-jrcxz.s
  BOLT :: X86/hot_end_symbol.s
  BOLT :: X86/instrumentation-dup-jts.s
  BOLT :: X86/instrumentation-ind-calls.s
  BOLT :: X86/interprocedural_ref_entry_point.s
  BOLT :: X86/issue20.s
  BOLT :: X86/no-output.test
  BOLT :: X86/pre-aggregated-perf.test
  BOLT :: X86/section_reloc_with_addend.s
  BOLT :: X86/shrinkwrapping-alignment.s
  BOLT :: X86/shrinkwrapping-critedge.s
  BOLT :: X86/shrinkwrapping-insertcfi.s
  BOLT :: X86/shrinkwrapping-lock.s
  BOLT :: X86/shrinkwrapping-pushpop.s
  BOLT :: X86/user-func-reorder.c
  BOLT :: X86/zero-sized-object.s

Testing Time: 0.52s
  Passed:  9
  Failed: 17

I am on an AMD Ryzen 7 hardware

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian

I see one frequent issue with many files.

hot_end_symbol.s.tmp.o: relocation R_X86_64_32S against `.data' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output

Are there some suggestions on fixing them maybe I can try sending a patch if that's trivial?

maksfb commented 3 years ago

Could you check if the compiler on your system produces position-independent executables (PIEs) by default?

yota9 commented 3 years ago

@maksfb Yes, I have the same problem. Since gcc/ld on the latest ubuntu produces PIE binaries by default I've passed %cflags with -no-pie option to all the tests to be able to test my changes. If you'd like I could make pull request with this changes.

maksfb commented 3 years ago

@yota9 - thanks, yes this will be great!

aaupov commented 3 years ago

@maksfb: we have these tests failing with the latest ubuntu due to pie (turned on by default since 17.10: https://wiki.ubuntu.com/Security/Features, Built as PIE)