Timestamp in binaries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-28 4: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.
- Labels:
-
IAR
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-28 7: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-28 6: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-28 7: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-28 7:32 AM
Too bad.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-28 2: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-28 3:12 PM
Also, using standard __DATE__ and __TIME__ macros is one way to achieve different binaries from invariable sources, regardless of ar mode...
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-29 1:57 AM
Yes, we are not using any __DATE__ or __TIME__ macros, but I've checked, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-29 2:00 AM
We want the build to be deterministic, and the binaries the same whoever builds one of the libs or the firmware
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-29 9: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. :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-30 11:58 PM
It could be a solution, it's far-fetched but it works ahah
Thank you!
