Hello! I am currently not able to kldload the ntfs kernel module. Trying so gives following error: link_elf: symbol memset undefined Trying to compile it in with options NTFS gives following error: linking kernel ntfs_vnops.o: In function `ntfs_readdir': ntfs_vnops.c:(.text+0x21b): undefined reference to `memset' ntfs_vnops.c:(.text+0x26b): undefined reference to `memset' ntfs_vnops.c:(.text+0x4f1): undefined reference to `memset' ntfs_vnops.c:(.text+0x54e): undefined reference to `memset' *** Error code 1 I can't reproduce this on FreeBSD 6.1, so I think this is Gentoo-specific. I am also not able to get anything out google regarding this. Portage 2.1.2_pre3-r2 (default-bsd/fbsd/6.1/x86, gcc-4.1.1, freebsd-lib-6.1-r0, 6.1-RELEASE i386) ================================================================= System uname: 6.1-RELEASE i386 i386 Gentoo Base System version 20060624 Last Sync: Mon, 16 Oct 2006 12:00:01 +0000 distcc 2.18.3 i686-gentoo-freebsd6.1 (protocols 1 and 2) (default port 3632) [disabled] app-admin/eselect-compiler: [Not Present] dev-java/java-config: [Not Present] dev-lang/python: 2.4.3-r4 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: [Not Present] sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r4 sys-devel/libtool: 1.5.22 virtual/os-headers: 6.1 ACCEPT_KEYWORDS="x86-fbsd ~x86-fbsd" AUTOCLEAN="yes" CBUILD="i686-gentoo-freebsd6.1" CFLAGS="-O2 -march=athlon-xp -pipe" CHOST="i686-gentoo-freebsd6.1" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-O2 -march=athlon-xp -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig collision-protect distlocks metadata-transfer sfperms strict" GENTOO_MIRRORS="ftp://pandemonium.tiscali.de/pub/gentoo/" LINGUAS="de" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/portage-alt-overlay /usr/local/portage/mesa" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86-fbsd 3dnow X acpi asf berkdb cli crypt dlloader dri elibc_FreeBSD gif gpg input_devices_keyboard input_devices_mouse jpeg jpeg2k kdeenablefinal kdehiddenvisibility kernel_FreeBSD linguas_de mesa mmx mp3 ncurses nls ogg oss pam pcre pdf perl pgp png python qt readline reflection session spl sqlite sse ssl suid svg tcpd tiff usb userland_BSD video_cards_ati video_cards_radeon video_cards_vesa vorbis wma wmf xorg xvid zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS As far as I can remember this also happend on 6.2beta2 kernel. But I am not sure.
It just came to my mind that FreeBSD uses 3.4.4 compiler on my other box where ntfs compiles fine. I'm going to check this.
Ok, I tried 3.4.6 now and the kernel compiled quite fine. So this seems gcc-4 related. Just for the cause I tried gcc-4.2.0-alpha20061014 too and the error still persists there. (In reply to comment #1) > It just came to my mind that FreeBSD uses 3.4.4 compiler on my other box where > ntfs compiles fine. I'm going to check this. >
Created attachment 99898 [details, diff] ntfs_vnops_gcc4.patch Patch that fixes the compilation of the kernel with gcc4.
Can you please apply the patch and test it? to apply just cd into /usr/src/sys (or wherever your kernel source is) and: patch -p1 < ntfs_vnops_gcc4.patch Then rebuild the kernel (it doesn't matter if you have options NTFS in the config) To test it mounting a ntfs filesystem, and doing a simple ls -alR on the mounted filesystem should suffice.
Your patch applied with 2 hunks and made the module load fine! Thank you very much!
ls -alR workes without problems, too.
Patch committed for freebsd-sources-6.1-r4, will make a patch for 6.2beta asap and close this bug afterwards.
Patch added to 6.2_beta2.