I suspect there is something very, very, very wrong with my userland set up, but I am at a loss to know what it is. I've had this particular userland setup since the 10.x release and have had no issues doing major upgrades to newer FreeBSD versions. Anyways, trying to compile a kernel fails in the 'make depend' stage with errors like this: ===> aac (depend) make[2]: make[2]: don't know how to make aac.c. Stop make[2]: stopped in /usr/src/sys-11.1/modules/aac *** [depend_subdir_aac] Error code 2 make[1]: stopped in /usr/src/sys-11.1/modules 1 error make[1]: stopped in /usr/src/sys-11.1/modules *** [modules-depend] Error code 2 make: stopped in /usr/src/sys-11.1/amd64/compile/CUSTOM-11.1 1 error make: stopped in /usr/src/sys-11.1/amd64/compile/CUSTOM-11.1 If I cd into one of the module directories, I cannot 'make' anything in it: # cd ../../../modules/aac # make machine -> /usr/src/sys-11.1/amd64/include x86 -> /usr/src/sys-11.1/x86/include make: don't know how to make aac.c. Stop make: stopped in /usr/src/sys-11.1/modules/aac ---------------- I did some digging, and the root issue, at least for the module directories, has to do with the migration to using "${SRCTOP}" instead of the older "${.CURDIR}" setup in 11.0. If I edit the Makefile for the previous example and adopt the older 11.0 behavior: # sed -i -e 's/${SRCTOP}\/sys/${.CURDIR}\/..\/../g' Makefile # make echo "#define SCSI_DELAY 15000" > opt_scsi.h :> opt_cam.h :> opt_aac.h awk -f /usr/src/sys-11.1/tools/makeobjops.awk /usr/src/sys-11.1/kern/device_if.m -h awk -f /usr/src/sys-11.1/tools/makeobjops.awk /usr/src/sys-11.1/kern/bus_if.m -h awk -f /usr/src/sys-11.1/tools/makeobjops.awk /usr/src/sys-11.1/dev/pci/pci_if.m -h Warning: Object directory not changed from original /usr/src/sys-11.1/modules/aac cc -O2 -pipe -fno-strict-aliasing -O1 -Wno-error -D_KERNEL -D__FreeBSD_cc_version=1100001 -D__FreeBSD_cc_version=1100001 -DKLD_MODULE -nostdinc -I. -I/usr/src/sys-11.1 -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.aac.o -MTaac.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 -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=inline -Wno-error=enum-compare -Wno-error=unused-but-set-variable -Wno-error=aggressive-loop-optimizations -Wno-error=maybe-uninitialized -Wno-error=array-bounds -Wno-error=address -Wno-error=cast-qual -Wno-error=sequence-point -Wno-error=attributes -Wno-error=strict-overflow -Wno-error=overflow -finline-limit=8000 -fms-extensions --param inline-unit-growth=100 --param large-function-growth=1000 -std=iso9899:1999 -c /usr/src/sys-11.1/modules/aac/../../dev/aac/aac.c -o aac.o /usr/src/sys-11.1/modules/aac/../../dev/aac/aac.c: In function 'aac_describe_controller': /usr/src/sys-11.1/modules/aac/../../dev/aac/aac.c:2732:50: warning: unknown conversion type character 'b' in format [-Wformat=] device_printf(sc->aac_dev, "Supported Options=%b\n", ^ /usr/src/sys-11.1/modules/aac/../../dev/aac/aac.c:2732:30: warning: too many arguments for format [-Wformat-extra-args] device_printf(sc->aac_dev, "Supported Options=%b\n", ^~~~~~~~~~~~~~~~~~~~~~~~ [snip] ---------------- However, if I try making this change to the entire source tree, 'make depend' will still fail trying to compile modules when I do not have mentioned in my config file (which doesn't include GENERIC), e.g., it'll fail on "acpi_asus.c" in my case. Pretty much every other component of the Gentoo-side of things works fine. The lone exceptions are merging freebsd-sources itself (fails applying patches because the ebuild doesn't seem capable of extracting the necessary bits from freebsd-src tarball), and actually building the kernel itself. I was able to get freebsd-sources by running ebuild on a linux box to step though the ebuild phases, then scp'ed it over. So it's possible there's something that got missed that dealt with the SRCTOP thing.
# emerge --info Portage 2.3.27 (python 3.5.4-final-0, default/bsd/fbsd/amd64/11.1, gcc-6.4.0, freebsd-lib-11.1-r1, 11.1-RELEASE amd64) ================================================================= System uname: FreeBSD-11.1-RELEASE-amd64-64bit-ELF KiB Mem: 9404256 total KiB Swap: 3145728 total Timestamp of repository gentoo: Sun, 01 Apr 2018 04:15:01 +0000 Head commit of repository gentoo: 35a8d9b6d85acea56ad3101d483bd602140b13ce sh sh ld GNU ld (Gentoo 2.29.1 p3) 2.29.1 app-shells/bash: 4.4_p19::gentoo dev-lang/perl: 5.26.1-r2::gentoo dev-lang/python: 2.7.14-r1::gentoo, 3.5.4-r1::gentoo, 3.6.4::gentoo dev-util/cmake: 3.11.0::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.4.1-r2::gentoo sys-apps/openrc: 0.34.11::gentoo sys-devel/autoconf: 2.69-r4::gentoo sys-devel/automake: 1.14.1-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo sys-devel/binutils: 2.29.1-r1::gentoo sys-devel/gcc: 6.4.0-r1::gentoo, 7.3.0-r1::gentoo sys-devel/gcc-config: 1.9.1::gentoo sys-devel/libtool: 2.4.6-r5::gentoo sys-devel/make: 4.2.1-r3::gentoo sys-freebsd/freebsd-lib: 11.1-r1::gentoo (virtual/os-headers) Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync25.us.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-metamanifest: no sync-rsync-verify-max-age: 24 sync-rsync-extra-opts: gentoo-bsd location: /var/lib/layman/gentoo-bsd masters: gentoo priority: 0 local location: /usr/portage/local masters: gentoo local priority: 1 ACCEPT_KEYWORDS="amd64-fbsd ~amd64-fbsd" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-gentoo-freebsd11.1" CFLAGS="-O2 -pipe -march=znver1 -mtune=znver1 -fomit-frame-pointer -mfpmath=sse -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4a -mavx -mavx2 -mcx16 -msahf -mcrc32 -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaves -mxsaveopt -mpclmul -mpopcnt -mabm -mbmi -mbmi2 -mfma -mlzcnt -mrdrnd -mmwaitx -mclzero -maccumulate-outgoing-args -fforce-addr -fmodulo-sched -fivopts" CHOST="x86_64-gentoo-freebsd11.1" CONFIG_PROTECT="/boot/device.hints /etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/init.d /etc/pam.d /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-O2 -pipe -march=znver1 -mtune=znver1 -fomit-frame-pointer -mfpmath=sse -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4a -mavx -mavx2 -mcx16 -msahf -mcrc32 -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaves -mxsaveopt -mpclmul -mpopcnt -mabm -mbmi -mbmi2 -mfma -mlzcnt -mrdrnd -mmwaitx -mclzero -maccumulate-outgoing-args -fforce-addr -fmodulo-sched -fivopts" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs candy chflags config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sfperms unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" INSTALL_MASK="/etc/systemd /usr/lib/systemd" LDFLAGS="" MAKEOPTS="-j8" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/ramfs" USE="acl amd64-fbsd berkdb bindist crypt cxx dri gdbm iconv ipv6 mmx modules multilib ncurses offensive oss pam pcre readline sse sse2 ssl tcpd unicode xattr zlib" ABI_X86="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="FreeBSD" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse" KERNEL="FreeBSD" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5 python3_6" RUBY_TARGETS="ruby22 ruby23" USERLAND="BSD" VIDEO_CARDS="apm ark chips cirrus cyrix dummy i128 mach64 mga nv r128 radeon rendition s3 s3virge savage sis sisusb tga trident tseng fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, ENV_UNSET, LANG, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
SRCTOP refactoring mail: https://lists.freebsd.org/pipermail/freebsd-hackers/2017-March/050680.html
sys-freebsd/* is now pmasked.
sys-freebsd/* removed.