[U-Boot] Use C locale when setting CC_VERSION_STRING and LD_VERSION_STRING.
diff mbox

Message ID 1465736827-1209-1-git-send-email-vagrant@debian.org
State Accepted
Commit 42ffa51fd46bc6fd4bf2c244f00a80df31d01596
Delegated to: Tom Rini
Headers show

Commit Message

Vagrant Cascadian June 12, 2016, 1:07 p.m. UTC
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 <vagrant@debian.org>
---

 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tom Rini June 12, 2016, 4:51 p.m. UTC | #1
On Sun, Jun 12, 2016 at 06:07:07AM -0700, Vagrant Cascadian wrote:

> 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 <vagrant@debian.org>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini June 25, 2016, 2:52 a.m. UTC | #2
On Sun, Jun 12, 2016 at 06:07:07AM -0700, Vagrant Cascadian wrote:

> 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 <vagrant@debian.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

Patch
diff mbox

diff --git a/Makefile b/Makefile
index 0f7d6f3..14e09d4 100644
--- a/Makefile
+++ b/Makefile
@@ -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.