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

Atomic::add() with 64 bit value fails to link on 32-bit platforms

    Details

    • Subcomponent:
      jfr
    • Resolved In Build:
      b27
    • Verification:
      Verified

      Description

      Spotted on 32-bit builds post-check in for JDK-8242088.

      Atomic::add(&_tip._value, (traceid)1); // fails to link where type traceid is 64-bit

      Manifests as link issues, for example:

      jfrStorage.obj : error LNK2019: unresolved external symbol "public: unsigned __int64 __thiscall Atomic::PlatformAdd<8>::add_and_fetch<unsigned __int64,unsigned __int64>(unsigned __int64 volatile *,unsigned __int64,enum atomic_memory_order)const " (??$add_and_fetch@_K_K@?$PlatformAdd@$07@Atomic@@QBE_KPC_K_KW4atomic_memory_order@@@Z) referenced in function "public: static unsigned __int64 __cdecl Atomic::add<unsigned __int64,unsigned __int64>(unsigned __int64 volatile *,unsigned __int64,enum atomic_memory_order)" (??$add@_K_K@Atomic@@SA_KPC_K_KW4atomic_memory_order@@@Z)
      jfrTraceIdKlassQueue.obj : error LNK2001: unresolved external symbol "public: unsigned __int64 __thiscall Atomic::PlatformAdd<8>::add_and_fetch<unsigned __int64,unsigned __int64>(unsigned __int64 volatile *,unsigned __int64,enum atomic_memory_order)const " (??$add_and_fetch@_K_K@?$PlatformAdd@$07@Atomic@@QBE_KPC_K_KW4atomic_memory_order@@@Z)
      d:/priv/openjdk/nb/NTintel/nightly/output-jdk-dev/support/modules_libs/java.base/server/jvm.dll : fatal error LNK1120: 1 unresolved externals

      Changing to a solution based on Atomic::cmpxchg() works.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mgronlun Markus Grönlund
                Reporter:
                mgronlun Markus Grönlund
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: