Open Khyretos opened 3 years ago
Same Issue on kernel 5.14 on Manjaro
This log isn't very useful since the compiler output is being hidden.
I got a similar message on 5.19.1-3-MANJARO.
I think one of the reasons is that get_fs
function is deprecated since Linux 5.10, (and I found error: implicit declaration of function ‘get_fs’; did you mean ‘sget_fc’? [-Werror=implicit-function-declaration]
actually). We need to change get_fs and set_fs to kernel_read
as https://github.com/Xilinx/dma_ip_drivers/pull/142/ did.
After I replace them, I got storage size of timespec isn't known
error. I found a case with the same error message, but I don't know if this solution is the right one.
https://stackoverflow.com/questions/42597685/storage-size-of-timespec-isnt-known
https://stackoverflow.com/questions/3875197/gcc-with-std-c99-complains-about-not-knowing-struct-timespec
And I got
implicit declaration of function ‘ktime_get_ts’; did you mean ‘ktime_get_ns’? []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Werror=implicit-function-declaration]8;;]
error.
Replacing it with ktime_get(or ktime_get_64)
will solve the problem.
https://www.virtualbox.org/ticket/19312
https://www.kernel.org/doc/html/latest/core-api/timekeeping.html#deprecated-time-interfaces
We should replace timespec
to timespec64
also (https://lore.kernel.org/lkml/20191213205417.3871055-5-arnd@arndb.de/).
Finally I got error same as #11, I'll leave the code that fixes the above problem so you can check it out. Please fix or give me some hints about #11 if you could.
LOL, but I missed this one #4 . Almost all solutions I wrote above is already founded. However, it is good to confirm that this method probably works on Arch or Manjaro.
After I remove vfs_stat
to avoid this error, ./build.sh return 0.
I got a similar message on 5.19.1-3-MANJARO. I think one of the reasons is that
get_fs
function is deprecated since Linux 5.10, (and I founderror: implicit declaration of function ‘get_fs’; did you mean ‘sget_fc’? [-Werror=implicit-function-declaration]
actually). We need to change get_fs and set_fs tokernel_read
as Xilinx/dma_ip_drivers#142 did. After I replace them, I gotstorage size of timespec isn't known
error. I found a case with the same error message, but I don't know if this solution is the right one. https://stackoverflow.com/questions/42597685/storage-size-of-timespec-isnt-known https://stackoverflow.com/questions/3875197/gcc-with-std-c99-complains-about-not-knowing-struct-timespec
Hi,
I tried to replace get_fs() and set_fs() with kernel_read() and kernel_write(), but I got these 3 errors:
/home/dvukadin/work/lg4k-linux/driver/utils/misc/sys.c: In function ‘sys_fread’:
/home/dvukadin/work/lg4k-linux/driver/utils/misc/sys.c:379:9: error: too few arguments to function ‘kernel_read’
379 | fs =kernel_read();
/home/dvukadin/work/lg4k-linux/driver/utils/misc/sys.c:380:18: error: ‘KERNEL_DS’ undeclared (first use in this function); did you mean ‘KERNFS_NS’?
380 | kernel_write(KERNEL_DS);
/home/dvukadin/work/lg4k-linux/driver/utils/misc/sys.c:380:5: error: too few arguments to function ‘kernel_write’
380 | kernel_write(KERNEL_DS);
Could you help me with this, please? Thanks a lot.
ssize_t __kernel_read(struct file *file, void *buf, size_t count, loff_t *pos);
This is not a drop in replacement the method signatures are not similar.
It looks like you would call kernel_read
here:
vfs_read(fp, buf, count, &pos);
But I'm not sure what the implications of changing this line are, it's clear that other parts of the code would need to be udpated.
@dextroza @Renari
I don't remember clearly why I used kernel_read
because this was my first device driver update, and I haven't touched it for a while, but I saw the same error message on Reddit and someone told me to change 'get_fs' to that somewhere. But after making the change and running it for a while, it eventually stopped working after 5 or 10 min. There might be a more appropriate way. I don't usually touch anything close to the kernel, but anyone familiar with it should be able to find the proper method and its arguments by looking for the merge commit in question in the 5.10 onwards update history.
Besides, Linux 6.7 is the latest one, so additional things may be fixed.
here is the log: