none
Compile Driver for ARM64 by VS2015 failure. RRS feed

  • Question

  • Hi, 

    I need to move my driver from x64 to ARM64. 
    But, there are many compiler error return, like the following, when I
    use the VS2015 express to build a "NEW" & "Default" Kernel Mode Driver (KMDF) project with ARM64 setting. 
    I did not add any code to this project and still got those errors.

    Severity Code Description Project File Line Suppression State
    Error C4013 'DbgRaiseAssertionFailure' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 21843
    Error C4013 'DbgRaiseAssertionFailure' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 21843
    Error C4013 'DbgRaiseAssertionFailure' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 21843
    Error C4013 'InterlockedExchangePointer' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 30822
    Error C4013 'InterlockedExchangePointer' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 30822
    Error C4013 'InterlockedExchangePointer' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 30822
    Error C4013 'MemoryBarrier' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 19381
    Error C4013 'MemoryBarrier' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 19381
    Error C4013 'MemoryBarrier' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 19381
    Error C4013 'UnsignedMultiplyHigh' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 12756
    Error C4013 'UnsignedMultiplyHigh' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 12756
    Error C4013 'UnsignedMultiplyHigh' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 12756
    Error C4013 '_DataSynchronizationBarrier' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 18945
    Error C4013 '_DataSynchronizationBarrier' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 18945
    Error C4013 '_DataSynchronizationBarrier' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 18945
    Error C4013 '__readx18dword' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 19349
    Error C4013 '__readx18dword' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 19349
    Error C4013 '__readx18dword' undefined; assuming extern returning int KMDF Driver1 C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\km\wdm.h 19349


    Does the driver development tool supports ARM64 yet? Or something I should install first?
    Friday, July 28, 2017 2:55 AM

All replies

  • Check your project settings, and look at what the values are predefined.   The code to define DbgRaiseAssertionFailure for instance is in there, see below:
    #elif defined(_ARM64_)
    
    #if defined(_M_ARM64)
    
    void
    __break(
        _In_ int Code
        );
    
    #pragma intrinsic (__break)
    
    #if !defined(_PREFAST_)
    
    #define DbgRaiseAssertionFailure() __break(0xf001)
    
    #endif // !defined(_PREFAST_)
    
    #endif // defined(_M_ARM64)
    


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Friday, July 28, 2017 11:12 AM
  • Dear Don Burn

    I has checked the file "winnt.h" and found the definition. However, even I add the definition _M_ARM64 to the project predefine. The same errors occurs.

    And, I also notice the file "winnt.h" is located in the path " C:\Programe Files(x86)\Windows Kit\10\Include\10.0.15063.0\um ". Looks like the "um" is for user mode. But the code I used is kernel mode. 

    Could you give a help to setup visual studio 2015 for ARM64? I think create NEW project with "Kernel Mode driver (KMDF)" can easily to see this problem. I would like to compile a NEW one first to make sure MSFT development tool really can support ARM64.

    B.R.

    Caro Lin


    • Edited by Caro Lin Tuesday, August 1, 2017 6:57 AM
    Tuesday, August 1, 2017 2:59 AM