NetBSD-Bugs archive

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

Re: toolchain/51118: libctf tools build fails on FreeBSD 10.3-RELEASE



The following reply was made to PR toolchain/51118; it has been noted by GNATS.

From: Michael Plass <mfpnb%plass-family.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: Michael Plass <mfpnb%plass-family.net@localhost>,
 Jared McNeill <jmcneill%invisible.ca@localhost>,
 Nick Hudson <skrll%netbsd.org@localhost>
Subject: Re: toolchain/51118: libctf tools build fails on FreeBSD 10.3-RELEASE
Date: Mon, 16 May 2016 13:17:25 -0700

 I was just about to submit a report for this problem, when I found =
 toolchain/51118.
 
 Patch included below.
 
 
 >Release:
         NetBSD-7.99.29
 
 >Environment:
 
 FreeBSD home.plass-family.net 8.4-RELEASE-p35 FreeBSD 8.4-RELEASE-p35 =
 #0: Tue Jul 28 10:55:26 UTC 2015     =
 root%amd64-builder.daemonology.net@localhost:/usr/obj/usr/src/sys/GENERIC  amd64
 
 
 >Description:
 
 When building netbsd-current on a FreeBSD-8.4 host, the build fails in =
 the tool stage.
 
 build.sh command:    ./build.sh -U -m evbarm -a earmv7hf -u release
 
 Building this way works for netbsd-7. I have not tested on a newer =
 version of freebsd, but the root
 cause appears to be present in all supported freebsd versions (version 8 =
 is past its EOL by a bit).
 
 
 First error:
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
                 from =
 /space/ws/netbsd/usr/src/tools/libctf/../../external/cddl/osnet/dist/commo=
 n/ctf/ctf_create.c:23:
 /space/ws/netbsd/usr/src/tools/libctf/../compat/compat_defs.h:665:2: =
 error: #error "Don't know how to define SCN[diouxX]8"
 /space/ws/netbsd/usr/src/tools/libctf/../compat/compat_defs.h:712:2: =
 error: #error "Don't know how to define SCN[diouxX]16"
 /space/ws/netbsd/usr/src/tools/libctf/../compat/compat_defs.h:797:2: =
 error: #error "Don't know how to define SCN[diouxX]32"
 /space/ws/netbsd/usr/src/tools/libctf/../compat/compat_defs.h:882:2: =
 error: #error "Don't know how to define SCN[diouxX]64"
 
 *** Failed target:  ctf_create.lo
 *** Failed command: cc -O -DCTF_OLD_VERSIONS =
 -I/space/ws/netbsd/usr/src/tools/libctf/../compat =
 -I/space/ws/netbsd/usr/src/tools/libctf/../../external/cddl/osnet/sys =
 -I/space/ws/netbsd/usr/src/tools/libctf/../../external/cddl/osnet/include =
 -I/space/ws/netbsd/usr/src/tools/libctf/../../external/cddl/osnet/dist/hea=
 d =
 -I/space/ws/netbsd/usr/src/tools/libctf/../../external/cddl/osnet/dist/com=
 mon/ctf =
 -I/space/ws/netbsd/usr/src/tools/libctf/../../external/cddl/osnet/dist/lib=
 /libctf/common =
 -I/space/ws/netbsd/usr/src/tools/libctf/../../external/cddl/osnet/dist/uts=
 /common =
 -I/space/ws/netbsd/usr/src/tools/libctf/../../external/bsd/elftoolchain/di=
 st/libelf -DHAVE_NBTOOL_CONFIG_H=3D1 -D_FILE_OFFSET_BITS=3D64 =
 -I/space/ws/netbsd/usr/src/obj/tooldir.FreeBSD-8.4-RELEASE-p35-amd64/inclu=
 de/compat -I/space/ws/netbsd/usr/src/tools/compat =
 -DHAVE_NBTOOL_CONFIG_H=3D1 -D_FILE_OFFSET_BITS=3D64 =
 -I/space/ws/netbsd/usr/src/obj/tooldir.FreeBSD-8.4-RELEASE-p35-amd64/inclu=
 de -I/space/ws/netbsd/usr/src/obj/tooldir.F!
 reeBSD-8.
 4-RELEASE-p35-amd64/include/nbinclude -c -o ctf_create.lo.o =
 /space/ws/netbsd/usr/src/tools/libctf/../../external/cddl/osnet/dist/commo=
 n/ctf/ctf_create.c
 *** Error code 1
 
 Stop.
 nbmake[3]: stopped in /space/ws/netbsd/usr/src/tools/libctf
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 
 
 When this error is fixed, a second problem occurs later in the build:
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 =
 /space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist/too=
 ls/ctf/cvt/ctfmerge.c:322:24: error: macro "__assert" passed 4 =
 arguments, but takes just 3
 =
 /space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist/too=
 ls/ctf/cvt/ctfmerge.c:369:36: error: macro "__assert" passed 4 =
 arguments, but takes just 3
 =
 /space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist/too=
 ls/ctf/cvt/ctfmerge.c:381:54: error: macro "__assert" passed 4 =
 arguments, but takes just 3
 =
 /space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist/too=
 ls/ctf/cvt/ctfmerge.c:441:21: error: macro "__assert" passed 4 =
 arguments, but takes just 3
 =
 /space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist/too=
 ls/ctf/cvt/ctfmerge.c:973:35: error: macro "__assert" passed 4 =
 arguments, but takes just 3
 
 *** Failed target:  ctfmerge.lo
 *** Failed command: cc -O -pthread =
 -I/space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/sys =
 -I/space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/includ=
 e =
 -I/space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist =
 -I/space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist/h=
 ead =
 -I/space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist/t=
 ools/ctf/common =
 -I/space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist/t=
 ools/ctf/cvt =
 -I/space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist/u=
 ts/common =
 -I/space/ws/netbsd/usr/src/tools/ctfmerge/../../external/bsd/elftoolchain/=
 dist/libelf =
 -I/space/ws/netbsd/usr/src/tools/ctfmerge/../../external/bsd/elftoolchain/=
 distlibdwarf -DHAVE_NBTOOL_CONFIG_H=3D1 =
 -I/space/ws/netbsd/usr/src/obj/tooldir.FreeBSD-8.4-RELEASE-p35-amd64/inclu=
 de =
 -I/space/ws/netbsd/usr/src/obj/tooldir.FreeBSD-8.4-RELEASE-p35-amd64/inclu=
 de/nbinclude =
 -I/space/ws/netbsd/usr/src/obj/tooldir.FreeBSD-8.4-RELEASE-p35-amd64/inclu=
 de/compat -I/space/ws/netbsd/usr/src/tools/compat =
 -DHAVE_NBTOOL_CONFIG_H=3D1 -D_FILE_OFFSET_BITS=3D64 -Wno-unknown-pragmas =
 -Wno-sign-compare -D_KERNTYPES =
 -I/space/ws/netbsd/usr/src/external/cddl/osnet/sys =
 -I/space/ws/netbsd/usr/src/external/cddl/osnet/include =
 -I/space/ws/netbsd/usr/src/external/cddl/osnet/dist =
 -I/space/ws/netbsd/usr/src/external/cddl/osnet/dist =
 -I/space/ws/netbsd/usr/src/external/cddl/osnet/dist/head =
 -I/space/ws/netbsd/usr/src/external/cddl/osnet/dist/tools/ctf/common =
 -I/space/ws/netbsd/usr/src/external/cddl/osnet/dist/tools/ctf/cvt =
 -I/space/ws/netbsd/usr/src/external/cddl/osnet/dist/uts/common =
 -D_KERNTYPES -c -o ctfmerge.lo.o =
 /space/ws/netbsd/usr/src/tools/ctfmerge/../../external/cddl/osnet/dist/too=
 ls/ctf/cvt/ctfmerge.c
 *** Error code 1
 
 Stop.
 nbmake[7]: stopped in /space/ws/netbsd/usr/src/tools/ctfmerge
 
 *** Failed target:  dependall
 *** Failed command: cd "/space/ws/netbsd/usr/src/tools/ctfmerge"; =
 /space/ws/netbsd/usr/src/obj/tooldir.FreeBSD-8.4-RELEASE-p35-amd64/bin/nbm=
 ake realall
 *** Error code 1
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 
 
 The first error happens because during the bootstrap the include for =
 <sys/limits.h> is resolved to
 external/cddl/osnet/sys/sys/limits.h instead of =
 /usr/include/sys/limits.h, and on freebsd, <limits.h>
 depends on <sys/limits.h> to define constants such a UCHAR_MAX. This =
 breaks the attempt that
 tools/compat/compat_defs.h makes to define any missing PRT* and SCN* =
 print format macros.
 
 The second is because of a conflict between the defined 3-argument =
 __assert macro and freebsd's 4-argument
 __assert function.
 
 This patch fixes both of these problems for me:
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 diff --git a/external/cddl/osnet/sys/assert.h =
 b/external/cddl/osnet/sys/assert.h
 index 5c3eb18..8f303f2 100644
 --- a/external/cddl/osnet/sys/assert.h
 +++ b/external/cddl/osnet/sys/assert.h
 @@ -30,7 +30,3 @@
   */
 =20
  #include_next "assert.h"
 -
 -#ifndef __assert
 -#define __assert(a, b, c)       __assert(a, c, b)
 -#endif
 diff --git a/external/cddl/osnet/sys/sys/limits.h =
 b/external/cddl/osnet/sys/sys/limits.h
 index accc2fe..66fe9f0 100644
 --- a/external/cddl/osnet/sys/sys/limits.h
 +++ b/external/cddl/osnet/sys/sys/limits.h
 @@ -29,4 +29,8 @@
   * POSSIBILITY OF SUCH DAMAGE.
   */
 =20
 +#if defined(__FreeBSD__)
 +#include_next <sys/limits.h>
 +#endif
 +
  #include <sys/syslimits.h>
 diff --git a/tools/compat/compat_defs.h b/tools/compat/compat_defs.h
 index 6e8e082..c4f4939 100644
 --- a/tools/compat/compat_defs.h
 +++ b/tools/compat/compat_defs.h
 @@ -41,6 +41,9 @@
  #include <errno.h>
  #include <fcntl.h>
  #include <limits.h>
 +#ifndef UCHAR_MAX
 +#error "oops, UCHAR_MAX should be defined by now"
 +#endif
  #include <paths.h>
  #include <stdarg.h>
  #include <stdio.h>
 
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 
 Notes:
 In my patch, I did away completely with the compatibility macro for =
 __assert.
 There is only one place I found that might use it, which is
 external/cddl/osnet/dist/lib/libuutil/common/uu_misc.c;
 apparently this code is not even compiled, since it does not show
 up in the build log.
 
 The guard on the #include_next is needed so that the second compilation =
 later on will
 succeed; I'm sure that there is a better test than looking for =
 __FreeBSD__, but
 it works for me.
 
 The change to compat_defs.h is not really needed, of course.
 
 With the patch:
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 make release started at:  Sun May 15 20:59:30 PDT 2016
 make release finished at: Mon May 16 01:20:09 PDT 2016
 =3D=3D=3D> Successful make release
 =3D=3D=3D> build.sh ended:      Mon May 16 01:20:09 PDT 2016
 =3D=3D=3D> Summary of results:
 	 build.sh command:    ./build.sh -U -m evbarm -a earmv7hf -u =
 release
 	 build.sh started:    Sun May 15 20:59:28 PDT 2016
 	 NetBSD version:      7.99.29
 	 MACHINE:             evbarm
 	 MACHINE_ARCH:        earmv7hf
 	 Build platform:      FreeBSD 8.4-RELEASE-p35 amd64
 	 HOST_SH:             /bin/sh
 	 MAKECONF file:       /etc/mk.conf (File not found)
 	 TOOLDIR path:        =
 /space/ws/netbsd/usr/src/obj/tooldir.FreeBSD-8.4-RELEASE-p35-amd64
 	 DESTDIR path:        =
 /space/ws/netbsd/usr/src/obj/destdir.evbarm
 	 RELEASEDIR path:     /space/ws/netbsd/usr/src/obj/releasedir
 	 Updated makewrapper: =
 /space/ws/netbsd/usr/src/obj/tooldir.FreeBSD-8.4-RELEASE-p35-amd64/bin/nbm=
 ake-evbarm
 	 Successful make release
 	 build.sh ended:      Mon May 16 01:20:09 PDT 2016
 =3D=3D=3D> .
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 
 - Michael
 



Home | Main Index | Thread Index | Old Index