patacongo edited a comment on pull request #1341: URL: https://github.com/apache/incubator-nuttx/pull/1341#issuecomment-652442424
> > Look how I did the pthread startup function in PR #1328. This is EXACTLY the same issue. I created a user-space pthread_startup (NOT and OS startup function) in libs/libc/pthread/pthread_create.c. This is exactly the kind of user-space startup function that you need: It runs in user mode with interrupts enabled. > > The same approach is workable for ELF binary. But how do we handle the builtin apps, do you have the idea to avoid nxtask_start in this case? In the FLAT build, there is only one set constructors. It does not matter how many built-in tasks there are, the constructors only have to be called once. Each separately linked blob will have one set of C++ constructors and must have its C++ constructors called exactly once. Currently the C++ constructors may be initialized in many places under apps/: examples/elf/elf_main.c: up_cxxinitialize(); examples/helloxx/helloxx_main.cxx: up_cxxinitialize(); examples/nxterm/nxterm_main.c: up_cxxinitialize(); graphics/nxwm/src/nxwm_main.cxx: up_cxxinitialize(); graphics/twm4nx/src/twm4nx_main.cxx: up_cxxinitialize(); Since the constructors will always be called in nxtask_startup(), I think these are now all bugs. We should also get rid of all occurrences of up_cxxinitialize(). ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
