Hi,
Thanks everyone for your help you were all provided by answering standard questions on this forum.
I seems like run into not-very standard issue and I would appreciate a help with this.
I'm developing an application polling kernel information like memory, cpu, disks load, etc and I want to be able to compile this library for bot i386 and x64 from OS x64 build.
Application builds just fine for i386 on i386, and for x64 on x64, but I want to keep one instance of FreeBSD and make cross-compilation for both platforms.
I made a search and tried a solution suggested at another thread http://forums.freebsd.org/showthread.php?t=14400, but it didn't help.
In case if compilation is done with fully custom include dirs:
Than the trouble is that compiler can't find files, that are included by standard headers:
In case if header files paths are standard, the trouble is with C type's sizes:
It seems like kernel dependable application needs something more complicated than just a compiler flags - any help with finding a right way would be much appreciated.
Thanks.
Thanks everyone for your help you were all provided by answering standard questions on this forum.
I seems like run into not-very standard issue and I would appreciate a help with this.
I'm developing an application polling kernel information like memory, cpu, disks load, etc and I want to be able to compile this library for bot i386 and x64 from OS x64 build.
Application builds just fine for i386 on i386, and for x64 on x64, but I want to keep one instance of FreeBSD and make cross-compilation for both platforms.
I made a search and tried a solution suggested at another thread http://forums.freebsd.org/showthread.php?t=14400, but it didn't help.
In case if compilation is done with fully custom include dirs:
Code:
CFLAGS += -m32 -march=i686 -mmmx -msse -msse2 -mfancy-math-387 -DCOMPAT_32BIT -L/usr/lib32 -B/usr/lib32 -I/usr/src/sys/i386/include -I/usr/src/sys -I. -nostdinc
Than the trouble is that compiler can't find files, that are included by standard headers:
Code:
In file included from sysinfo-bsd.c:1:
/usr/src/sys/sys/types.h:44:28: error: machine/endian.h: No such file or directory
In file included from /usr/src/sys/sys/types.h:45,
from sysinfo-bsd.c:1:
/usr/src/sys/sys/_types.h:33:28: error: machine/_types.h: No such file or directory
In case if header files paths are standard, the trouble is with C type's sizes:
Code:
In file included from /usr/include/machine/proc.h:36,
from /usr/include/sys/proc.h:66,
from sysinfo-bsd.c:14:
/usr/include/machine/segments.h:96: error: width of 'sd_hibase' exceeds its type
/usr/include/machine/segments.h:114: error: width of 'gd_hioffset' exceeds its type
/usr/include/machine/segments.h:184: error: width of 'rd_base' exceeds its type
*** Error code 1
It seems like kernel dependable application needs something more complicated than just a compiler flags - any help with finding a right way would be much appreciated.
Thanks.