问题
I have some code which relies on a library, namely the University of Tsukuba Elliptic Pairing Library. This library itself relies on GMP. I'd like to run this program baremetal on an ARM core, specifically on a beaglebone black.
GMP is a massive library, so I'd prefer to cross-compile if possible. I'd also prefer something other than the ``brute force" solution of simply dumping the entire GMP source code into the same file as my program and pushing it into arm-none-eabi-gcc.
What is the standard method for linking nontrivial libraries into baremetal code?
回答1:
In this specific case, mini-gmp is sufficient, providing a bunch of functionality is removed from TEPLA. This is sufficient for my purposes, but hardly a satisfying answer -- my solution to linking a nontrivial library is to instead link a trivial library. Though my exact problem is solved, I'll be leaving this question open in case someone has any cleverer ideas.
来源:https://stackoverflow.com/questions/22771688/linking-gmp-into-a-baremetal-program