Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not buildable on i686 #550

Closed
mikhailnov opened this issue Aug 6, 2023 · 8 comments
Closed

Not buildable on i686 #550

mikhailnov opened this issue Aug 6, 2023 · 8 comments
Assignees
Labels
accepting PRs it's unlikely that this issue will be fixed by us, but PRs are welcome. (btw PRs are always welcome) kind:regression topic:kernel things regarding the actual kernel module

Comments

@mikhailnov
Copy link

mikhailnov commented Aug 6, 2023

Latest HEAD - 9ba7e29 - is buildable on x86_64 and aarch64, but is not on i686 (x86_32):

ERROR: modpost: "__moddi3" [/root/v4l2loopback/v4l2loopback.ko] undefined!

I do not see where __moddi3 gets from.

Actually nobody is going to use it on i686, so it is not a big problem.

Bigger log:

# make V=1
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/root/v4l2loopback KCPPFLAGS="" modules
make[1]: вход в каталог «/usr/src/linux-6.1.38-generic-1rosa2021.1-i686»
make -f ./scripts/Makefile.build obj=/root/v4l2loopback need-builtin=1 need-modorder=1 
  gcc -Wp,-MMD,/root/v4l2loopback/.v4l2loopback.o.d -nostdinc -I./arch/x86/include -I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu11 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m32 -msoft-float -mregparm=3 -freg-struct-return -fno-pic -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -Wa,-mtune=generic32 -ffreestanding -mstack-protector-guard-reg=fs -mstack-protector-guard-symbol=__stack_chk_guard -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-stack-clash-protection -fzero-call-used-regs=used-gpr -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-array-bounds -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -g -gdwarf-4  -DMODULE  -DKBUILD_BASENAME='"v4l2loopback"' -DKBUILD_MODNAME='"v4l2loopback"' -D__KBUILD_MODNAME=kmod_v4l2loopback -c -o /root/v4l2loopback/v4l2loopback.o /root/v4l2loopback/v4l2loopback.c  
  ./scripts/check-local-export /root/v4l2loopback/v4l2loopback.o
  if nm /root/v4l2loopback/v4l2loopback.o 2>/dev/null | grep -q __ksymtab; then gcc -E -D__GENKSYMS__ -Wp,-MMD,/root/v4l2loopback/.v4l2loopback.o.d -nostdinc -I./arch/x86/include -I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu11 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m32 -msoft-float -mregparm=3 -freg-struct-return -fno-pic -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -Wa,-mtune=generic32 -ffreestanding -mstack-protector-guard-reg=fs -mstack-protector-guard-symbol=__stack_chk_guard -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-stack-clash-protection -fzero-call-used-regs=used-gpr -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-array-bounds -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -g -gdwarf-4  -DMODULE  -DKBUILD_BASENAME='"v4l2loopback"' -DKBUILD_MODNAME='"v4l2loopback"' -D__KBUILD_MODNAME=kmod_v4l2loopback /root/v4l2loopback/v4l2loopback.c | scripts/genksyms/genksyms   -r /dev/null >> /root/v4l2loopback/.v4l2loopback.o.cmd; fi
  {   echo /root/v4l2loopback/v4l2loopback.ko; :; } > /root/v4l2loopback/modules.order
sh ./scripts/modules-check.sh /root/v4l2loopback/modules.order
make -f ./scripts/Makefile.modpost
   sed 's/ko$/o/'  /root/v4l2loopback/modules.order | scripts/mod/modpost -m -a    -o /root/v4l2loopback/Module.symvers -e -i Module.symvers -T - 
ERROR: modpost: "__moddi3" [/root/v4l2loopback/v4l2loopback.ko] undefined!

I'm not sure that the problem is in v4l2loopback.

@mikhailnov
Copy link
Author

mikhailnov commented Aug 6, 2023

The latest commit on which a 32 bit kernel module for kernel 6.1 is buildable is b92e9ce

@mikhailnov
Copy link
Author

So, commit 9f51281 broke 32 bit

@pfactum
Copy link
Contributor

pfactum commented Sep 9, 2023

Does this:

diff --git a/drivers/media/v4l2-core/v4l2loopback.c b/drivers/media/v4l2-core/v4l2loopback.c
index 4659bdf7ebea..012bbcb11173 100644
--- a/drivers/media/v4l2-core/v4l2loopback.c
+++ b/drivers/media/v4l2-core/v4l2loopback.c
@@ -1541,7 +1541,7 @@ static int vidioc_reqbufs(struct file *file, void *fh,
 {
 	struct v4l2_loopback_device *dev;
 	struct v4l2_loopback_opener *opener;
-	int i;
+	int i, t;
 	MARK();
 
 	dev = v4l2loopback_getdevice(file);
@@ -1594,7 +1594,8 @@ static int vidioc_reqbufs(struct file *file, void *fh,
 
 			/* after we update dev->used_buffers, buffers in outbufs_list will
 			 * correspond to dev->write_position + [0;b->count-1] range */
-			i = dev->write_position % b->count;
+			t = dev->write_position;
+			i = do_div(t, b->count);
 			list_for_each_entry(pos, &dev->outbufs_list,
 					    list_head) {
 				dev->bufpos2index[i % b->count] =

fix the issue?

@mikhailnov
Copy link
Author

No, it did not fix i686 builds

https://abf.io/build_lists/4681832
https://file-store.rosalinux.ru/api/v1/file_stores/7171b89d5a59138e3053993e5dc41928b58c60ce.log?show=true
DEBUG: ERROR: modpost: "__moddi3" [/builddir/build/BUILD/v4l2loopback-9ba7e294ea6f45410a15f192381d4918e8df4f02/v4l2loopback.ko] undefined!

@pfactum

This comment was marked as off-topic.

@mikhailnov

This comment was marked as off-topic.

@umlaeute

This comment was marked as off-topic.

@umlaeute umlaeute added accepting PRs it's unlikely that this issue will be fixed by us, but PRs are welcome. (btw PRs are always welcome) topic:kernel things regarding the actual kernel module kind:regression and removed needs triage new issues labels Dec 29, 2023
@mikhailnov
Copy link
Author

Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting PRs it's unlikely that this issue will be fixed by us, but PRs are welcome. (btw PRs are always welcome) kind:regression topic:kernel things regarding the actual kernel module
Projects
None yet
Development

No branches or pull requests

3 participants