[openib-general] compilation platform dependencies

yipee yipeeyipeeyipeeyipee at yahoo.com
Tue Nov 1 09:39:37 PST 2005


Hi,


I think that I've noticed a problem in compiling user applications with a 
different compiler than the running-kernel modules compiler (x86 32bit vs. 
64bit). For compiling an openib application on a 32bit x86 and running it on a 
64bit AMD Opteron.
When compiling a program with a 32bit gcc, the sizeof(struct cm_abi_event_resp) 
was 184 bytes (written to the kernel from ib_cm_get_event()) vs. the 192 bytes 
resulting from a x86_64 compiler.
When ucm's ib_ucm_event() compares the sizeof() of the received cmd/buffer to 
sizeof(struct ib_ucm_event_resp) it finds a mismatch and returns -ENOSPC.

Notice that 32bit applications are allowed to run on a x86_64.
I can see two fixes to this issue:
1. Disallow 32bit applications to use 64bit kernel modules and warn about it at 
run-time.
2. Specifiy gcc packing pragmas for user/kernel communication structures in 
header files.

Any comments?
Thanks,
y








More information about the general mailing list