Cross compiling NetBSD current
Hi All, I am working on Compressed Cache project for NetBSD ( https://wiki.netbsd.org/projects/project/compressed-cache/) . I am trying to set up the cross compilation environment for NetBSD current. Copying tech-kern in this email since my emails to current-users seems to be not getting delivered). Host machine (where I am compiling): Ubuntu(64-bit) running on x86_64 Target architecture (where I intend to boot NetBSD): amd64 I am trying to compile tools using build.sh. Command used: /build.sh -U -m amd64 tools I see a bunch of compiler errors saying compilation terminated since a file was not found (#include sys/disk.h fails with file not found). Eventually the build fails with message ERROR: Failed to make build_install in tools. Attaching the last few lines of the build log. I was able to cross compile 6-1-4 release branch. hence I am guessing that I have all the necessary tools installed properly. Any help will be helpful and greatly appreciated. Thanks, Vinay /usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/bin/nbhost-mkdep -f biosboot.d.tmp -- -I/usr/NetBSD_Current/tools/gpt -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/nbinclude -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/compat -I/usr/NetBSD_Current/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 /usr/NetBSD_Current/tools/gpt/../../sbin/gpt/biosboot.c mv biosboot.d.tmp biosboot.d /usr/NetBSD_Current/tools/gpt/../../sbin/gpt/biosboot.c:46:22: fatal error: sys/disk.h: No such file or directory #include sys/disk.h ^ compilation terminated. #create gpt/create.d /usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/bin/nbhost-mkdep -f create.d.tmp -- -I/usr/NetBSD_Current/tools/gpt -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/nbinclude -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/compat -I/usr/NetBSD_Current/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 /usr/NetBSD_Current/tools/gpt/../../sbin/gpt/create.c mv create.d.tmp create.d #create gpt/dehumanize_number.d /usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/bin/nbhost-mkdep -f dehumanize_number.d.tmp -- -I/usr/NetBSD_Current/tools/gpt -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/nbinclude -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/compat -I/usr/NetBSD_Current/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 /usr/NetBSD_Current/tools/gpt/../../lib/libc/gen/dehumanize_number.c mv dehumanize_number.d.tmp dehumanize_number.d #create gpt/destroy.d /usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/bin/nbhost-mkdep -f destroy.d.tmp -- -I/usr/NetBSD_Current/tools/gpt -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/nbinclude -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/compat -I/usr/NetBSD_Current/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 /usr/NetBSD_Current/tools/gpt/../../sbin/gpt/destroy.c mv destroy.d.tmp destroy.d #create gpt/gpt.d /usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/bin/nbhost-mkdep -f gpt.d.tmp -- -I/usr/NetBSD_Current/tools/gpt -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/nbinclude -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/compat -I/usr/NetBSD_Current/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 /usr/NetBSD_Current/tools/gpt/../../sbin/gpt/gpt.c mv gpt.d.tmp gpt.d /usr/NetBSD_Current/tools/gpt/../../sbin/gpt/gpt.c:43:22: fatal error: sys/disk.h: No such file or directory #include sys/disk.h ^ compilation terminated. #create gpt/gpt_uuid.d /usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/bin/nbhost-mkdep -f gpt_uuid.d.tmp -- -I/usr/NetBSD_Current/tools/gpt -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/nbinclude -I/usr/NetBSD_Current/obj/tooldir.Linux-3.11.0-12-generic-x86_64/include/compat -I/usr/NetBSD_Current/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 /usr/NetBSD_Current/tools/gpt/../../sbin/gpt/gpt_uuid.c mv gpt_uuid.d.tmp gpt_uuid.d #create gpt/label.d
Re: CTLTYPE_UINT?
On Fri, 03 Oct 2014, Justin Cormack wrote: Back in the sysctl discussion a while back, core group said: http://mail-index.netbsd.org/tech-kern/2014/03/26/msg016779.html a) What types are needed? Currently, CTLTYPE_INT is a signed 32-bit type, and CTLTYPE_QUAD is an unsigned 64-bit type. Perhaps all four possible combinations of signed/unsigned and 32 bits/64 bits should be supported. If you add new sysctl types, please use names that describe the size and signedness. For example, rename CTLTYPE_INT to CTLTPE_INT32, keep CTLTYPE_INT as a backward compatible alias for CTLTYPE_INT32, and add CTLTYPE_UINT32. Similarly, rename CTLTYPE_QUAD to CTLTYPE_UINT64, keep CTLTYPE_QUAD as an alias, and add CTLTYPE_INT64. Please don't add a CTLTYPE_UINT with no indication of its size. A survey of what other OSes do would also be useful. --apb (Alan Barrett)
Re: Cross compiling NetBSD current
On Fri, Oct 03, 2014 at 10:20:28PM -0400, Vinaykumar Bhat wrote: Hi All, I am working on Compressed Cache project for NetBSD ( https://wiki.netbsd.org/projects/project/compressed-cache/) . I am trying to set up the cross compilation environment for NetBSD current. Copying tech-kern in this email since my emails to current-users seems to be not getting delivered). Host machine (where I am compiling): Ubuntu(64-bit) running on x86_64 Target architecture (where I intend to boot NetBSD): amd64 I am trying to compile tools using build.sh. Command used: /build.sh -U -m amd64 tools I see a bunch of compiler errors saying compilation terminated since a file was not found (#include sys/disk.h fails with file not found). Eventually the build fails with message ERROR: Failed to make build_install in tools. Attaching the last few lines of the build log. I was able to cross compile 6-1-4 release branch. hence I am guessing that I have all the necessary tools installed properly. Any help will be helpful and greatly appreciated. How old are your sources ? There have been some fixes to tool build in gpt yesterday. -- Manuel Bouyer bou...@antioche.eu.org NetBSD: 26 ans d'experience feront toujours la difference --
Re: Cross compiling NetBSD current
Thanks! Works fine with the latest check out. -Vinay On Oct 4, 2014 5:00 AM, Manuel Bouyer bou...@antioche.eu.org wrote: On Fri, Oct 03, 2014 at 10:20:28PM -0400, Vinaykumar Bhat wrote: Hi All, I am working on Compressed Cache project for NetBSD ( https://wiki.netbsd.org/projects/project/compressed-cache/) . I am trying to set up the cross compilation environment for NetBSD current. Copying tech-kern in this email since my emails to current-users seems to be not getting delivered). Host machine (where I am compiling): Ubuntu(64-bit) running on x86_64 Target architecture (where I intend to boot NetBSD): amd64 I am trying to compile tools using build.sh. Command used: /build.sh -U -m amd64 tools I see a bunch of compiler errors saying compilation terminated since a file was not found (#include sys/disk.h fails with file not found). Eventually the build fails with message ERROR: Failed to make build_install in tools. Attaching the last few lines of the build log. I was able to cross compile 6-1-4 release branch. hence I am guessing that I have all the necessary tools installed properly. Any help will be helpful and greatly appreciated. How old are your sources ? There have been some fixes to tool build in gpt yesterday. -- Manuel Bouyer bou...@antioche.eu.org NetBSD: 26 ans d'experience feront toujours la difference --
Re: CTLTYPE_UINT?
On Sat, Oct 4, 2014 at 9:24 AM, Alan Barrett a...@cequrux.com wrote: On Fri, 03 Oct 2014, Justin Cormack wrote: Back in the sysctl discussion a while back, core group said: http://mail-index.netbsd.org/tech-kern/2014/03/26/msg016779.html a) What types are needed? Currently, CTLTYPE_INT is a signed 32-bit type, and CTLTYPE_QUAD is an unsigned 64-bit type. Perhaps all four possible combinations of signed/unsigned and 32 bits/64 bits should be supported. If you add new sysctl types, please use names that describe the size and signedness. For example, rename CTLTYPE_INT to CTLTPE_INT32, keep CTLTYPE_INT as a backward compatible alias for CTLTYPE_INT32, and add CTLTYPE_UINT32. Similarly, rename CTLTYPE_QUAD to CTLTYPE_UINT64, keep CTLTYPE_QUAD as an alias, and add CTLTYPE_INT64. Please don't add a CTLTYPE_UINT with no indication of its size. A survey of what other OSes do would also be useful. Freebsd (and Dragonfly): CTLTYPE_NODEThis is a node intended to be a parent for other nodes. CTLTYPE_INT This is a signed integer. CTLTYPE_STRING This is a nul-terminated string CTLTYPE_S64 This is a 64-bit signed integer. CTLTYPE_OPAQUE This is an opaque data structure. CTLTYPE_STRUCT Alias for CTLTYPE_OPAQUE. CTLTYPE_UINTThis is an unsigned integer. CTLTYPE_LONGThis is a signed long. CTLTYPE_ULONG This is an unsigned long. CTLTYPE_U64 This is a 64-bit unsigned integer. OpenBSD has the same types as NetBSD, ie CTLTYPE_INT and CTLTYPE_QUAD as the int32 and uint64 types. I agree about being explicit with the 32 bitness, but using S64 and U64 as the 64 bit names to be consistent with FreeBSD might make sense. long types seems best avoided if possible, you can see the temptation to use them for memory amounts, but you could be running on 32 bit userspace on a 64 bit kernel. Justin