After r367395 linux_common.ko uses linux_dummy.c that uses LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); However LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); is compiled in linux_misc.c, that build with linux64.ko. But linux64.ko depends on linux_misc, so it cannot be loaded before linux_common.ko dmesg log: link_elf_obj: symbol sdt_provider_linuxulator undefined linker_load_file: /boot/kernel/linux_common.ko - unsupported file type KLD linux.ko: depends on linux_common - not available or version mismatch linker_load_file: /boot/kernel/linux.ko - unsupported file type link_elf_obj: symbol sdt_provider_linuxulator undefined linker_load_file: /boot/kernel/linux_common.ko - unsupported file type KLD linux64.ko: depends on linux_common - not available or version mismatch linker_load_file: /boot/kernel/linux64.ko - unsupported file type
(In reply to Oleg Sidorkin from comment #0) Correction (failed to read before posting, sorry): linux_common.ko uses linux_dummy.c uses LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); However LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE); is compiled in linux_misc.c, that build with linux64.ko. But linux64.ko depends on linux_common.ko, so it cannot be loaded before linux_common.ko
I've tried Conrad Meyer's patch, and it fixes some issues (linux_common loads), but there are still some other issues: # kldload -v linux kldload: an error occurred while loading module linux. Please check dmesg(8) for more details. Looking at /var/log/messages: kernel: link_elf_obj: symbol linux_vhangup undefined kernel: linker_load_file: /boot/kernel/linux.ko - unsupported file type
Huh, I do not have issue loading linux.ko with that patch.
Maybe I was testing an older version of the patch. Please try the new patch at the same phabricator link above.
I've got WITH_PIE=YES and WITH_BIND_NOW=YES set up, and that'll definitely find issues with normal libraries. It's undefined in linux.ko (+linux.ko.debug, linux.ko.full) and linux32_sysent.o (looking at files in /usr/obj/usr/src/amd64.amd64/sys/GENERIC/modules/usr/src/sys/modules/linux). I really haven't wrapped my head around the DUMMY() macros.
The version of the patch I was using was quite different... you'd just moved linux_dummy.c from the Makefile in linux_common to linux64. I'll try with your new patch.
These src.conf settings shouldn't have any effect on kernel modules. Are you looking at the earlier patch or the latest version? In the latest version, it is expected that linux.ko and linux64.ko have undefined references to e.g., linux_vhangup. The symbol is defined in linux_common.ko, which is required by both.
I'm recompiling with (just) diff2 now (when I grabbed your patch initially, there was just diff1). Does diff2 supersede diff1, or should I apply them both?
Thanks! Latest patch in phabricator supersedes.
Second version of the patch works for me
Works for me, works for Yasuhiro KIMURA (non-list email). The Nvidia driver depended on linux so it's fixed, and poudriere works again.
Thanks!
A commit references this bug: Author: cem Date: Fri Nov 6 22:04:58 UTC 2020 New revision: 367433 URL: https://svnweb.freebsd.org/changeset/base/367433 Log: linux(4): Fix loadable modules after r367395 Move dtrace SDT definitions into linux_common module code. Also, build linux_dummy.c into the linux_common kld -- we don't need separate versions of these stubs for 32- and 64-bit emulation. Reported by: several PR: 250897 Discussed with: emaste, trasz Tested by: John Kennedy, Yasuhiro KIMURA, Oleg Sidorkin X-MFC-With: r367395 Differential Revision: https://reviews.freebsd.org/D27124 Changes: head/sys/compat/linux/linux_common.c head/sys/compat/linux/linux_dummy.c head/sys/compat/linux/linux_misc.c head/sys/conf/files.i386
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a2760a540fbf38584798a057d43adb659e0bb50e commit a2760a540fbf38584798a057d43adb659e0bb50e Author: Conrad Meyer <cem@FreeBSD.org> AuthorDate: 2020-11-06 22:04:57 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2021-06-10 09:23:48 +0000 linux(4): Fix loadable modules after r367395 Move dtrace SDT definitions into linux_common module code. Also, build linux_dummy.c into the linux_common kld -- we don't need separate versions of these stubs for 32- and 64-bit emulation. Reported by: several PR: 250897 Discussed with: emaste, trasz Tested by: John Kennedy, Yasuhiro KIMURA, Oleg Sidorkin X-MFC-With: r367395 Differential Revision: https://reviews.freebsd.org/D27124 (cherry picked from commit 76b2bfeda42bbb686c74d3608dbc9b84b8e22e29) sys/compat/linux/linux_common.c | 15 +++++++++++++++ sys/compat/linux/linux_dummy.c | 12 +++++------- sys/compat/linux/linux_misc.c | 13 ------------- sys/conf/files.i386 | 1 + 4 files changed, 21 insertions(+), 20 deletions(-)