Bug 247256 - ld error: undefined symbol: M_UFSMNT
Summary: ld error: undefined symbol: M_UFSMNT
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Chuck Silvers
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-06-14 15:16 UTC by Dries Michiels
Modified: 2020-06-18 00:41 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dries Michiels freebsd_committer freebsd_triage 2020-06-14 15:16:08 UTC
When updating from r361107 => r362175 
I get the following error when building my custom kernel.
I do not have UFS included in my KERNCONF, this was a clean build.

cc -target x86_64-unknown-freebsd13.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin  -O2 -pipe -fno-common  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -DKLD_TIED -nostdinc  -I. -I/usr/src/sys/dev/ath -I/usr/src/sys/dev/ath/ath_hal -I. -I/usr/src/sys/contrib/dev/ath/ath_hal/ -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/amd64.amd64/sys/VADOS/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -I/usr/obj/usr/src/amd64.amd64/sys/VADOS     -MD  -MF.depend.ar5416_interrupts.o -MTar5416_interrupts.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -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-address-of-packed-member -Wno-format-zero-length   -mno-aes -mno-avx  -std=iso9899:1999 -c /usr/src/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c -o ar5416_interrupts.o
--- all_subdir_ata ---
ctfconvert -L VERSION -g ata-ite.o
--- ataite.ko.full ---
ld -m elf_x86_64_fbsd -d -warn-common --build-id=sha1 -T /usr/src/sys/conf/ldscript.kmod.amd64 -r -d  -o ataite.ko.full ata-ite.o
ctfmerge -L VERSION -g -o ataite.ko.full ata-ite.o
--- kernel.full ---
ld: error: undefined symbol: M_UFSMNT
>>> referenced by ffs_subr.c:226 (/usr/src/sys/ufs/ffs/ffs_subr.c:226)
>>>               ffs_subr.o:(ffs_fsfail_unmount)
--- modules-all ---
:> export_syms
awk -f /usr/src/sys/conf/kmod_syms.awk ataite.ko.full  export_syms | xargs -J% objcopy % ataite.ko.full
--- ataite.ko.debug ---
objcopy --only-keep-debug ataite.ko.full ataite.ko.debug
--- ataite.ko ---
objcopy --strip-debug --add-gnu-debuglink=ataite.ko.debug  ataite.ko.full ataite.ko
--- all_subdir_ata/atapci/chipsets/atajmicron ---
===> ata/atapci/chipsets/atajmicron (all)
--- kernel.full ---
*** [kernel.full] Error code 1
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2020-06-14 18:02:16 UTC
Looks like ffs_subr.c is used by geom_label, so it may get compiled even when UFS is not compiled into the kernel.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2020-06-16 12:15:49 UTC
Regressed by base r361491 according to
https://lists.freebsd.org/pipermail/svn-src-head/2020-May/136524.html
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-06-17 23:40:51 UTC
A commit references this bug:

Author: chs
Date: Wed Jun 17 23:39:53 UTC 2020
New revision: 362292
URL: https://svnweb.freebsd.org/changeset/base/362292

Log:
  Move all of the functions in ffs_subr.c that are only used by the ufs kernel
  module from that file into ffs_vfsops.c.  This fixes the build for kernel
  configs that don't include FFS.

  PR:		247256
  Submitted by:	glebius
  Reviewed by:	mckusick (earlier version)
  Sponsored by:	Netflix
  Differential Revision:	https://reviews.freebsd.org/D25285

Changes:
  head/sys/ufs/ffs/ffs_extern.h
  head/sys/ufs/ffs/ffs_subr.c
  head/sys/ufs/ffs/ffs_vfsops.c
  head/sys/ufs/ufs/ufs_vnops.c