Bug 226600 - cpucontrol fails to compile [with ccache], so "make buildworld" fails also
Summary: cpucontrol fails to compile [with ccache], so "make buildworld" fails also
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.1-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Mark Linimon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-14 11:54 UTC by oz42
Modified: 2021-06-30 01:03 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description oz42 2018-03-14 11:54:21 UTC
cpucontrol fails to compile, so "make buildworld" fails also.


/usr/local/libexec/ccache/world/cc -O2 -pipe   -MD  -MF.depend.cpucontrol.o -MTcpucontrol.o -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 -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable  -Qunused-arguments  -c /usr/src/usr.sbin/cpucontrol/cpucontrol.c -o cpucontrol.o
/usr/src/usr.sbin/cpucontrol/cpucontrol.c:353:20: error: use of undeclared identifier 'CPUCTL_EVAL_CPU_FEATURES'
        error = ioctl(fd, CPUCTL_EVAL_CPU_FEATURES, NULL);
                          ^
1 error generated.
*** Error code 1

Stop.
make: stopped in /usr/src/usr.sbin/cpucontrol


System is FreeBSD 11.1-RELEASE-p7 amd64 now, so I assume the bug appeared with FreeBSD 11.1-RELEASE-p8.
Comment 1 Gordon Tetlow freebsd_committer 2018-03-14 16:30:41 UTC
The patch for 11.1-RELEASE-p8 (https://security.FreeBSD.org/patches/SA-18:03/speculative_execution-amd64-11.patch) includes the definition of CPUCTL_EVAL_CPU_FEATURES in sys/sys/cpuctl.h. I'm pretty sure there is something with your environment that did not patch properly. Can you verify your patch correctly applied (no .rej in your tree) and try running a clean buildworld?
Comment 2 oz42 2018-03-15 08:27:28 UTC
I cannot find any *.rej files.
Comment 3 Ed Maste freebsd_committer 2018-03-15 14:02:27 UTC
(In reply to oz42 from comment #0)
I take it you're using ccache; please try building without it.
Comment 4 oz42 2018-03-16 13:19:54 UTC
Disabling ccache fixed it. I assume this is a ccache bug then.
Comment 5 Ofloo 2018-03-18 08:14:51 UTC
rameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable  -Qunused-arguments  -c /usr/src/usr.sbin/cpucontrol/cpucontrol.c -o cpucontrol.o
/usr/src/usr.sbin/cpucontrol/cpucontrol.c:353:20: error: use of undeclared identifier
      'CPUCTL_EVAL_CPU_FEATURES'
        error = ioctl(fd, CPUCTL_EVAL_CPU_FEATURES, NULL);
                          ^
1 error generated.
*** Error code 1

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

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

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

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

Stop.
make: stopped in /usr/src



Also affects me
Comment 6 Ofloo 2018-03-18 08:19:12 UTC
# system info
FreeBSD 11.1-RELEASE-p6 

# CUSTOM KERNEL
include                 GENERIC
ident                   OFL
options                 IPFIREWALL
options                 IPFIREWALL_VERBOSE
options                 IPFIREWALL_DEFAULT_TO_ACCEPT
options                 DUMMYNET
options                 IPDIVERT
options                 CONSPEED=115200
options                 VIMAGE

# cpu info
CPU: Intel(R) Xeon(R) CPU E3-1265L v3 @ 2.50GHz (2500.05-MHz K8-class CPU)

sorry forgot to add some info
Comment 7 Gordon Tetlow freebsd_committer 2018-03-19 18:12:11 UTC
(In reply to Ofloo from comment #5)

Can you please check to ensure the patch to sys/sys/cpuctl.h correctly applied? This file could be problematic due to the SVNID embedded in the file.
Comment 8 Ofloo 2018-03-19 18:39:45 UTC
euhm I removed /usr/obj/* /usr/src/* and all the hidden files like .svn and did new checkout.

And yet the error still shows, which is odd because on 2 other systems with same configuration files

but different hardware 

Intel(R) Xeon(R) CPU E3-1245 V2 @ 3.40GHz 

It just compiles.

I do have 

# Build all ports' -march against my cpu for best performance
CPUTYPE?=native

in the make file i'll remove that and see if that builds, i had an error on freebsd stable because of it before.
Comment 9 oz42 2018-03-20 13:55:01 UTC
I have the problem - again. This time on my 3rd host.

When I copy the line

#define CPUCTL_EVAL_CPU_FEATURES        _IO('c', 8)

from /usr/src/sys/sys/cpuctl.h into /usr/src/usr.sbin/cpucontrol/cpucontrol.h, compilation succeeds.
Comment 10 Ofloo 2018-03-20 17:13:39 UTC
I commented following in make.conf and 

#CC=clang
#CXX=clang++
#CPP=clang-cpp


--------------------------------------------------------------
>>> World build completed on Tue Mar 20 11:47:56 CET 2018
--------------------------------------------------------------
Comment 11 oz42 2018-03-22 14:25:10 UTC
I have removed all references to ccache, now it works. Must be a ccache bug.