Skip to content

[EXPERIMENTAL] Makefile: EXTRA_APPS_LIBS and EXTRA_APPS_INCPATHS vars #3154

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zdebanos
Copy link
Contributor

@zdebanos zdebanos commented Aug 9, 2025

The variables are to be used to mainly by the export rule to export external libraries (.a files) and respective include paths.

The exported external libraries are packed together in the libapps.a library (basically, every .o files are extracted and then packed together).

Signed-off-by: Stepan Pressl [email protected]

Summary

Improving the build system with these variables so all the symbols from the external libraries can be packed together within the libapps.a library. This is particularly useful, when we'd like to use this external library and all of its symbols in the nuttx export.

I'm not expecting to be this merged, yet. But I'd like to start a debate over possible solutions and discuss other solutions and improvements. I'm thinking about generalizing the variables over multiple Makefiles, so any directory in the NuttX project would have some kind of a variable. Or possibly only one variable.

A different way of doing this is to just all of these libraries separately, and not withing libapps.a, etc.

Also, external libraries are, in the current state, linked using the EXTRA_LIBS variable. But that is done only in the last stage of the build and the linker only picks symbols that are needed. In the end, the exported library only has a subset of all the symbols.

Also cmake support must be added.

@acassis
Copy link
Contributor

acassis commented Aug 9, 2025

@zdebanos I suggest converting it to Draft until we have an equivalent support to CMakefile to avoid build system asymmetry.

@cederom cederom marked this pull request as draft August 9, 2025 13:52
@cederom
Copy link
Contributor

cederom commented Aug 9, 2025

Thanks @zdebanos, converted PR to Draft as suggested by @acassis, when all is set we will mark it ready for review :-)

@zdebanos
Copy link
Contributor Author

zdebanos commented Aug 13, 2025

I also forgot to mention one problem I've come accross. I've found out that the $(AR) variable in the nuttx build system is set to ar rcs on Unix. Shouldn't it be rather ar, only? In this commit, i need to use ar x.

Currently in this commit, ar is used directly. But that makes it compatible only with Unix. What do you think?
The simplest fix is to create a new variable $(ARX), which will be ar x and $(AR) just stays ar rcs, so we don't break anything.

@cederom
Copy link
Contributor

cederom commented Aug 13, 2025

Yup, the same for SED it is set to just sed. It works on Linux, but on BSD sed is "bsd sed" and gsed (GNU sed compatible with Linux one), we should also add SED variable for sed :D Can you make one please if you work on this already? ./tools/configure.sh switch can be used to set SED=gsed if -B switch is present, and SED=sed otherwise :-)

@zdebanos
Copy link
Contributor Author

zdebanos commented Aug 13, 2025

Does Nuttx actually support the export target in cmake as of today?

@cederom
Copy link
Contributor

cederom commented Aug 13, 2025

@zdebanos: Does Nuttx actually support the export target in cmake as of today?

I am Make user, sorry, maybe @raiden00pl will know? :-)

The variables are to be used to mainly by the export rule
to export external libraries (.a files) and respective include paths.

The exported external libraries are packed together in the libapps.a
library (basically, every .o files are extracted and then packed
together).

Signed-off-by: Stepan Pressl <[email protected]>
@acassis
Copy link
Contributor

acassis commented Aug 13, 2025

Does Nuttx actually support the export target in cmake as of today?

I think it is not supported yet, cmake is relatively new on NuttX and it is not the official building system (maybe it could become in the future or maybe not) :-)

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

Successfully merging this pull request may close these issues.

3 participants