https://bugs.llvm.org/show_bug.cgi?id=45022
Bug ID: 45022
Summary: [compiler-rt] .init_array section cmake check fails
silently when -DLLVM_PROFDATA_FILE passed
Product: new-bugs
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedb...@nondot.org
Reporter: zhizh...@google.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org
This bug happens after https://reviews.llvm.org/rL372209 is in.
To reproduce:
1. cmake -G Ninja -DLLVM_ENABLE_PROJECTS=compiler-rt \
-DLLVM_PROFDATA_FILE=/foo/bar.profdata path-to-llvm
2. Build llvm and `objdump -D
lib64/clang/10.0.0/lib/linux/clang_rt.crtbegin-x86_64.o`:
Disassembly of section .ctors:
0000000000000000 <.ctors>:
0: ff (bad)
1: ff (bad)
2: ff (bad)
3: ff (bad)
4: ff (bad)
5: ff (bad)
6: ff (bad)
7: ff .byte 0xff
Disassembly of section .bss.__do_fini.__finalized:
0000000000000000 <.bss.__do_fini.__finalized>:
...
Disassembly of section .dtors:
0000000000000000 <.dtors>:
0: ff (bad)
1: ff (bad)
2: ff (bad)
3: ff (bad)
4: ff (bad)
5: ff (bad)
6: ff (bad)
7: ff .byte 0xff
Root cause:
check_cxx_section_exists() in compiler-rt/lib/crt/CMakeLists.txt will fail
silently when -DLLVM_PROFILE_FILE is passed, causing .init_array section check
to return False after this check, and later compiler will generate objects with
bad .ctors/.dtors section.
To make this hidden error show up:
Adding command to print execution result error after `COMMAND
${test_compiler_command}` in compiler-rt/lib/crt/CMakeLists.txt,
error: Could not read profile
"/usr/local/google/home/zhizhouy/chromiumos/src/scripts/Workspace/llvm.profdata":
No such file or directory
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs