On Wed, 21 Sep 2022 10:47:38 GMT, Thomas Schatzl <tscha...@openjdk.org> wrote:
>> Thanks Thomas for that link. I was not aware of this `-gdwarf-aranges` flag. >> I've tried it out and it indeed seems to work. But I was not able to build >> with `-flto=thin` as it resulted in build failures. So, I'm not sure what >> would happen and if it's even possible to build with it in general. >> Nevertheless, I suggest to go with that `-gdwarf-aranges` flag solution for >> now and remove the previously suggested bailout fix for Clang. >> >> However, `-gdwarf-aranges` (and `-gdwarf-4` which I think we should also add >> to avoid getting the unsupported DWARF 5 format) was only added in Clang >> 5.0. But we must support down to 3.5 according to: >> https://github.com/openjdk/jdk/blob/cb72f80925965c73e32c44ce3196866272306d7f/doc/building.md?plain=1#L353-L354 >> >> I therefore changed the previous complete bailout fix to a bailout fix for >> Clang versions older than 5.0. >> >> I've noticed that Clang is emitting a full relative path for the filename in >> the form of `src/hotspot/share/compiler/compilerThread.cpp:58` with debug >> builds (it only emits the filename with release builds). I therefore added >> an additional method `strip_path_prefix()` to get rid of the path prefix. > >> Thanks Thomas for that link. I was not aware of this `-gdwarf-aranges` flag. >> I've tried it out and it indeed seems to work. But I was not able to build >> with `-flto=thin` as it resulted in build failures. > > I only thought that maybe we do compile with `-flto=thin` already, and so we > could not use these flags. > >>So, I'm not sure what would happen and if it's even possible to build with it >>in general. Nevertheless, I suggest to go with that `-gdwarf-aranges` flag >>solution for now and remove the previously suggested bailout fix for Clang. > > I agree. > >> >> However, `-gdwarf-aranges` (and `-gdwarf-4` which I think we should also add >> to avoid getting the unsupported DWARF 5 format) was only added in Clang >> 5.0. But we must support down to 3.5 according to: >> >> https://github.com/openjdk/jdk/blob/cb72f80925965c73e32c44ce3196866272306d7f/doc/building.md?plain=1#L353-L354 >> >> I therefore changed the previous complete bailout fix to a bailout fix for >> Clang versions older than 5.0. >> >> I've noticed that Clang is emitting a full relative path for the filename in >> the form of `src/hotspot/share/compiler/compilerThread.cpp:58` with debug >> builds (it only emits the filename with release builds). I therefore added >> an additional method `strip_path_prefix()` to get rid of the path prefix. > > Okay. Thanks @tschatzl for reviewing it again! ------------- PR: https://git.openjdk.org/jdk/pull/10287