Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8314610

hotspot can't compile with the latest of gtest because of <iomanip>

XMLWordPrintable

    • b12
    • generic
    • generic

        hotspot depends on gtest. the minimal version is 1.14.

        Recently, gtest removes <iomanip> from its header files. https://github.com/google/googletest/commit/9ef5e8226919b56d6760b48258e706d819409994

        hotspot won't build with the latest version of gtest. We will get the error as follows.

        === Output from failing command(s) repeated here ===
        * For target hotspot_variant-server_libjvm_gtest_objs_test_memset_with_concurrent_readers.o:
        /local/home/xxinliu/Devel/jdk/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp: In member function 'virtual void gc_memset_with_concurrent_readers_Test::TestBody()':
        /local/home/xxinliu/Devel/jdk/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp:82:34: error: 'setw' is not a member of 'std'; did you mean 'set'?
           82 | << std::setw(2) << line_byte(lp, 0) << " "
              | ^~~~
              | set
        /local/home/xxinliu/Devel/jdk/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp:83:34: error: 'setw' is not a member of 'std'; did you mean 'set'?
           83 | << std::setw(2) << line_byte(lp, 1) << " "
              | ^~~~
              | set
        /local/home/xxinliu/Devel/jdk/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp:84:34: error: 'setw' is not a member of 'std'; did you mean 'set'?
           84 | << std::setw(2) << line_byte(lp, 2) << " "
              | ^~~~
              | set
        /local/home/xxinliu/Devel/jdk/test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp:85:34: error: 'setw' is not a member of 'std'; did you mean 'set'?
           85 | << std::setw(2) << line_byte(lp, 3) << " "
           ... (rest of output omitted)

        * All command lines available in /local/home/xxinliu/Devel/jdk/build/linux-x86_64-server-slowdebug/make-support/failure-logs.
        === End of repeated output ===


        The reason is obvious. test_memset_with_concurrent_readers.cpp relies upon gtest to include the c++ standard header <iomanip>. I think we should fix it to secure gtest update path.

              xliu Xin Liu
              xliu Xin Liu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: