Il giorno ven, 27/09/2024 alle 03.57 +0000, WYKES, Jeremy ha scritto: > ... > I am seeking some help trying to build the ethercat master on Alma9. I am > trying to first just build the simplest configuration I can (i.e. not an RT > kernel), on a VMWare VM (not sure if this will create a problem). I have > installed kernel-devel and it looks like I have the kernel sources in > /usr/src/kernels/5.14.0-427.37.1.el9_4.x86_64 > > uname -srvmpio > Linux 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 > EDT 2024 x86_64 x86_64 x86_64 GNU/Linux > > Following the instructions: > > ./bootstrap > ./configure --with-linux-dir=/usr/src/kernels/5.14.0- > 427.37.1.el9_4.x86_64 --enable-generic > make > make modules > > The build fails with: > > In file included from ./include/linux/linkage.h:7, > from ./include/linux/kernel.h:8, > from ./include/linux/list.h:9, > from ./include/linux/module.h:12, > from /opt/igh/etherlab/master/module.c:28: > /opt/igh/etherlab/master/module.c: In function ‘ec_init_module’: > ./include/linux/export.h:17:22: error: passing argument 1 of ‘class_create’ > from incompatible pointer type [-Werror=incompatible-pointer-types] > 17 | #define THIS_MODULE (&__this_module) > | ~^~~~~~~~~~~~~~~ > | | > | struct module * > /opt/igh/etherlab/master/module.c:115:26: note: in expansion of macro > ‘THIS_MODULE’ > 115 | class = class_create(THIS_MODULE, "EtherCAT"); > | ^~~~~~~~~~~ > In file included from ./include/linux/device.h:31, > from /opt/igh/etherlab/master/module.c:29: > ./include/linux/device/class.h:230:54: note: expected ‘const char *’ but > argument is of type ‘struct module *’ > 230 | struct class * __must_check class_create(const char *name); > | ~~~~~~~~~~~~^~~~ > /opt/igh/etherlab/master/module.c:115:13: error: too many arguments to > function ‘class_create’ > 115 | class = class_create(THIS_MODULE, "EtherCAT"); > | ^~~~~~~~~~~~ > In file included from ./include/linux/device.h:31, > from /opt/igh/etherlab/master/module.c:29: > ./include/linux/device/class.h:230:29: note: declared here > 230 | struct class * __must_check class_create(const char *name); > | ^~~~~~~~~~~~ > cc1: some warnings being treated as errors > make[3]: *** [scripts/Makefile.build:299: /opt/igh/etherlab/master/module.o] > Error 1 > make[2]: *** [scripts/Makefile.build:585: /opt/igh/etherlab/master] Error 2 > make[1]: *** [Makefile:1936: /opt/igh/etherlab] Error 2 > make[1]: Leaving directory '/usr/src/kernels/5.14.0-427.37.1.el9_4.x86_64' > make: *** [Makefile:957: modules] Error 2 > ...
Hi Jeremy, linux 6.4 has removed the `THIS_MODULE` argument. See the following merge request for details: https://gitlab.com/etherlab.org/ethercat/-/merge_requests/73 No idea why your 5.14.0 kernel behaves like a 6.4 one: maybe they backported 1aaba11da9aa or the linux headers you are including are for some reason part of a linux kernel >= 6.4. In both cases, apart from manually modifying the EtherCAT code, I don't know how to solve properly. Ciao. -- Nicola -- Etherlab-users mailing list Etherlab-users@etherlab.org https://lists.etherlab.org/mailman/listinfo/etherlab-users