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

[11] build issue on MacOS/aarch64 12.2.1 using Xcode 13.1: call to 'log2_intptr' is ambiguous

XMLWordPrintable

    • b04
    • aarch64
    • os_x

      Build issue when building on MacOS/aarch64 12.2.1 using Xcode 13.1. The cause being the uintptr_t cast that was removed from line 92 from a commit pulled into PR: https://github.com/openjdk/jdk11u-dev/pull/280

      commit: https://github.com/rnkovacs/jdk11u-dev/commit/a5c4e72723e22da242a0e0f7d5168f553d12be7f

      file; src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp:

      @@ -89,7 +89,7 @@ class MacroAssembler: public Assembler {
            = (operand_valid_for_logical_immediate(false /*is32*/,
                                                   (uint64_t)Universe::narrow_klass_base())
               && ((uint64_t)Universe::narrow_klass_base()
      - > (1UL << log2_intptr((uintptr_t)Universe::narrow_klass_range()))));


      The issue can be resolved by adding the cast back like so:
      > (1UL << log2_intptr(checked_cast<uintptr_t>(Universe::narrow_klass_range())))));

      BUILD ERROR summary:

      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/asm/macroAssembler.hpp:31:
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp:92:25: error: call to 'log2_intptr' is ambiguous
                   > (1ULL << log2_intptr(Universe::narrow_klass_range()))));
                              ^~~~~~~~~~~

      BUILD ERROR in full:

      $ make images CONF=macosx-aarch64-normal-server-release
      Building target 'images' in configuration 'macosx-aarch64-normal-server-release'
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/precompiled/precompiled.hpp:111:
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/interpreter/abstractInterpreter.hpp:28:
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/asm/macroAssembler.hpp:31:
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp:92:25: error: call to 'log2_intptr' is ambiguous
                   > (1ULL << log2_intptr(Universe::narrow_klass_range()))));
                              ^~~~~~~~~~~
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/precompiled/precompiled.hpp:111:
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/interpreter/abstractInterpreter.hpp:28:
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/asm/macroAssembler.hpp:31:
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp:92:25: error: call to 'log2_intptr' is ambiguous
                   > (1ULL << log2_intptr(Universe::narrow_klass_range()))));
                              ^~~~~~~~~~~
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/utilities/globalDefinitions.hpp:1094:12: note: candidate function
      inline int log2_intptr(uintptr_t x) {
                 ^
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/utilities/globalDefinitions.hpp:1120:12: note: candidate function
      inline int log2_intptr(intptr_t x) {
                 ^
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/utilities/globalDefinitions.hpp:1094:12: note: candidate function
      inline int log2_intptr(uintptr_t x) {
                 ^
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/utilities/globalDefinitions.hpp:1120:12: note: candidate function
      inline int log2_intptr(intptr_t x) {
                 ^
      1 error generated.
      1 error generated.
      make[3]: *** [/Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/build/macosx-aarch64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/precompiled/precompiled.hpp.pch] Error 1
      make[3]: *** Waiting for unfinished jobs....
      make[3]: *** [/Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/build/macosx-aarch64-normal-server-release/hotspot/variant-server/libjvm/objs/precompiled/precompiled.hpp.pch] Error 1
      make[2]: *** [hotspot-server-libs] Error 2

      ERROR: Build failed for target 'images' in configuration 'macosx-aarch64-normal-server-release' (exit code 2)

      === Output from failing command(s) repeated here ===
      * For target hotspot_variant-server_libjvm_gtest_objs_precompiled_precompiled.hpp.pch:
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/precompiled/precompiled.hpp:111:
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/interpreter/abstractInterpreter.hpp:28:
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/asm/macroAssembler.hpp:31:
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp:92:25: error: call to 'log2_intptr' is ambiguous
                   > (1ULL << log2_intptr(Universe::narrow_klass_range()))));
                              ^~~~~~~~~~~
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/utilities/globalDefinitions.hpp:1094:12: note: candidate function
      inline int log2_intptr(uintptr_t x) {
                 ^
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/utilities/globalDefinitions.hpp:1120:12: note: candidate function
      inline int log2_intptr(intptr_t x) {
                 ^
      1 error generated.
      * For target hotspot_variant-server_libjvm_objs_precompiled_precompiled.hpp.pch:
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/precompiled/precompiled.hpp:111:
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/interpreter/abstractInterpreter.hpp:28:
      In file included from /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/asm/macroAssembler.hpp:31:
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp:92:25: error: call to 'log2_intptr' is ambiguous
                   > (1ULL << log2_intptr(Universe::narrow_klass_range()))));
                              ^~~~~~~~~~~
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/utilities/globalDefinitions.hpp:1094:12: note: candidate function
      inline int log2_intptr(uintptr_t x) {
                 ^
      /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/src/hotspot/share/utilities/globalDefinitions.hpp:1120:12: note: candidate function
      inline int log2_intptr(intptr_t x) {
                 ^
      1 error generated.

      * All command lines available in /Users/ahmed/Documents/dev/repos/jdk11u-dev-upstream/build/macosx-aarch64-normal-server-release/make-support/failure-logs.
      === End of repeated output ===

      No indication of failed target found.
      Hint: Try searching the build log for '] Error'.
      Hint: See doc/building.html#troubleshooting for assistance.

      make[1]: *** [main] Error 2
      make: *** [images] Error 2

            goetz Goetz Lindenmaier
            macarte Mat Carter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: