
On 7/2/21 4:36 AM, Rasmus Villemoes wrote:
On 01/07/2021 08.15, Sean Anderson wrote:
Apparently strdup is not portable, so LIL used its own. Use strdup.
You could reduce the churn by just making strclone "#define strclone(x) strdup(x)", but I suppose you end up modifying the upstream code so much that there's not really anything gained by that.
But that begs the question: What is the long-term plan for this? While it does seem to be an improvement compared to hush, will we ever be able to incorporate fixes&features from upstream, or will this code end up in the same situation as hush?
Well, since Hush was never updated, I don't believe LIL will be either. I think reducing the amount of ifdefs makes the code substantially easier to maintain. My intention is to just use LIL as a starting point which can be modified as needed to better suit U-Boot.
The other half of this is that LIL is not particularly actively developed. I believe the author sees his work as essentially feature-complete, so I expect no major features which we might like to backport.
Have you been in contact with upstream about this project? Perhaps some of the things you do could go upstream - e.g. the conversion from an array of wrongly-typed callbacks to an "ops" struct seems to be an obvious improvement [lil_callback would have to be kept, and changed to use a switch() statement to update the right slot, but we wouldn't have to care because ld will remove it anyway if we don't add any users of it].
I have not. I'm not sure what changes I've made are compatible with the vision he has for LIL. He's CC'd on this series, so perhaps he can comment.
--Sean