connectal icon indicating copy to clipboard operation
connectal copied to clipboard

build error on x86, file dmaSendFd.h, line 85

Open chenm001 opened this issue 9 years ago • 8 comments

The addr is 32bits in x86 platform, the sg_phys() return dma_addr_t, it is mismatch to 'long'

chenm001 avatar Jan 17 '16 16:01 chenm001

can you post the error message?

hanw avatar Jan 17 '16 17:01 hanw

Are you sure that addr is 32 bits on x86? we always run 64-bit versions, so seems peculiar.

In addition, I am accustomed to sizeof(long) == sizeof(void *), for example, see the last line of the next-to-last paragraph of: http://www.makelinux.net/ldd3/chp-11-sect-1 ( was looking for this in the c std, but can't find similar text... :-( )

Thanks jca

On Sun, Jan 17, 2016 at 9:00 AM, Han Wang [email protected] wrote:

can you post the error message?

— Reply to this email directly or view it on GitHub https://github.com/cambridgehackers/connectal/issues/106#issuecomment-172353097 .

jankcorn avatar Jan 17 '16 17:01 jankcorn

Below is error message, the problem is Shift 32 bits and OR with addr btw: the dma_addr_t defined in Linux header, so it maybe 32 or 64bits depends OS configure.


prepare_bin_target ubuntu.exe cc1plus: warnings being treated as errors In file included from /chen/connectal/cpp/dmaManager.c:35: /chen/connectal/cpp/dmaSendFd.h: In function int send_fd_to_portal(PortalInternal_, int, int, int): /chen/connectal/cpp/dmaSendFd.h:85: error: left shift count >= width of type make[2]: *_* [ubuntu.exe] Error 1 make[1]: *** [ubuntu.exe] Error 2 make: *** [build.bluesim] Error 2 rhel:/connectal/examples/echo# ************* END **************************************

At 2016-01-18 01:18:10,jankcorn [email protected] wrote: Are you sure that addr is 32 bits on x86? we always run 64-bit versions, so seems peculiar.

In addition, I am accustomed to sizeof(long) == sizeof(void *), for example, see the last line of the next-to-last paragraph of: http://www.makelinux.net/ldd3/chp-11-sect-1 ( was looking for this in the c std, but can't find similar text... :-( )

Thanks jca

On Sun, Jan 17, 2016 at 9:00 AM, Han Wang [email protected] wrote:

can you post the error message?

— Reply to this email directly or view it on GitHub https://github.com/cambridgehackers/connectal/issues/106#issuecomment-172353097 .

— Reply to this email directly or view it on GitHub.

chenm001 avatar Jan 18 '16 05:01 chenm001

I see. This is code only for simulations. It appears that simulation builds (xsim, bluesim, modelsim, verilator) have to be run on 64-bit architectures (which, in practice, are always x86).

I would highly recommend switching to a machine with a 64-bit OS. (since the 32 bit os can't address much memory anyway for simulation...)

Is that possible? jca

On Sun, Jan 17, 2016 at 9:54 PM, chenm001 [email protected] wrote:

Below is error message, the problem is Shift 32 bits and OR with addr btw: the dma_addr_t defined in Linux header, so it maybe 32 or 64bits depends OS configure.


prepare_bin_target ubuntu.exe cc1plus: warnings being treated as errors In file included from /chen/connectal/cpp/dmaManager.c:35: /chen/connectal/cpp/dmaSendFd.h: In function int send_fd_to_portal(PortalInternal_, int, int, int): /chen/connectal/cpp/dmaSendFd.h:85: error: left shift count >= width of type make[2]: *_* [ubuntu.exe] Error 1 make[1]: *** [ubuntu.exe] Error 2 make: *** [build.bluesim] Error 2 rhel:/connectal/examples/echo# ************* END **************************************

At 2016-01-18 01:18:10,jankcorn [email protected] wrote: Are you sure that addr is 32 bits on x86? we always run 64-bit versions, so seems peculiar.

In addition, I am accustomed to sizeof(long) == sizeof(void *), for example, see the last line of the next-to-last paragraph of: http://www.makelinux.net/ldd3/chp-11-sect-1 ( was looking for this in the c std, but can't find similar text... :-( )

Thanks jca

On Sun, Jan 17, 2016 at 9:00 AM, Han Wang [email protected] wrote:

can you post the error message?

— Reply to this email directly or view it on GitHub < https://github.com/cambridgehackers/connectal/issues/106#issuecomment-172353097

.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/cambridgehackers/connectal/issues/106#issuecomment-172432676 .

jankcorn avatar Jan 18 '16 16:01 jankcorn

I feel like I'm hearing half of a phone conversation.

@chenm001, it would be possible to put together a simulation configuration that supports 32-bit x86, but I agree with @jankcorn that it would be better to switch to 64-bit x86. Because who knows how many other places we assumed x86 was 64bit.

jameyhicks avatar Jan 18 '16 17:01 jameyhicks

Agree, for really world, we may use x64 OS. In simluate enviorment, I simple workaround by modify local to 'uint64_t addr;'

chenm001 avatar Jan 22 '16 12:01 chenm001

If that change works, I think we could update dmaSendFd.h accordingly.

We do not have any 32-bit x86 systems to test with, so please let us know if any other changes are required.

On Fri, Jan 22, 2016 at 7:38 AM chenm001 [email protected] wrote:

Agree, for really world, we may use x64 OS. In simluate enviorment, I simple workaround by modify local to 'uint64_t addr;'

— Reply to this email directly or view it on GitHub https://github.com/cambridgehackers/connectal/issues/106#issuecomment-173909667 .

jameyhicks avatar Jan 22 '16 14:01 jameyhicks

I will do more test and let you know later

At 2016-01-22 22:22:07,"Jamey Hicks" [email protected] wrote: If that change works, I think we could update dmaSendFd.h accordingly.

We do not have any 32-bit x86 systems to test with, so please let us know if any other changes are required.

On Fri, Jan 22, 2016 at 7:38 AM chenm001 [email protected] wrote:

Agree, for really world, we may use x64 OS. In simluate enviorment, I simple workaround by modify local to 'uint64_t addr;'

— Reply to this email directly or view it on GitHub https://github.com/cambridgehackers/connectal/issues/106#issuecomment-173909667 .

— Reply to this email directly or view it on GitHub.

chenm001 avatar Jan 22 '16 14:01 chenm001