Skip to content

Commit

Permalink
Use C locale when setting CC_VERSION_STRING and LD_VERSION_STRING.
Browse files Browse the repository at this point in the history
The output reported may be locale-dependent, which results in
unreproducible builds.

  $ LANG=C ld --version | head -n 1
    GNU ld (GNU Binutils for Debian) 2.26

  $ LANG=it_CH.UTF-8 ld --version | head -n 1
    ld di GNU (GNU Binutils for Debian) 2.26

Forcing LC_ALL=C ensures the output is consistant regardless of the
build environment.

Thanks to HW42 for debugging the issue:

  https://lists.alioth.debian.org/pipermail/reproducible-builds/Week-of-Mon-20160606/005722.html

For more information about reproducible builds:

  https://reproducible-builds.org/

Signed-off-by: Vagrant Cascadian <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
  • Loading branch information
vagrantc authored and trini committed Jun 24, 2016
1 parent 1e23737 commit 42ffa51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1269,8 +1269,8 @@ prepare: prepare0
define filechk_version.h
(echo \#define PLAIN_VERSION \"$(UBOOTRELEASE)\"; \
echo \#define U_BOOT_VERSION \"U-Boot \" PLAIN_VERSION; \
echo \#define CC_VERSION_STRING \"$$($(CC) --version | head -n 1)\"; \
echo \#define LD_VERSION_STRING \"$$($(LD) --version | head -n 1)\"; )
echo \#define CC_VERSION_STRING \"$$(LC_ALL=C $(CC) --version | head -n 1)\"; \
echo \#define LD_VERSION_STRING \"$$(LC_ALL=C $(LD) --version | head -n 1)\"; )
endef

# The SOURCE_DATE_EPOCH mechanism requires a date that behaves like GNU date.
Expand Down

0 comments on commit 42ffa51

Please sign in to comment.