[RFC/POC] Static Math Library Binding #542
No reviewers
Labels
No labels
bug
duplicate
enhancement
feature
help wanted
improve API
invalid
needs documentation
not-planned
rtfm
stale
support
wishlist
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libtom/libtomcrypt!542
Loading…
Reference in a new issue
No description provided.
Delete branch "unknown repository"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
this is a very rough proof of concept to support binding math libraries statically. The primary motivation for this is building for embedded systems with LTO enabled. When using LTO static bindings allow the compiler to remove many unused code paths and thereby reduce code size.
This patch is by no means complete and serves merely as a discussion point to establish whether LibTomCrypt is open to merge support for something like this and how it might look.
The patch does build & link with static support for libtommath only. Dynamic support for all libraries should still work too.
A few things to consider:
Patrick
I like the idea a lot, but we'd have to work a bit more on that!
FYI I already had a patch locally which renamed all
mp_*defines intoltc_mp_*... ;)You also already added the missing direct invocations of
ltc_mp.*as macros.IMO we should have two separate builds of ltc, dynamic and static MPI provider. Either you build one or the other.
I have to think a bit more about how to accomplish this ... something in this area maybe?
First we add
ltc_mp_prefix to all macros, then we do something like the following?naming is definitely not optimal yet and I'm not sure whether this is such a good idea but it could work ... and this could be done for all MPI providers in the same fashion ... or did I overlook something?
maybe @minad has a good idea?
Sorry I haven't been able to dedicate any more time to this yet. I haven't forgotten about it though!
Considering that all
mp_*macros map to a correspondingltc_mp_function with this PR, couldn't allmp_*calls be replaced withltc_mp_calls, and these macros be dropped entirely?View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.