Bug 269994 - build options have different kernel and userland defaults
Summary: build options have different kernel and userland defaults
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-06 14:12 UTC by Ed Maste
Modified: 2023-12-27 12:40 UTC (History)
1 user (show)

See Also:
linimon: mfc-stable14?
linimon: mfc-stable13?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2023-03-06 14:12:35 UTC
Options EFI and FDT have different defaults in src.opts.mk and kern.conf.mk, prompting warnings from makeman:

amd64/amd64: ignoring duplicate option FDT
arm/armv6: ignoring duplicate option FDT
arm/armv7: ignoring duplicate option FDT
arm64/aarch64: ignoring duplicate option FDT
i386/i386: ignoring duplicate option FDT
powerpc/powerpc: ignoring duplicate option EFI
powerpc/powerpc: ignoring duplicate option FDT
powerpc/powerpc64: ignoring duplicate option EFI
powerpc/powerpc64: ignoring duplicate option FDT
powerpc/powerpc64le: ignoring duplicate option EFI
powerpc/powerpc64le: ignoring duplicate option FDT
riscv/riscv64: ignoring duplicate option FDT
riscv/riscv64sf: ignoring duplicate option FDT

Both are in src.conf.mk __DEFAULT_YES_OPTIONS, but EFI also has:

# EFI doesn't exist on powerpc (well, officially)
.if ${__T:Mpowerpc*}
BROKEN_OPTIONS+=EFI
.endif

kern.opts.mk has EFI in __DEFAULT_YES_OPTIONS, but:

# EFI doesn't exist on powerpc, or riscv
.if ${MACHINE:Mpowerpc} || ${MACHINE:Mriscv}
BROKEN_OPTIONS+=EFI
.endif

while for FDT it has:

.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
__DEFAULT_NO_OPTIONS += FDT
.else
__DEFAULT_YES_OPTIONS += FDT
.endif
Comment 1 Ed Maste freebsd_committer freebsd_triage 2023-03-06 14:35:32 UTC
As far as I can tell the ${MACHINE*} tests in kern.opts.mk do not work, at least for `make showconfig`. When I run `make TARGET=powerpc TARGET_ARCH=powerpc64
showconfig` on my laptop MACHINE is `amd64` within kern.opts.mk.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-03-06 21:04:02 UTC
A commit in branch main references this bug:

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

commit d7a491dd3037030a09e579225899cd0617a5ef4f
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-03-06 15:56:13 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-03-06 21:03:22 +0000

    make showconfig: set MACHINE and MACHINE_ARCH

    Previously these were not set for the showconfig target, so took the
    host's value rather than the target.  As a result some machine-dependent
    kernel options were not reported with correct defaults in the src.conf
    manpage.

    PR:             269994
    Reviewed by:    imp
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D38926

 Makefile.inc1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-03-06 21:10:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3f9c1b2cae5d6a223d9306194d72d86b6baadacd

commit 3f9c1b2cae5d6a223d9306194d72d86b6baadacd
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-03-06 21:07:38 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-03-06 21:08:56 +0000

    src.conf: regen after d7a491dd3037

    Machine-dependent kernel options are now detected correctly.

    PR:             269994
    Sponsored by:   The FreeBSD Foundation

 share/man/man5/src.conf.5 | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)
Comment 4 Ed Maste freebsd_committer freebsd_triage 2023-03-06 21:12:24 UTC
Mismatches are now (sorted by option):

amd64/amd64: ignoring duplicate option FDT
i386/i386: ignoring duplicate option FDT

arm/armv6: ignoring duplicate option OFED
arm/armv7: ignoring duplicate option OFED
arm64/aarch64: ignoring duplicate option OFED
powerpc/powerpc: ignoring duplicate option OFED
riscv/riscv64: ignoring duplicate option OFED
riscv/riscv64sf: ignoring duplicate option OFED

arm/armv6: ignoring duplicate option PIE
arm/armv7: ignoring duplicate option PIE
i386/i386: ignoring duplicate option PIE
powerpc/powerpc: ignoring duplicate option PIE

riscv/riscv64: ignoring duplicate option EFI
riscv/riscv64sf: ignoring duplicate option EFI

powerpc/powerpc: ignoring duplicate option ZFS
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-03-07 01:35:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=6e0a1438d8f296583beec36fa2fbdc94b69560e0

commit 6e0a1438d8f296583beec36fa2fbdc94b69560e0
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-03-06 21:47:36 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-03-07 01:34:02 +0000

    src.opts.mk: mark ZFS broken on powerpc, matching kern.opts.mk

    Where options exist in both src.opts.mk and kern.opts.mk they should be
    kept in sync.

    PR:             269994
    Reviewed by:    imp
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D38935

 share/mk/src.opts.mk | 4 ++++
 1 file changed, 4 insertions(+)
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-03-07 18:42:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7661a2abe45cfa144f69898f8498c3cfd88cceb8

commit 7661a2abe45cfa144f69898f8498c3cfd88cceb8
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-03-07 16:39:46 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-03-07 18:40:18 +0000

    src.opts.mk: sync FDT and OFED options with kern.opts.mk

    Where options exist in both src.opts.mk and kern.opts.mk they should be
    kept in sync.

    It may be that the option should be flipped the other way (e.g.,
    enabling OFED in the kernel on arm64); if so that will be done as a
    subsequent commit after further testing.

    PR:             269994
    Reviewed by:    imp
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D38952

 share/mk/src.opts.mk | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
Comment 7 Ed Maste freebsd_committer freebsd_triage 2023-05-12 15:03:47 UTC
Warnings at present (as of d1fdf357ae72e9e43e2e897aaf6dedb434b3d5fc)
make: "/usr/home/emaste/src/freebsd-git/main/share/mk/bsd.opts.mk" line 112: warning: WITH_INIT_ALL_PATTERN and WITH_INIT_ALL_ZERO are mutually exclusive.
make[1]: "/usr/home/emaste/src/freebsd-git/main/share/mk/bsd.opts.mk" line 112: warning: WITH_INIT_ALL_PATTERN and WITH_INIT_ALL_ZERO are mutually exclusive.
arm/armv6: ignoring duplicate option PIE
arm/armv7: ignoring duplicate option PIE
i386/i386: ignoring duplicate option PIE
powerpc/powerpc: ignoring duplicate option PIE
riscv/riscv64: ignoring duplicate option EFI
no description found for WITH_META_ERROR_TARGET, skipping
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-05-12 16:15:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=74674fef3c123d2bcb054f8723ed1bd781972c79

commit 74674fef3c123d2bcb054f8723ed1bd781972c79
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-05-12 14:39:42 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-05-12 15:04:00 +0000

    kern.opts.mk: rationalize i386 EFI default with src.opts.mk

    PR: 269994
    Fixes: ad9d10a859a ("efi: mark as broken on i386")
    Sponsored by: The FreeBSD Foundation

 sys/conf/kern.opts.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 9 Mark Linimon freebsd_committer freebsd_triage 2023-12-27 12:40:43 UTC
^Triage: assign to committer that resolved.  Set possible mfc flags.