NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/54581: Issues building NetBSD-9 under NetBSD-5.2

>Number:         54581
>Category:       misc
>Synopsis:       Various issues trying to build release NetBSD-9 under NetBSD-5.2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 27 19:55:00 +0000 2019
>Originator:     Brian Buhrow
>Release:        NetBSD 5.2_STABLE
	NFB of California
System: NetBSD 5.2_STABLE NetBSD 5.2_STABLE (RBL) #0: Thu Mar 27 10:15:56 PDT 2014 i386
Architecture: i386
Machine: i386
I'm trying to build release, using, NetBSD-9 hosted on a
NetBSD-5.2 system.  I'm running into various build errors.  I'm not sure if
I should file a bug for each error, or just document them here.  I'm also
creating patches which can be committed to head to correct these issues.
I'm assuming, I think correctly, that if I'm having these issues with
NetBSD-9, -current will encounter the same issues.  NetBSD-8 builds fine
under NetBSD-5.2.

Run on  a NetBSD-9 source tree on a system running NetBSD-5.2.
The sample command I'm using is:

./ -m amd64 -D /var/tmp/netbsd-90-64 -O /usr/local/netbsd/obj-64 -j 2 release


For the first issue, under NetBSD-5.2, __CTASSERT() is not defined in
/usr/include/sys/cdefs.h, as it is under NetBSD-6 and later.  This causes
the ctf suite of tools not to build.  The patch below corrects this problem
and allows the ctf tools to build.

Is this the proper approach to fixing these kinds of issues?  If so, should
I commit these fixes once the build is working successfully?

Index: debug.h
RCS file: /cvsroot/src/external/cddl/osnet/dist/uts/common/sys/debug.h,v
retrieving revision 1.4
diff -u -r1.4 debug.h
--- debug.h	28 May 2018 21:05:07 -0000	1.4
+++ debug.h	27 Sep 2019 19:40:24 -0000
@@ -134,8 +134,14 @@
 #define	_CTASSERT(x, y)		__CTASSERT(x, y)
 #ifndef __CTASSERT
+#if (defined(__NetBSD_Version__) && __NetBSD_Version__ < 600000000)
+#define	__CTASSERT(x)		__CTASSERT0(x, __ctassert, __LINE__)
+#define	__CTASSERT0(x, y, z)	__CTASSERT1(x, y, z)
+#define	__CTASSERT1(x, y, z)	typedef char y ## z[/*CONSTCOND*/(x) ? 1 : -1]
 #define	__CTASSERT(x, y) \
 	typedef char __compile_time_assertion__ ## y [(x) ? 1 : -1]
+#endif /*__NetBSD__*/
 #ifdef	_KERNEL


Home | Main Index | Thread Index | Old Index