> On Feb 13, 2020, at 7:26 AM, John Paul Adrian Glaubitz > <glaub...@physik.fu-berlin.de> wrote: > > Hello! > > Hotspot fails to build on linux-sparc after 8238281 due to the redefinition > of offset_of() in src/hotspot/share/prims/jvm.cpp [1]: > > /home/glaubitz/jdk/src/hotspot/cpu/sparc/macroAssembler_sparc.hpp: In static > member function 'static int RegistersForDebugging::i_offset(int)': > /home/glaubitz/jdk/src/hotspot/cpu/sparc/macroAssembler_sparc.hpp:488:74: > error: 'j' cannot appear in a constant-expression > 488 | static int i_offset(int j) { return offset_of(RegistersForDebugging, > i[j]); } > | ^ > > Since offsetof() can only be used with constant expressions, I have reused > the old definition of offset_of() in > src/hotspot/cpu/sparc/macroAssembler_sparc.hpp > to fix the issue. > > I couldn't come up with a more elegant solution, but I'm open for suggestions. > > Please review my change in [2]. > > Thanks, > Adrian > >> [1] https://bugs.openjdk.java.net/browse/JDK-8239001 >> [2] http://cr.openjdk.java.net/~glaubitz/8239001/webrev.00/
I don't think this is the right way to address this problem. I think the JDK-8238281 change to offset_of and the associated addition of -Wno-invalid-offsetof to the build configuration was a mistake, and should be reverted. Those changes seem unrelated to the purpose of JDK-8238281, which was to raise the minimum acceptable gcc version.