yf13 opened a new pull request, #15694:
URL: https://github.com/apache/nuttx/pull/15694

   # Summary
   
   This adds exported LDMODULEFLAGS so that kernel modules can build with 
Kernel mode NuttX. Without it, we have link errors like:
   
   ```sh
   make[3]: Entering directory '/tmp/apps/examples/module/chardev'
   LD:  /tmp/apps/bin/chardev arm-none-eabi-ld: warning: cannot find entry 
symbol _start; defaulting to 0000000000008000
   arm-none-eabi-ld: chardev.c.tmp.apps.examples.module.chardev.o: in function 
`module_uninitialize':
   /tmp/apps/examples/module/chardev/chardev.c:111: undefined reference to 
`unregister_driver'
   arm-none-eabi-ld: chardev.c.tmp.apps.examples.module.chardev.o: in function 
`module_initialize':
   /tmp/apps/examples/module/chardev/chardev.c:129: undefined reference to 
`register_driver'
   arm-none-eabi-ld: /tmp/apps/import/startup/crt0.o: in function `__start':
   /tmp/nuttx/arch/arm/src/armv7-a/crt0.c:133: undefined reference to `main'
   make[3]: *** [/tmp/apps/Application.mk:308: /tmp/apps/bin/chardev] Error 1
   ```
   
   It also stops exporting LDELFFLAGS as it contains NuttX side paths:
   
   ```sh
   $ fgrep LDELFFLAGS apps/import/scripts/Make.defs
   LDELFFLAGS = -e main -T /tmp/nuttx/libs/libc/modlib/gnu-elf.ld
   ```
   
   By design, exported SDK shall not refer to NuttX folder any more, and the 
link scripts under `apps/import/` should suffice.
   
   # Impacts
   
   Projects using export SDK
   
   # Testing
   
   - local checks with EXAMPLES_MODULE enabled qemu-armv7a:nsh and 
qemu-armv7a:knsh
   - CI checks
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to