jdk9 build failure in ubuntu16.10

Severin Gehwolf sgehwolf at redhat.com
Tue Dec 6 09:37:00 UTC 2016


On Tue, 2016-12-06 at 12:25 +0530, Prasanta Sadhukhan wrote:
> Hi,
> 
> I was trying to build jdk9 workspace checked out today on ubuntu16.10 
> but am encountering a build problem. I did "configure --enable-debug 
> --disable-warnings-as-errors" followed by "make"
> Would like to know if it is a known issue?
> 
> Excerpts of build failure is: (Attached is the configure log and full 
> build log)
> 
> ERROR: Build failed for target 'default (exploded-image)' in 
> configuration 'linux-x86_64-normal-server-fastdebug' (exit code 2)
> === Output from failing command(s) repeated here ===
> * For target hotspot_variant-server_libjvm_gtest_objs_logTestFixture.o:
> In file included from 
> /export/jdk9/client/test/fmw/gtest/include/gtest/gtest.h:54:0,
>                   from 
> /export/jdk9/client/hotspot/test/native/unittest.hpp:31,
>                   from 
> /export/jdk9/client/hotspot/test/native/logging/logTestFixture.hpp:24,
>                   from 
> /export/jdk9/client/hotspot/test/native/logging/logTestFixture.cpp:25:
> /usr/include/c++/6/limits:320:11: error: macro "min" requires 2 
> arguments, but only 1 given
>         min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
>             ^
> /usr/include/c++/6/limits:324:11: error: macro "max" requires 2 
> arguments, but only 1 given
>         max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
>             ^
> /usr/include/c++/6/limits:387:11: error: macro "min" requires 2 
> arguments, but only 1 given
>         min() _GLIBCXX_USE_NOEXCEPT { return false; }
>     ... (rest of output omitted)
> === End of repeated output ===
> === Make failure sequence repeated here ===
> lib/CompileGtest.gmk:57: recipe for target 
> '/export/jdk9/client/build/linux-x86_64-normal-server-fastdebug/hotspot/variant-server/libjvm/gtest/objs/logTestFixture.o' 
> failed
> BuildHotspot.gmk:41: recipe for target 'variant-server-libs' failed

Yes, this is an annoying GCC 6 problem:
https://bugs.openjdk.java.net/browse/JDK-8161145

The current work-around that I use is this from Andrew Hughes[1]:
diff --git a/src/share/vm/utilities/globalDefinitions.hpp b/src/share/vm/utilities/globalDefinitions.hpp
--- a/src/share/vm/utilities/globalDefinitions.hpp
+++ b/src/share/vm/utilities/globalDefinitions.hpp
@@ -1095,8 +1095,10 @@
 #undef min
 #endif
 
+#ifndef _GLIBCXX_STDLIB_H
 #define max(a,b) Do_not_use_max_use_MAX2_instead
 #define min(a,b) Do_not_use_min_use_MIN2_instead
+#endif
 
 // It is necessary to use templates here. Having normal overloaded
 // functions does not work because it is necessary to provide both 32-

HTH,
Severin

[1] http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-July/023932.html

> Regards
> Prasanta




More information about the build-dev mailing list