Bug 207378

Summary: Build world of 11-CURRENT r295839 fails on Sparc64
Product: Base System Reporter: dal36
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: ian, jau
Priority: ---    
Version: CURRENT   
Hardware: sparc64   
OS: Any   
Attachments:
Description Flags
A patch renaming the local variables the names of which would shadow global functions.
none
A retry of the same patch - the previous attempt was apparently corrupted in transit none

Description dal36 2016-02-20 20:51:48 UTC
Whilst trying to build 11-CURRENT r295839 on sparc64 (using a system at 11-CURRENT r295086), I receive the error messages below. The upgrade procedure used was that detailed in the FreeBSD Handbook (23.6 Rebuilding World). This process failed on two machines with make -j8 buildworld, and again (after emptying /usr/obj) on one of them with make buildworld (i.e. without -jN set). Note that I upgraded an amd64 machine to r295841 without problems, suggesting amd64 is unaffected.

===> usr.sbin/iostat (all)
cc  -O2 -pipe   -g -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign    -c /usr/src/usr.sbin/iostat/iostat.c -o iostat.o
cc1: warnings being treated as errors
/usr/src/usr.sbin/iostat/iostat.c: In function 'devstats':
/usr/src/usr.sbin/iostat/iostat.c:800: warning: declaration of 'devname' shadows a global declaration
/usr/obj/usr/src/tmp/usr/include/stdlib.h:282: warning: shadowed declaration is here
/usr/src/usr.sbin/iostat/iostat.c: In function 'cpustats':
/usr/src/usr.sbin/iostat/iostat.c:982: warning: declaration of 'time' shadows a global declaration
/usr/obj/usr/src/tmp/usr/include/time.h:154: warning: shadowed declaration is here
*** Error code 1

Stop.
make[4]: stopped in /usr/src/usr.sbin/iostat
*** Error code 1

Stop.
make[3]: stopped in /usr/src/usr.sbin
*** Error code 1

Stop.
make[2]: stopped in /usr/src
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src
Comment 1 Ian Lepore freebsd_committer freebsd_triage 2016-02-20 20:56:30 UTC
Not an arm-specific bug, reassign to 'misc' component.
Comment 2 jau 2016-02-21 10:48:38 UTC
Created attachment 167238 [details]
A patch renaming the local variables the names of which would shadow global functions.

It is really bad style to use a globally defined name (function or variable)
as a name of a local variable, but apparently clang is not too picky about it.
Comment 3 jau 2016-02-21 10:54:19 UTC
The same problem applies to any and all hardware platforms using gcc as the system
compiler. So, in addition to sparc64 also ppc, ppc64, and mips are impacted.
Comment 4 dal36 2016-02-21 10:59:12 UTC
Did the patch upload OK? It seems to be showing as 2 bytes and gives a blank screen when I click through.
Comment 5 jau 2016-02-21 13:25:10 UTC
Created attachment 167253 [details]
A retry of the same patch - the previous attempt was apparently corrupted in transit

This patch was apparently corrupted in transit during the previous attempt.
Comment 6 dal36 2016-02-21 21:34:47 UTC
After applying this patch, make buildworld completes successfully. I've not tested iostat itself, but will do so once I've installed everything.
Comment 7 dal36 2016-02-23 21:19:23 UTC
This patch solves the issue that I had with the build. From what I can tell, a functionally equivalent patch to the one above was committed as r295900. Thanks for your help with this.
Comment 8 Ian Lepore freebsd_committer freebsd_triage 2016-02-23 21:28:36 UTC
Fixed by r295900