Skip to content

64 bit linux make issue solution  #2

@muratbedir

Description

@muratbedir

If you face while, make like below error (compile ederken aşağıdaki gibi bir hata alırsanız)

ft8.cpp:271:21: error: cast from ‘unsigned char*’ to ‘unsigned int’ loses precision [-fpermissive]
271 | vAddr = (void)(((unsigned)mbox.virt_addr) + offset);
| ^~~~~~~~~~~~~~~~~~~~~~~~
ft8.cpp:271:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
271 | vAddr = (void)(((unsigned)mbox.virt_addr) + offset);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ft8.cpp:272:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
272 | bAddr = (void)(((unsigned)mbox.bus_addr) + offset);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

this caused by host operating system is 64 bit code designed for 32 bit (nedeni code 32 bit için dizayn edilmiş ama 64 bit os te complie ediyorsunuz)

easily patch ft8.cpp line 271 and 271 with (ft8.cpp deki 271 ve 272 satırı nı solution ile değiştirin)

🔍 Problematic Code (sould be deleted or remarked with //

vAddr = (void)(((unsigned)mbox.virt_addr) + offset);
bAddr = (void)(((unsigned)mbox.bus_addr) + offset);

🛠️ Solution - update with below code

Update your code like this:

#include // or <stdint.h> for C-style

vAddr = (void)((uintptr_t)(mbox.virt_addr) + offset);
bAddr = (void)((uintptr_t)(mbox.bus_addr) + offset);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions