When options COMPAT_LINUX32 is defined in the kernel and linux_enable="YES" in rc.conf, the system boots with this error: link_elf_obj: symbol elf64_linux_vdso_fixup undefined linker_load_file: Unsupported file type When options COMPAT_LINUX32 is not defined in the kernel and linux_enable="YES" in rc.conf, the linux module loads fine. Linux x86-64 ELF exec handler installed
Actually, on 11-STABLE and not having any mention of COMPAT_LINUX or COMPAT_LINUX32 in my kernel, trying to kldload linux64.ko I still get this message in the logs: % sudo kldload linux64 kldload: an error occurred while loading the module. Please check dmesg(8) for more details. % dmesg | tail -2 link_elf_obj: symbol elf64_linux_vdso_fixup undefined linker_load_file: Unsupported file type % grep LINUX /usr/src/sys/amd64/conf/DEALER #options COMPAT_LINUX
Rephrase my previous comment, looks like the kernel I was using had COMPAT_LINUX32 compiled in. Rebuilding with the file shown from the grep allows one to kldload either linux.ko or linux64.ko successfully. I'll check the documentation and see what can be adjusted there to save people from annoyance.
For the record: % uname -a FreeBSD dealer 11.1-PRERELEASE FreeBSD 11.1-PRERELEASE #7 r319368M: Thu Jun 1 08:01:01 CEST 2017 root@dealer:/usr/obj/usr/src/sys/DEALER amd64 % kldstat | grep lin 5 1 0xffffffff8261f000 a887 linprocfs.ko 6 2 0xffffffff8262a000 7afc linux_common.ko 7 1 0xffffffff82632000 3c7ff linux64.ko
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e013e36939ac87b53195370fb5e29f29c1a4b5c6 commit e013e36939ac87b53195370fb5e29f29c1a4b5c6 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2021-06-22 05:32:39 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2021-06-22 05:32:39 +0000 linux(4): Get rid of Linuxulator kernel build options. Stop confusing people, retire COMPAT_LINUX and COMPAT_LINUX32 kernel build options. Since we have 32 and 64 bit Linux emulators, we can't build both emulators together into the kernel. I don't think it matters, Linux emulation depends on loadable modules (via rc). Cut LINPROCFS and LINSYSFS for consistency. PR: 215061 Reviewed by: bcr (manpages), trasz Differential Revision: https://reviews.freebsd.org/D30751 MFC after: 2 weeks share/man/man4/aac.4 | 4 +--- share/man/man4/aacraid.4 | 4 +--- share/man/man4/linux.4 | 15 +----------- share/man/man4/tdfx.4 | 13 ++++++---- sys/amd64/conf/NOTES | 17 ------------- sys/conf/NOTES | 4 ++-- sys/conf/files | 5 ---- sys/conf/files.amd64 | 62 ------------------------------------------------ sys/conf/files.i386 | 58 -------------------------------------------- sys/conf/files.x86 | 1 - sys/conf/options.amd64 | 2 +- sys/i386/conf/NOTES | 16 +------------ 12 files changed, 16 insertions(+), 185 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5833253dad65184610ef689fc63f4ad69c978011 commit 5833253dad65184610ef689fc63f4ad69c978011 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2022-06-17 19:30:22 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2022-06-17 19:30:22 +0000 linux(4): Get rid of Linuxulator kernel build options. Stop confusing people, retire COMPAT_LINUX and COMPAT_LINUX32 kernel build options. Since we have 32 and 64 bit Linux emulators, we can't build both emulators together into the kernel. I don't think it matters, Linux emulation depends on loadable modules (via rc). Cut LINPROCFS and LINSYSFS for consistency. PR: 215061 Reviewed by: bcr (manpages), trasz Differential Revision: https://reviews.freebsd.org/D30751 MFC after: 2 weeks (cherry picked from commit e013e36939ac87b53195370fb5e29f29c1a4b5c6) share/man/man4/aac.4 | 4 +--- share/man/man4/aacraid.4 | 4 +--- share/man/man4/tdfx.4 | 13 ++++++---- sys/amd64/conf/NOTES | 17 ------------- sys/conf/NOTES | 4 ++-- sys/conf/files | 5 ---- sys/conf/files.amd64 | 62 ------------------------------------------------ sys/conf/files.i386 | 57 -------------------------------------------- sys/conf/files.x86 | 1 - sys/conf/options.amd64 | 2 +- sys/i386/conf/NOTES | 16 ++----------- 11 files changed, 16 insertions(+), 169 deletions(-)