This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new ee07c9212f7 docs: describe shared library module declarations
ee07c9212f7 is described below

commit ee07c9212f723e2a3da84fc675bd74d6441ce51b
Author: aviralgarg05 <[email protected]>
AuthorDate: Mon Aug 17 18:52:10 2026 +0530

    docs: describe shared library module declarations
    
    Document the nuttx-apps BUILD_SHARED_LIBRARY interface and its supported 
module variables.
    
    Signed-off-by: aviralgarg05 <[email protected]>
---
 .../kernel_modules_vs_shared_libraries.rst         | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git 
a/Documentation/implementation/kernel_modules_vs_shared_libraries.rst 
b/Documentation/implementation/kernel_modules_vs_shared_libraries.rst
index 33c1d3e5f16..e945f98f09f 100644
--- a/Documentation/implementation/kernel_modules_vs_shared_libraries.rst
+++ b/Documentation/implementation/kernel_modules_vs_shared_libraries.rst
@@ -57,6 +57,31 @@ as the application that uses the shared library.
 So, they are shared in the sense that the ``.text`` is shared.
 
 
+Building a Shared Library
+=========================
+
+Applications can declare a loadable shared library with the Android.mk-style
+helper in ``nuttx-apps``. Include ``Make.defs``, set the module name and its C
+or C++ sources, then include ``BUILD_SHARED_LIBRARY``::
+
+  include $(APPDIR)/Make.defs
+
+  LOCAL_PATH := $(CURDIR)
+  LOCAL_MODULE := my-new-lib
+  LOCAL_SRC_FILES := my-source-file.cpp another-file.cpp
+
+  include $(BUILD_SHARED_LIBRARY)
+
+The build writes the relocatable ELF library to
+``$(BINDIR)/$(LOCAL_MODULE)``. Set ``LOCAL_MODULE_FILENAME`` when the runtime
+interface requires another name, such as ``libmy-new-lib.so``.
+
+``LOCAL_CFLAGS``, ``LOCAL_CXXFLAGS``, ``LOCAL_LDFLAGS``, and ``LOCAL_LDLIBS``
+add module-specific options. The selected architecture must provide the NuttX
+module compiler and linker flags. Exported symbols must have default
+visibility for ``dlsym()`` or use by another library.
+
+
 FLAT Build
 ==========
 

Reply via email to