Bug 222861 - [regression] linux_common kernel module fail to build outside of kernel building environment
Summary: [regression] linux_common kernel module fail to build outside of kernel build...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.3-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Dmitry Chagin
URL:
Keywords: easy, patch-ready, regression
Depends on:
Blocks:
 
Reported: 2017-10-08 13:28 UTC by Eugene Grosbein
Modified: 2021-03-20 15:19 UTC (History)
1 user (show)

See Also:
eugen: mfc-stable11?
eugen: mfc-stable10?


Attachments
proposed fix (437 bytes, patch)
2017-10-08 13:28 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 freebsd_triage 2017-10-08 13:28:56 UTC
Created attachment 186998 [details]
proposed fix

sys/modules/linux_common cannot be built anymore without kernel build environment due to missing opt_kdtrace.h

The patch is attached.
Comment 1 Dmitry Chagin freebsd_committer freebsd_triage 2019-04-28 15:08:51 UTC
Can't reproduce anymore.
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-05-13 18:25:31 UTC
A commit references this bug:

Author: dchagin
Date: Mon May 13 18:24:31 UTC 2019
New revision: 347538
URL: https://svnweb.freebsd.org/changeset/base/347538

Log:
  Linuxulator depends on a fundamental kernel settings such as SMP. Many
  of them listed in opt_global.h which is not generated while building
  modules outside of a kernel and such modules never match real cofigured
  kernel.

  So, we should prevent our users from building obviously defective modules.

  Therefore, remove the root cause of the building of modules outside of a
  kernel - the possibility of building modules with DEBUG or KTR flags.
  And remove all of DEBUG printfs as it is incomplete and in threaded
  programms not informative, also a half of system call does not have DEBUG
  printf. For debuging Linux programms we have dtrace, ktr and ktrace ability.

  PR:		222861
  Reviewed by:	trasz
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D20178

Changes:
  head/sys/amd64/linux/linux.h
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux32/linux.h
  head/sys/amd64/linux32/linux32_machdep.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/arm64/linux/linux.h
  head/sys/arm64/linux/linux_sysvec.c
  head/sys/compat/linux/linux_file.c
  head/sys/compat/linux/linux_fork.c
  head/sys/compat/linux/linux_getcwd.c
  head/sys/compat/linux/linux_ioctl.c
  head/sys/compat/linux/linux_misc.c
  head/sys/compat/linux/linux_misc.h
  head/sys/compat/linux/linux_signal.c
  head/sys/compat/linux/linux_stats.c
  head/sys/i386/linux/linux.h
  head/sys/i386/linux/linux_machdep.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/modules/linux/Makefile
  head/sys/modules/linux64/Makefile
  head/sys/modules/linux_common/Makefile
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-05-13 18:29:36 UTC
A commit references this bug:

Author: dchagin
Date: Mon May 13 18:28:41 UTC 2019
New revision: 347540
URL: https://svnweb.freebsd.org/changeset/base/347540

Log:
  Add warning to the Linuxulator makefiles that building it outside of a
  kernel does not make sence.

  PR:		222861
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D20179

Changes:
  head/sys/modules/linprocfs/Makefile
  head/sys/modules/linsysfs/Makefile
  head/sys/modules/linux/Makefile
  head/sys/modules/linux64/Makefile
  head/sys/modules/linux_common/Makefile
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-08-24 17:07:24 UTC
A commit references this bug:

Author: trasz
Date: Mon Aug 24 17:06:37 UTC 2020
New revision: 364712
URL: https://svnweb.freebsd.org/changeset/base/364712

Log:
  MFC r347538 by dchagin:

  Linuxulator depends on a fundamental kernel settings such as SMP. Many
  of them listed in opt_global.h which is not generated while building
  modules outside of a kernel and such modules never match real cofigured
  kernel.

  So, we should prevent our users from building obviously defective modules.

  Therefore, remove the root cause of the building of modules outside of a
  kernel - the possibility of building modules with DEBUG or KTR flags.
  And remove all of DEBUG printfs as it is incomplete and in threaded
  programms not informative, also a half of system call does not have DEBUG
  printf. For debuging Linux programms we have dtrace, ktr and ktrace ability.

  PR:		222861

Changes:
_U  stable/12/
  stable/12/sys/amd64/linux/linux.h
  stable/12/sys/amd64/linux/linux_sysvec.c
  stable/12/sys/amd64/linux32/linux.h
  stable/12/sys/amd64/linux32/linux32_machdep.c
  stable/12/sys/amd64/linux32/linux32_sysvec.c
  stable/12/sys/arm64/linux/linux.h
  stable/12/sys/arm64/linux/linux_sysvec.c
  stable/12/sys/compat/linux/linux_file.c
  stable/12/sys/compat/linux/linux_fork.c
  stable/12/sys/compat/linux/linux_getcwd.c
  stable/12/sys/compat/linux/linux_ioctl.c
  stable/12/sys/compat/linux/linux_misc.c
  stable/12/sys/compat/linux/linux_misc.h
  stable/12/sys/compat/linux/linux_signal.c
  stable/12/sys/compat/linux/linux_stats.c
  stable/12/sys/i386/linux/linux.h
  stable/12/sys/i386/linux/linux_machdep.c
  stable/12/sys/i386/linux/linux_sysvec.c
  stable/12/sys/modules/linux/Makefile
  stable/12/sys/modules/linux64/Makefile
  stable/12/sys/modules/linux_common/Makefile
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-03-20 15:19:51 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=097e0b8955762c043b01ba247e59d704a83d222a

commit 097e0b8955762c043b01ba247e59d704a83d222a
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2019-05-13 18:28:40 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2021-03-20 15:18:01 +0000

    Add warning to the Linuxulator makefiles that building it outside of a
    kernel does not make sence.

    PR:             222861
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D20179

    (cherry picked from commit 6e4cf32e95841b4c3ef0caeb80802bf528a35cd0)

 sys/modules/linprocfs/Makefile    | 4 ++++
 sys/modules/linsysfs/Makefile     | 4 ++++
 sys/modules/linux/Makefile        | 4 ++++
 sys/modules/linux64/Makefile      | 4 ++++
 sys/modules/linux_common/Makefile | 4 ++++
 5 files changed, 20 insertions(+)