LLNL / msr-safe

Allows safer access to model specific registers (MSRs)
GNU General Public License v2.0
92 stars 26 forks source link

error: assignment from incompatible pointer type msr_class->devnode = msr_devnode; #160

Open brandonbiggs opened 4 months ago

brandonbiggs commented 4 months ago

Hi,

I'm trying to build msr-safe per the instructions in the README and I'm getting an error. It seems pretty straight forward. I'm not sure if I'm missing something, but it seems like I'm running into an issue. Let me know if there's any other information I can provide that might help.

[root@server: /opt ]
# git clone https://github.com/LLNL/msr-safe
Cloning into 'msr-safe'...
remote: Enumerating objects: 1694, done.
remote: Counting objects: 100% (321/321), done.
remote: Compressing objects: 100% (125/125), done.
remote: Total 1694 (delta 263), reused 204 (delta 196), pack-reused 1373
Receiving objects: 100% (1694/1694), 5.87 MiB | 19.15 MiB/s, done.
Resolving deltas: 100% (1063/1063), done.
[root@server: /opt ]
# cd msr-safe/
[root@server: (main) /opt/msr-safe ]
# make
cc  -DVERSION=\"1.7.0\" -fPIC -c msrsave/msrsave_main.c -o msrsave/msrsave_main.o
cc  -DVERSION=\"1.7.0\" -fPIC -c msrsave/msrsave.c -o msrsave/msrsave.o
cc  -DVERSION=\"1.7.0\" msrsave/msrsave_main.o msrsave/msrsave.o -o msrsave/msrsave
make -C /lib/modules/4.18.0-513.24.1.el8_9.x86_64/build M=/opt/msr-safe modules
make[1]: Entering directory '/usr/src/kernels/4.18.0-513.24.1.el8_9.x86_64'
  CC [M]  /opt/msr-safe/msr_entry.o
/opt/msr-safe/msr_entry.c: In function ‘msr_init’:
/opt/msr-safe/msr_entry.c:332:24: error: assignment to ‘char * (*)(const struct device *, umode_t *)’ {aka ‘char * (*)(const struct device *, short unsigned int *)’} from incompatible pointer type ‘char * (*)(struct device *, umode_t *)’ {aka ‘char * (*)(struct device *, short unsigned int *)’} [-Werror=incompatible-pointer-types]
     msr_class->devnode = msr_devnode;
                        ^
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:318: /opt/msr-safe/msr_entry.o] Error 1
make[1]: *** [Makefile:1619: _module_/opt/msr-safe] Error 2
make[1]: Leaving directory '/usr/src/kernels/4.18.0-513.24.1.el8_9.x86_64'
make: *** [Makefile:19: all] Error 2

Information about my system: OS Rocky 8.9

Rocky Linux release 8.9 (Green Obsidian)
NAME="Rocky Linux"
VERSION="8.9 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.9"
PLATFORM_ID="platform:el8"

Kernel:

# uname -a
Linux servername 4.18.0-513.24.1.el8_9.x86_64 #1 SMP Thu Apr 4 18:13:02 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Make version:

# make --version
GNU Make 4.2.1

Dual Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz

brandonbiggs commented 4 months ago

I went through other issues and pull requests and found that someone had fixed it and submitted a PR - https://github.com/LLNL/msr-safe/pull/158. Testing with these changes seems to fix the issue.

tpatki commented 4 months ago

Thanks for testing with the PR #158 and glad that fixed the issue for you!