I've submitted bug 207148 for buildworld using the old /usr/include/sys/proc.h (so 'P_KPROC' undeclared)

Mark Millard markmi at dsl-only.net
Sat Feb 13 05:59:40 UTC 2016


A minor variation on what I wrote in the bug description is:

This traces back to the build using /usr/include instead of (in my context) /usr/obj/gcc421/powerpc.powerpc/usr/src/tmp/usr/include (or an equivalent) and so picking up an old sys/proc.h file. The detailed evidence follows. Note the lack of any -I or -isysroot or other such in the cc command below.

svnlite update -r295453 /usr/src (for an ^/head context) then a buildworld buildkernel got:

> --- all_subdir_bin ---
> --- pkill.o ---
> cc  -O2 -pipe   -g -MD -MP -MF.depend.pkill.o -MTpkill.o -std=gnu99 -fstack-protector-strong -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 -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign    -c /usr/src/bin/pkill/pkill.c -o pkill.o
> . . .
> --- all_subdir_bin ---
> /usr/src/bin/pkill/pkill.c: In function 'main':
> /usr/src/bin/pkill/pkill.c:353: error: 'P_KPROC' undeclared (first use in this function)
> /usr/src/bin/pkill/pkill.c:353: error: (Each undeclared identifier is reported only once
> /usr/src/bin/pkill/pkill.c:353: error: for each function it appears in.)
> *** [pkill.o] Error code 1
> 
> make[4]: stopped in /usr/src/bin/pkill
> 1 error
> 
> make[4]: stopped in /usr/src/bin/pkill
> *** [all_subdir_pkill] Error code 2

What is happening is:

/usr/include/sys/proc.h still has P_KTHREAD (buildworld used this)
/usr/obj/gcc421/powerpc.powerpc/usr/src/tmp/usr/include/sys/proc.h has P_KPROC

/usr/src/bin/pkill/Makefile has no CFLAGS+= SOMETHING_FOR_INCLUDE_PATH . So it depends completely on context for directing where to find the file for:

> #include <sys/proc.h>

but that context ends up contributing nothing and so pure default path rules are used --which picks up the still-old /usr/include/sys/proc.h file.


Stop reading here unless you want more context details.

src.conf content (make.conf empty):

> TO_TYPE=powerpc
> KERNCONF=GENERICvtsc-NODEBUG
> TARGET=powerpc
> .if ${.MAKE.LEVEL} == 0
> TARGET_ARCH=${TO_TYPE}
> .export TARGET_ARCH
> .endif
> WITH_FAST_DEPEND=
> WITH_LIB32=
> WITH_BOOT=
> COMPILER_TYPE=gcc
> WITHOUT_GCC_BOOTSTRAP=
> WITH_GCC=
> WITH_GCC_IS_CC=
> WITH_GNUCXX=
> WITHOUT_LIBCPLUSPLUS=
> WITHOUT_CLANG_BOOTSTRAP=
> WITHOUT_CLANG=
> WITHOUT_CLANG_IS_CC=
> WITHOUT_CLANG_FULL=
> WITHOUT_CLANG_EXTRAS=
> NO_WERROR=
> MALLOC_PRODUCTION=
> WITH_DEBUG_FILES=

> # freebsd-version -ku; uname -aKU
> 11.0-CURRENT
> 11.0-CURRENT
> FreeBSD FBSDG4C0 11.0-CURRENT FreeBSD 11.0-CURRENT #6 r295350M: Sat Feb  6 13:54:57 PST 2016     root at FBSDG4C0:/usr/obj/gcc421/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODEBUG  powerpc 1100097 1100097

Command used to buildworld buildkernel:

> env __MAKE_CONF=/root/src.configs/make.conf SRC_ENV_CONF=/root/src.configs/src.conf.powerpc-gcc421.powerpc-host MAKEOBJDIRPREFIX=/usr/obj/gcc421/powerpc.powerpc make -j 6 buildworld buildkernel

(This is a classic self-hosted gcc 4.2.1 TARGET_ARCH=powerpc context, not a clang 3.8.0 based experiment and not a cross build.)

===
Mark Millard
markmi at dsl-only.net



More information about the freebsd-ppc mailing list