Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Sep 2012 10:17:14 GMT
From:      Schaich@FreeBSD.org, Alonso <alonsoschaich@fastmail.fm>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/171704: hastd fails to build
Message-ID:  <201209171017.q8HAHEUE031802@red.freebsd.org>
Resent-Message-ID: <201209171020.q8HAK8CY036684@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         171704
>Category:       misc
>Synopsis:       hastd fails to build
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 17 10:20:08 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Schaich, Alonso
>Release:        9-STABLE
>Organization:
>Environment:
FreeBSD moonshine.localnet.edu 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0: Fri Sep  7 19:23:36 CEST 2012     root@moonshine.localnet.edu:/usr/obj/usr/src/sys/NODEBUG  amd64
>Description:
When buildworld runs into sbin/hastd it fails building primary.c:

clang -O2 -pipe  -I/usr/src/sbin/hastd -DHAVE_CAPSICUM -DPROTO_TCP_DEFAULT_PORT=8457 -DINET -DINET6 -DHAVE_CRYPTO -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-format -c /usr/src/sbin/hastd/primary.c
/usr/src/sbin/hastd/primary.c:553:27: error: variable has incomplete type 'struct g_gate_ctl_modify'
        struct g_gate_ctl_modify ggiomodify;
                                 ^
/usr/src/sbin/hastd/primary.c:553:9: note: forward declaration of 'struct g_gate_ctl_modify'
        struct g_gate_ctl_modify ggiomodify;
               ^
/usr/src/sbin/hastd/primary.c:558:27: error: use of undeclared identifier 'GG_MODIFY_READPROV'
        ggiomodify.gctl_modify = GG_MODIFY_READPROV | GG_MODIFY_READOFFSET;
                                 ^
/usr/src/sbin/hastd/primary.c:558:48: error: use of undeclared identifier 'GG_MODIFY_READOFFSET'
        ggiomodify.gctl_modify = GG_MODIFY_READPROV | GG_MODIFY_READOFFSET;
                                                      ^
/usr/src/sbin/hastd/primary.c:562:29: error: use of undeclared identifier 'G_GATE_CMD_MODIFY'
        if (ioctl(res->hr_ggatefd, G_GATE_CMD_MODIFY, &ggiomodify) == 0)


This happens because primay.c uses g_gate_ctl_modify from geom/gate/g_gate.h - however the build process does not include the "new" (source tree) header but the one installed in /usr/include/geom/gate instead, which does not yet declare g_gate_ctl_modify.
>How-To-Repeat:
cd to source dir
make -C sbin/hastd
>Fix:
Add -I/usr/src/sys to the compiler call (attached patch).

As a workaround, copying sys/geom/gate/g_gate.h from the source tree to /usr/include/geom/gate/g_gate.h works, too.

Patch attached with submission follows:

--- sbin/hastd/Makefile.orig	2012-09-17 12:05:48.834544721 +0200
+++ sbin/hastd/Makefile	2012-09-17 12:13:12.828719385 +0200
@@ -21,6 +21,7 @@
 
 NO_WFORMAT=
 NO_WCAST_ALIGN=
+CFLAGS+=-I${.CURDIR}../../sys
 CFLAGS+=-I${.CURDIR}
 CFLAGS+=-DHAVE_CAPSICUM
 CFLAGS+=-DPROTO_TCP_DEFAULT_PORT=8457


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209171017.q8HAHEUE031802>