Bug 139527 - [twa] twa driver fails to build in CURRENT
Summary: [twa] twa driver fails to build in CURRENT
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-11 20:00 UTC by Nathaniel Filardo
Modified: 2012-03-11 01:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathaniel Filardo 2009-10-11 20:00:09 UTC
While building twa, the TW_CL_SWAP64 macro raises errors:

cc -c -O -pipe  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I/systank/src/sys -I/systank/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=15000 --param inline-unit-growth=100 --param large-function-growth=1000  -mcmodel=medany -msoft-float -ffreestanding -fstack-protector -Werror  /systank/src/sys/dev/twa/tw_cl_io.c -I/systank/src/sys/dev/twa
/systank/src/sys/dev/twa/tw_cl_io.c: In function 'tw_cli_get_param':
/systank/src/sys/dev/twa/tw_cl_io.c:790: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:790: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:790: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:790: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:790: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:790: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:790: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:790: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c: In function 'tw_cli_set_param':
/systank/src/sys/dev/twa/tw_cl_io.c:908: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:908: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:908: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:908: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:908: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:908: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:908: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:908: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:908: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c: In function 'tw_cli_send_scsi_cmd':
/systank/src/sys/dev/twa/tw_cl_io.c:1313: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:1313: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:1313: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:1313: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:1313: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:1313: error: lvalue required as unary '&' operand
/systank/src/sys/dev/twa/tw_cl_io.c:1313: error: lvalue required as unary '&' operand

etc.
Comment 1 Bruce Cran freebsd_committer freebsd_triage 2010-02-17 14:00:14 UTC
State Changed
From-To: open->feedback

I suspect the problem is due to settings in /etc/src.conf or /etc/make.conf. 
Could you email the contents of those files please?
Comment 2 Garrett Cooper 2010-06-08 23:35:04 UTC
Going once... going twice... close me?
-Garrett
Comment 3 Xin LI freebsd_committer freebsd_triage 2010-08-23 20:43:29 UTC
State Changed
From-To: feedback->closed

Mark closed due to feedback timeout. 


Comment 4 Xin LI freebsd_committer freebsd_triage 2010-08-23 20:43:29 UTC
Responsible Changed
From-To: freebsd-bugs->delphij

Take so just in case there is still problem.
Comment 5 Nathaniel Filardo 2012-03-11 01:33:30 UTC
I had replaced the card and then forgot about this, but today I attempted to
build the driver again and, lo', the errors and my memory of the bug
resurfaced.  So:

I don't have an /etc/src.conf, and /etc/make.conf is pretty boring:
> WRKDIRPREFIX?=  /usr/obj/ports
> WITHOUT_X11= Yes
> FETCH_ENV= HTTP_PROXY=http://172.29.0.52:3128/
> CPUTYPE=ultrasparc3
> # added by use.perl 2012-02-20 17:02:38
> PERL_VERSION=5.12.4

uname -a is a little further in the future, too:
> FreeBSD hydra.priv.oc.ietfng.org 9.0-STABLE FreeBSD 9.0-STABLE #31
> r232602+b4f0300-dirty: Tue Mar  6 09:32:59 EST 2012
> root@hydra.priv.oc.ietfng.org:/usr/obj/systank/src/sys/NWFKERN  sparc64

Let me tentatively suggest that the answer is to replace the current
definition which relies on pointer tricks:
> #define TW_CL_SWAP64_WITH_CAST(x)                                       \
>         ((((TW_UINT64)(TW_CL_SWAP32(((TW_UINT32 *)(&(x)))[1]))) << 32) |\
>         ((TW_UINT32)(TW_CL_SWAP32(((TW_UINT32 *)(&(x)))[0]))))
with a purely numeric, host-endian-agnostic equivalent (along the lines of
the other macros):
> #define TW_CL_SWAP64_WITH_CAST(x)                                       \
>         ((TW_UINT64)(TW_CL_SWAP32((x) >> 32)))                         |\
>         ((TW_UINT64)(TW_CL_SWAP32((x) & 0xFFFFFFFF)) << 32)
in /src/sys/dev/twa/tw_cl_share.h:248 .

This compiles but I have not yet tested the driver with real hardware on my
big-endian system.  Will report back when I can; hopefully before 2014.
--nwf;