How to compile a lib as shared lib with symbols?

I’m the maintainer of the Luos_engine lib.
I’m trying to compile this lib as a native shared lib with symbols on it to make it usable with other languages such as Python or Rust.

To make It, I added a src folder containing a main.c doing nothing except importing the libs I want to compile, and a script to add the command line generating the shared lib.

Here is a simplified version of this script for Mac:

import os
import click

def shared_lib(source, target, env):
    # Try to find the luos_engine.a somwhere on $BUILD_DIR/*/ archive and save it to a libPath variable
    libPath = None
    for root, dirs, files in os.walk(env.subst("$BUILD_DIR")):
        for file in files:
            if file.endswith("luos_engine.a"):
                libPath = os.path.join(root, file)
        if libPath is not None:

    # Create the actual shared lib
    if libPath is not None:
        env.Execute("gcc -v -shared -fPIC -o $BUILD_DIR/libluos_engine.dylib " + libPath)
        click.secho("Luos engine shared library available in " + str(env.subst("$BUILD_DIR")) + "/ :", underline=True)

env.AddPostAction("$PROGPATH", shared_lib)

By compiling I have this extra execution in the end of compilation :

$ gcc -v -shared -fPIC -o .../luos_engine/.pio/build/native_lib/libluos_engine.dylib .../luos_engine/.pio/build/native_lib/libdf9/libluos_engine.a
Apple clang version 15.0.0 (clang-1500.
Target: x86_64-apple-darwin23.2.0
Thread model: posix
InstalledDir: /Applications/
 "/Applications/" -demangle -lto_library /Applications/ -dynamic -dylib -arch x86_64 -platform_version macos 14.0.0 14.2 -syslibroot /Applications/ -o .../luos_engine/.pio/build/native_lib/libluos_engine.dylib -L/usr/local/lib .../luos_engine/.pio/build/native_lib/libdf9/libluos_engine.a -lSystem /Applications/

After the compilation, I get my libluos_engine.dylib with no error but there are no symbols on it.

$ nm .pio/build/native_lib/libws_luos_engine.dylib
.pio/build/native_lib/libluos_engine.dylib: no symbols

You can find the code related to this subject on this pull request on GitHub.

I can’t find any way to include the symbols on this shared lib, did someone have any idea?