Dan McGregor <danismostlikely <at> gmail.com> writes: > On 11 July 2016 at 05:29, Patrick Ohly <patrick.ohly <at> intel.com> wrote: > > Dan McGregor <danismostlikely <at> gmail.com> writes: > >> From: Daniel McGregor <daniel.mcgregor <at> vecima.com> > >> > >> GCC 6 sets the default C++ standard to C++14 and introduces dead store > >> elimination by default. OpenJDK 8 is not ready for either of these > >> changes, so set the C++ standard back to gnu++98 and disable dead > >> store elimination. > >> > >> Switched to using --with-extra-cflags, cxxflags, and ldflags. The added > >> patch fixes building when using those flags, and are needed to get > >> CFLAGS into the JDK build in the native case. > > > > Has anyone tested this on a host system where gcc is still 4.x, like 4.9.2 > > on Debian Wheezy? > > > > I'm finding that -fno-lifetime-dse is also getting passed to the gcc used > > for compiling native binaries (obviously in openjdk-8-native, but also for > > some helper executables in openjdk-8). This then breaks the compilation > > because older gcc rejects that flag. > > > > I've briefly toyed with the patch below which worked for openjdk-8-native, > > but not for openjdk-8. I'm just going to work around it by staying on gcc > > 5.x and clearing these extra flags. > > > > I'm not familiar enough with the openjdk-8 build process to propose a better > > solution, but perhaps someone else has an idea? > > [...] > This regex doesn't work in the cross case because the version string > doesn't start with "gcc". It starts with '<target-triple>-gcc', so > that should be checked instead. > > I'll fiddle with this patch some more. It looks like a good short-term > solution to building OpenJDK on GCC 4 hosts.
Thanks for taking this further. But please really test on such an older system, because the patch alone is not enough. Something also needs to be done when configuring openjdk-8 such that it uses different flags when invoking the host compiler (old gcc) and the target compiler (gcc 6). I haven't found a solution for that (not familiar enough with the Java build system). Bye, Patrick -- _______________________________________________ Openembedded-devel mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-devel
