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

Fix build on Linux 6.12 #112

Merged
merged 1 commit into from
Nov 24, 2024
Merged

Fix build on Linux 6.12 #112

merged 1 commit into from
Nov 24, 2024

Conversation

zaps166
Copy link
Contributor

@zaps166 zaps166 commented Nov 18, 2024

No description provided.

@berarma
Copy link
Owner

berarma commented Nov 19, 2024

Please, what's the error message? I haven't tried yet.

@zaps166
Copy link
Contributor Author

zaps166 commented Nov 19, 2024

@berarma

Error message:

/var/lib/dkms/new-lg4ff/0.3.3.r33.g1a2d572/build/hid-lg.c:936:25: error: initialization of ‘const __u8 * (*)(struct hid_device *, __u8 *, unsigned int *)’ {aka ‘const unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)’} from incompatible pointer type ‘__u8 * (*)(struct hid_device *, __u8 *, unsigned int *)’ {aka ‘unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)’} [-Wincompatible-pointer-types]
  936 |         .report_fixup = lg_report_fixup,
      |                         ^~~~~~~~~~~~~~~
/var/lib/dkms/new-lg4ff/0.3.3.r33.g1a2d572/build/hid-lg.c:936:25: note: (near initialization for ‘lg_driver.report_fixup’)

@berarma
Copy link
Owner

berarma commented Nov 19, 2024

It seems you've tested with version 0.3.3 but the PR is against the master branch. Have you tried building the master branch?

@zaps166
Copy link
Contributor Author

zaps166 commented Nov 19, 2024

It seems you've tested with version 0.3.3 but the PR is against the master branch. Have you tried building the master branch?

Something is wrong with AUR package version, becuse it refers to 0.3.3 version (0.3.3 has 33 commits to master branch 0.3.3.r33 and the hash is from master: 1a2d572).

Here is 6.12 header: https://github.com/torvalds/linux/blob/adc218676eef25575469234709c2d87185ca223a/include/linux/hid.h#L825

Here is 6.11 header: https://github.com/torvalds/linux/blob/98f7e32f20d28ec452afb208f9cffc08448a2652/include/linux/hid.h#L825

Difference: const in return value.

@zaps166
Copy link
Contributor Author

zaps166 commented Nov 19, 2024

Currently I don't have any wheel to check if it really works, but when I add const which matches the new header, it compiles.

@amadejkastelic
Copy link

Same issue on 0.4.0:

error: builder for '/nix/store/y5p35mk56zjjfx1df5rwqs52f850zp9q-new-lg4ff-0.4.0.drv' failed with exit code 2;
       last 23 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/59g7syv2ynah88g8x02k56ca6fqqnl46-source
       > source root is source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > substituteStream() in derivation new-lg4ff-0.4.0: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. (file 'Makefile')
       > build flags: SHELL=/nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash KVERSION=6.12.0-cachyos KDIR=/nix/store/m34giai1yhb7l4qsix1i1vi2d3rz9bvh-linux-6.12.0-dev/lib/modules/6.12.0-cachyos/build
       > make -C /nix/store/m34giai1yhb7l4qsix1i1vi2d3rz9bvh-linux-6.12.0-dev/lib/modules/6.12.0-cachyos/build M=$PWD
       > make[1]: Entering directory '/nix/store/m34giai1yhb7l4qsix1i1vi2d3rz9bvh-linux-6.12.0-dev/lib/modules/6.12.0-cachyos/build'
       >   CC [M]  /build/source/hid-lg.o
       > /build/source/hid-lg.c:954:25: error: initialization of 'const __u8 * (*)(struct hid_device *, __u8 *, unsigned int *)' {aka 'const unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)'} from incompatible pointer type '__u8 * (*)(struct hid_device *, __u8 *, unsigned int *)' {aka 'unsigned char * (*)(struct hid_device *, unsigned char *, unsigned int *)'} [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Werror=incompatible-pointer-types8;;]
       >   954 |         .report_fixup = lg_report_fixup,
       >       |                         ^~~~~~~~~~~~~~~
       > /build/source/hid-lg.c:954:25: note: (near initialization for 'lg_driver.report_fixup')
       > cc1: some warnings being treated as errors
       > make[3]: *** [/nix/store/m34giai1yhb7l4qsix1i1vi2d3rz9bvh-linux-6.12.0-dev/lib/modules/6.12.0-cachyos/source/scripts/Makefile.build:229: /build/source/hid-lg.o] Error 1
       > make[2]: *** [/nix/store/m34giai1yhb7l4qsix1i1vi2d3rz9bvh-linux-6.12.0-dev/lib/modules/6.12.0-cachyos/source/Makefile:1946: /build/source] Error 2
       > make[1]: *** [/nix/store/m34giai1yhb7l4qsix1i1vi2d3rz9bvh-linux-6.12.0-dev/lib/modules/6.12.0-cachyos/source/Makefile:224: __sub-make] Error 2
       > make[1]: Leaving directory '/nix/store/m34giai1yhb7l4qsix1i1vi2d3rz9bvh-linux-6.12.0-dev/lib/modules/6.12.0-cachyos/build'
       > make: *** [Makefile:5: default] Error 2
       For full logs, run 'nix log /nix/store/y5p35mk56zjjfx1df5rwqs52f850zp9q-new-lg4ff-0.4.0.drv'.
error: 1 dependencies of derivation '/nix/store/f5m8ynikwk3jjl6yvpdfcp9w9q68fndq-linux-6.12.0-modules.drv' failed to build

@stele95
Copy link

stele95 commented Nov 24, 2024

Same issue here since release of the 6.12 kernel. I've tested the fix with Logitech G29 in ETS2 and it builds and works as expected.

@berarma berarma merged commit 6100a34 into berarma:master Nov 24, 2024
@berarma
Copy link
Owner

berarma commented Nov 24, 2024

Thanks @zaps166 for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants