Skip to content
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

[Latent-issue] Avoid duplications when handling the dependencies for static and shared libraries routines #34

Open
pavly-gerges opened this issue Aug 15, 2024 · 0 comments
Labels
bug Something isn't working build-script Build script related stuff. help wanted Extra attention is needed

Comments

@pavly-gerges
Copy link
Member

pavly-gerges commented Aug 15, 2024

I've noticed that the front-end bash build script for electrostatic-core which provides the build routines for the generic CMakeLists.txt script, has a potential issue which is a latent one (i.e., not manifested) while declaring the dependencies to be linked with output binaries; that is this line:

dependencies=$(find "$(pwd)/${source_dir}/dependencies/libs/"  \
                        -name *.a -o -name *.so -o -name *.ar | tr '\n' ';')

This line entails finding all the dependencies whether static archives or shared libraries that matches the pattern ending in *.so or *.a, and then using them for both routines of building the static and the shared libraries in the CMakeLists.txt script:

target_link_libraries(${library_a} PUBLIC "${DEPENDENCIES}")
target_link_libraries(${library_so} PUBLIC "${DEPENDENCIES}")

So, this introduces a potential of duplication of function tables if not handled internally by GCC which is a scripting anti-pattern anyway (i.e., Merging of mutually exclusive or disjoint routines that are rather incompatible).

Reasons for latency and no error reports:
The main reason for latency is entailed to the fact that the electrostatic-core module haven't got any external dependencies, yet. While the internal dependencies linked (including the math and the pthread libraries) are handled internally by the linker at compile-time.

@pavly-gerges pavly-gerges added bug Something isn't working help wanted Extra attention is needed build-script Build script related stuff. labels Aug 15, 2024
@pavly-gerges pavly-gerges changed the title [Latent-issue] Avoid duplications when handle the dependencies for static and shard libraries routines [Latent-issue] Avoid duplications when handling the dependencies for static and shard libraries routines Aug 15, 2024
@pavly-gerges pavly-gerges changed the title [Latent-issue] Avoid duplications when handling the dependencies for static and shard libraries routines [Latent-issue] Avoid duplications when handling the dependencies for static and shared libraries routines Aug 15, 2024
@pavly-gerges pavly-gerges pinned this issue Sep 8, 2024
@pavly-gerges pavly-gerges unpinned this issue Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build-script Build script related stuff. help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant