libopencm3 icon indicating copy to clipboard operation
libopencm3 copied to clipboard

Makefile: Create library archives in deterministic mode

Open crvux opened this issue 2 years ago • 0 comments

This commit adds the 'D' flag to 'ARFLAGS' variable. The flag makes archive builds deterministic, which will allow comparing archives built at different times and by different users (see ar manual for details). Without this flag, re-builds (without code changes) will not be comparable in a simple way.

To see how it works:

make && mkdir first_build && cp lib/*.a && make clean
make && mkdir seсond_build && cp lib/*.a && make clean
diff first_build second_build

Without 'D' flag 'diff' will show the difference because the timestamps in the archive index will be different.

crvux avatar Jan 04 '24 05:01 crvux