Bug 239119

Summary: [patch] [spi] sys/modules/spi cannot be built outside of kernel build environment
Product: Base System Reporter: Eugene Grosbein <eugen>
Component: kernAssignee: freebsd-bugs mailing list <bugs>
Status: Closed FIXED    
Severity: Affects Some People CC: kp, loos
Priority: --- Keywords: patch
Version: 11.3-STABLEFlags: eugen: mfc-stable11+
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227323
Attachments:
Description Flags
proposed fix eugen: maintainer-approval? (loos)

Description Eugene Grosbein freebsd_committer 2019-07-10 19:02:03 UTC
Created attachment 205669 [details]
proposed fix

For FreeBSD 11.3-STABLE (r349872):

# cd /usr/src/sys/modules/spi
# make
===> sys/modules/spi (all)
===> sys/modules/spi/../spigen (all)
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h
:> opt_platform.h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/spibus/spibus_if.m -h
cc  -O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -
fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer   -MD  -MF.depend.spigen.o -MTspig
en.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables
-ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototyp
es -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__
=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-err
or-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-fun
ction -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member
-mno-aes -mno-avx  -std=iso9899:1999 -c /usr/src/sys/dev/spibus/spigen.c -o spigen.o
/usr/src/sys/dev/spibus/spigen.c:29:10: fatal error: 'opt_spi.h' file not found
#include "opt_spi.h"
         ^~~~~~~~~~~
1 error generated.
*** Error code 1
Comment 1 Kristof Provost freebsd_committer 2019-07-10 19:13:38 UTC
Looks correct to me (I remember fixing something similar for pf). I think you can just commit this.
Comment 2 Ian Lepore freebsd_committer 2019-07-10 21:43:01 UTC
Are you not a src committer?  Why all the overhead of a bug report for a 1-line fix you could commit in 15 seconds and get on with real work?
Comment 3 commit-hook freebsd_committer 2019-07-16 19:41:10 UTC
A commit references this bug:

Author: eugen
Date: Tue Jul 16 19:40:23 UTC 2019
New revision: 350066
URL: https://svnweb.freebsd.org/changeset/base/350066

Log:
  MFC r336561 by lwhsu: Fix `make` in sys/modules/spigen

  PR:		239119

Changes:
_U  stable/11/
  stable/11/sys/modules/spigen/Makefile
Comment 4 Eugene Grosbein freebsd_committer 2019-07-16 19:44:00 UTC
Fix merged.