eclipse-omr / omr

Eclipse OMR™ Cross platform components for building reliable, high performance language runtimes
http://www.eclipse.org/omr
Other
949 stars 396 forks source link

Support DWARF 5 #6135

Closed Hello71 closed 8 months ago

Hello71 commented 3 years ago

When compiling openj9-openjdk, I received this error:

[  0%] Generating /tmp/openj9-openjdk-jdk16-0.27.0-release/build/linux-x86_64-server-release/vm/runtime/j9ddr.dat, /tmp/openj9-openjdk-jdk16-0.27.0-release/build/linux-x86_64-server-release/vm/superset.dat
Error: /tmp/openj9-openjdk-jdk16-0.27.0-release/omr/ddr/lib/ddr-scanner/dwarf/DwarfScanner.cpp:114 getSourcelist - Getting compilation directory string: DW_DLE_STRP_OFFSET_BAD(204)

Error: /tmp/openj9-openjdk-jdk16-0.27.0-release/omr/ddr/lib/ddr-scanner/dwarf/DwarfScanner.cpp:1524 traverse_cu_in_debug_section - Failed to get source file list.

Error: /tmp/openj9-openjdk-jdk16-0.27.0-release/omr/ddr/lib/ddr-scanner/dwarf/DwarfScanner.cpp:1591 startScan - Failure scanning /tmp/openj9-openjdk-jdk16-0.27.0-release/build/linux-x86_64-server-release/vm/runtime/libj9ddr_misc29.debuginfo

gmake[10]: *** [CMakeFiles/j9ddr.dir/build.make:749: /tmp/openj9-openjdk-jdk16-0.27.0-release/build/linux-x86_64-server-release/vm/runtime/j9ddr.dat] Error 1

I think this is related to https://gcc.gnu.org/gcc-11/changes.html:

For targets that produce DWARF debugging information GCC now defaults to DWARF version 5 (with the exception of VxWorks and Darwin/Mac OS X which default to version 2 and AIX which defaults to version 4). This can produce up to 25% more compact debug information compared to earlier versions.

This can be worked around by specifying -gdwarf-4, but it would be better to support the modern DWARF.

keithc-ca commented 3 years ago

On which Linux distribution did you encounter this? gcc-11 is not immediately available in Ubuntu 20.04 and the version of libdwarf.so on Ubuntu 18.04 doesn't support DWARF 5 (at least not well).

Hello71 commented 3 years ago

I used gcc 11.2.0 and libdwarf 20210305 on Gentoo Linux for this compilation.

janvrany commented 2 years ago

I just bumped into this problem while (native) building on RISC-V (gcc 11.2.0). Has been there any progress on this? Shall I just hack build scripts to pass -gdwarf-4?

keithc-ca commented 2 years ago

I looked at it briefly, but didn't have time to even collect a consistent set of tools. I'd be surprised if gcc-11 works without https://github.com/eclipse/omr/pull/6301 that addresses code problems that cause failures with gcc-10. I think using -gdwarf-4 in the meantime is reasonable

janvrany commented 2 years ago

I'd be surprised if gcc-11 works without #6301 On RISC-V there's no JIT so this is no problem. I'll use -gdwarf-4 temporarily.