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

'kubntd/qcom-sdm660-6.11.y-clover-plus-wip ' Branch compilation error. #46

Open
MG0626 opened this issue Dec 19, 2024 · 4 comments
Open

Comments

@MG0626
Copy link

MG0626 commented Dec 19, 2024

I pulled the current branch and tried to compile it, but the following error occurred.

make[1]: *** [/home/cmg/workspace/linux/Makefile:1926:.] ERROR 2
make: *** [Makefile:224:__sub-make] ERROR 2

Is there any syntax error in the Makefile file?

@minlexx
Copy link
Member

minlexx commented Dec 20, 2024

This doesn't look like full error message, the error should be above those

@minlexx
Copy link
Member

minlexx commented Dec 24, 2024

Do you see this?

  LD [M]  net/qrtr/qrtr.o
  CC [M]  net/qrtr/smd.o
  CC [M]  net/qrtr/tun.o
In file included from ../net/qrtr/smd.c:7:
../include/linux/module.h:131:49: error: redefinition of ‘__inittest’
  131 |         static inline initcall_t __maybe_unused __inittest(void)                \
      |                                                 ^~~~~~~~~~
../include/linux/device/driver.h:262:1: note: in expansion of macro ‘module_init’
  262 | module_init(__driver##_init); \
      | ^~~~~~~~~~~
../include/linux/rpmsg.h:349:9: note: in expansion of macro ‘module_driver’
  349 |         module_driver(__rpmsg_driver, register_rpmsg_driver, \
      |         ^~~~~~~~~~~~~
../net/qrtr/smd.c:325:1: note: in expansion of macro ‘module_rpmsg_driver’
  325 | module_rpmsg_driver(qcom_smd_qrtr_driver);
      | ^~~~~~~~~~~~~~~~~~~
../include/linux/module.h:131:49: note: previous definition of ‘__inittest’ with type ‘int (*(void))(void)’
  131 |         static inline initcall_t __maybe_unused __inittest(void)                \
      |                                                 ^~~~~~~~~~
../include/linux/module.h:117:41: note: in expansion of macro ‘module_init’
  117 | #define subsys_initcall(fn)             module_init(fn)
      |                                         ^~~~~~~~~~~
../net/qrtr/smd.c:322:1: note: in expansion of macro ‘subsys_initcall’
  322 | subsys_initcall(qcom_smd_qrtr_init);
      | ^~~~~~~~~~~~~~~
../include/linux/module.h:133:13: error: redefinition of ‘init_module’
  133 |         int init_module(void) __copy(initfn)                    \
      |             ^~~~~~~~~~~
../include/linux/device/driver.h:262:1: note: in expansion of macro ‘module_init’
  262 | module_init(__driver##_init); \
      | ^~~~~~~~~~~
../include/linux/rpmsg.h:349:9: note: in expansion of macro ‘module_driver’
  349 |         module_driver(__rpmsg_driver, register_rpmsg_driver, \
      |         ^~~~~~~~~~~~~
../net/qrtr/smd.c:325:1: note: in expansion of macro ‘module_rpmsg_driver’
  325 | module_rpmsg_driver(qcom_smd_qrtr_driver);
      | ^~~~~~~~~~~~~~~~~~~
../include/linux/module.h:133:13: note: previous definition of ‘init_module’ with type ‘int(void)’
  133 |         int init_module(void) __copy(initfn)                    \
      |             ^~~~~~~~~~~
../include/linux/module.h:117:41: note: in expansion of macro ‘module_init’
  117 | #define subsys_initcall(fn)             module_init(fn)
      |                                         ^~~~~~~~~~~
../net/qrtr/smd.c:322:1: note: in expansion of macro ‘subsys_initcall’
  322 | subsys_initcall(qcom_smd_qrtr_init);
      | ^~~~~~~~~~~~~~~
../include/linux/module.h:139:49: error: redefinition of ‘__exittest’
  139 |         static inline exitcall_t __maybe_unused __exittest(void)                \
      |                                                 ^~~~~~~~~~
../include/linux/device/driver.h:267:1: note: in expansion of macro ‘module_exit’
  267 | module_exit(__driver##_exit);
      | ^~~~~~~~~~~
../include/linux/rpmsg.h:349:9: note: in expansion of macro ‘module_driver’
  349 |         module_driver(__rpmsg_driver, register_rpmsg_driver, \
      |         ^~~~~~~~~~~~~
../net/qrtr/smd.c:325:1: note: in expansion of macro ‘module_rpmsg_driver’
  325 | module_rpmsg_driver(qcom_smd_qrtr_driver);
      | ^~~~~~~~~~~~~~~~~~~
../include/linux/module.h:139:49: note: previous definition of ‘__exittest’ with type ‘void (*(void))(void)’
  139 |         static inline exitcall_t __maybe_unused __exittest(void)                \
      |                                                 ^~~~~~~~~~
../net/qrtr/smd.c:323:1: note: in expansion of macro ‘module_exit’
  323 | module_exit(qcom_smd_qrtr_exit);
      | ^~~~~~~~~~~
../include/linux/module.h:141:14: error: redefinition of ‘cleanup_module’
  141 |         void cleanup_module(void) __copy(exitfn)                \
      |              ^~~~~~~~~~~~~~
../include/linux/device/driver.h:267:1: note: in expansion of macro ‘module_exit’
  267 | module_exit(__driver##_exit);
      | ^~~~~~~~~~~
../include/linux/rpmsg.h:349:9: note: in expansion of macro ‘module_driver’
  349 |         module_driver(__rpmsg_driver, register_rpmsg_driver, \
      |         ^~~~~~~~~~~~~
../net/qrtr/smd.c:325:1: note: in expansion of macro ‘module_rpmsg_driver’
  325 | module_rpmsg_driver(qcom_smd_qrtr_driver);
      | ^~~~~~~~~~~~~~~~~~~
../include/linux/module.h:141:14: note: previous definition of ‘cleanup_module’ with type ‘void(void)’
  141 |         void cleanup_module(void) __copy(exitfn)                \
      |              ^~~~~~~~~~~~~~
../net/qrtr/smd.c:323:1: note: in expansion of macro ‘module_exit’
  323 | module_exit(qcom_smd_qrtr_exit);
      | ^~~~~~~~~~~
make[5]: *** [../scripts/Makefile.build:244: net/qrtr/smd.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [../scripts/Makefile.build:485: net/qrtr] Error 2
make[3]: *** [../scripts/Makefile.build:485: net] Error 2
make[3]: *** Waiting for unfinished jobs....

@kubntd
Copy link

kubntd commented Dec 25, 2024

You should set CONFIG_QRTR=y and CONFIG_QRTR_SMD=y to workaround this error

@minlexx
Copy link
Member

minlexx commented Dec 26, 2024

This diff makes it compile as module

diff --git a/net/qrtr/smd.c b/net/qrtr/smd.c
index 55dea9389ad3..2bd569188ad5 100644
--- a/net/qrtr/smd.c
+++ b/net/qrtr/smd.c
@@ -319,10 +319,11 @@ static void __exit qcom_smd_qrtr_exit(void)
        unregister_rpmsg_driver(&qcom_smd_qrtr_driver);
 }
 
-subsys_initcall(qcom_smd_qrtr_init);
+//subsys_initcall(qcom_smd_qrtr_init);
+module_init(qcom_smd_qrtr_init);
 module_exit(qcom_smd_qrtr_exit);
 
-module_rpmsg_driver(qcom_smd_qrtr_driver);
+//module_rpmsg_driver(qcom_smd_qrtr_driver);
 
 MODULE_ALIAS("rpmsg:IPCRTR");
 MODULE_DESCRIPTION("Qualcomm IPC-Router SMD interface driver");

but then:

  DEPMOD  ./INSTALL_PREFIX/lib/modules/6.11.11-sdm660
depmod: ERROR: Cycle detected: qrtr -> qrtr_smd -> qrtr
depmod: ERROR: Found 2 modules in dependency cycles!
make[3]: *** [../scripts/Makefile.modinst:128: depmod] Error 1

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

No branches or pull requests

3 participants