2020-08-28 04:39 AM
Hello,
I'm using IAR 6.21. I'm trying to build a static library but even if my sources didn't change, the binary file is different each time I build again the lib.
I tried to compare the lib.a, there is some UNIX timestamps in the file that depends on the build time.
Do you know a way to prevent that? I need to have the exact same binary for the exact same sources...
Thank you,
Charles
Solved! Go to Solution.
2020-08-28 07:00 AM
Thank for your help.
I obtained an answer from IAR support, the option to operate in deterministic mode is available from IAR 8.50.
2020-08-28 06:54 AM
I'm not using IAR, but thats an ar archive. ar has a command line option -D "Operate in deterministic mode. When adding files and the archive index use zero for UIDs, GIDs, timestamps, and use consistent file modes for all files.". Don't know where you could enter that option.
2020-08-28 07:00 AM
Thank for your help.
I obtained an answer from IAR support, the option to operate in deterministic mode is available from IAR 8.50.
2020-08-28 07:32 AM
Too bad.
2020-08-28 02:14 PM
> but even if my sources didn't change, the binary file is different each time I build again the lib.
If your sources don't change, you don't need to rebuild the lib, correct?
Then just build your app with a copy of the lib which you update manually when it changes.
-- pa
2020-08-28 03:12 PM
Also, using standard __DATE__ and __TIME__ macros is one way to achieve different binaries from invariable sources, regardless of ar mode...
JW
2020-08-29 01:57 AM
Yes, we are not using any __DATE__ or __TIME__ macros, but I've checked, thanks!
2020-08-29 02:00 AM
We want the build to be deterministic, and the binaries the same whoever builds one of the libs or the firmware
2020-08-29 09:50 AM
Maybe someone else 's code is using it.
Best thing would be to remote compile (other physical machine or vm) and have your compilation script set same system date each time you run it? Looks convoluted, but it's friday. :)
2020-08-30 11:58 PM
It could be a solution, it's far-fetched but it works ahah
Thank you!