Bug 239120 - [patch] [tpm] sys/modules/tpm cannot be built outside of kernel build environment
Summary: [patch] [tpm] sys/modules/tpm cannot be built outside of kernel build environ...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.3-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
Keywords: easy, patch
Depends on:
Reported: 2019-07-10 19:19 UTC by Eugene Grosbein
Modified: 2019-07-16 19:30 UTC (History)
1 user (show)

See Also:

proposed fix (441 bytes, patch)
2019-07-10 19:19 UTC, Eugene Grosbein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein freebsd_committer 2019-07-10 19:19:39 UTC
Created attachment 205670 [details]
proposed fix

For FreeBSD 11.3-STABLE (r349872):

# cd /usr/src/sys/modules/tpm
# make
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.tpm20.o -MTtpm20.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-prototypes -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-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -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/tpm/tpm20.c -o tpm20.o
In file included from /usr/src/sys/dev/tpm/tpm20.c:33:
/usr/src/sys/dev/tpm/tpm20.h:58:10: fatal error: 'opt_tpm.h' file not found
#include "opt_tpm.h"
1 error generated.
*** Error code 1
Comment 1 commit-hook freebsd_committer 2019-07-16 18:41:00 UTC
A commit references this bug:

Author: eugen
Date: Tue Jul 16 18:40:00 UTC 2019
New revision: 350062
URL: https://svnweb.freebsd.org/changeset/base/350062

  MFC r345632 by lwhsu: Fix `make` in sys/modules

  PR:             239120

_U  stable/12/
Comment 2 commit-hook freebsd_committer 2019-07-16 19:24:07 UTC
A commit references this bug:

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

  Make tpm(4) kernel module buildable outside of kernel build environment.

  This direct commit is partial merge of r345632 (by lwhsu) from head
  that cannot be merged completely due to significant differences
  in code base.

  PR:		239120

Comment 3 Eugene Grosbein freebsd_committer 2019-07-16 19:30:59 UTC
Fixed in all supported branches.