From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] Makefile: generate KBUILD_BUILD_TIMESTAMP date whith LANG=C
Date: Tue, 6 Dec 2016 11:33:10 +0100 [thread overview]
Message-ID: <20161206113310.2f9ebef4@free-electrons.com> (raw)
In-Reply-To: <1481019001-11035-1-git-send-email-jean-baptiste.tredez@basystemes.fr>
Hello,
On Tue, 6 Dec 2016 11:10:01 +0100, Jean-Baptiste Tr?dez wrote:
> Fix kernel reproducible build if LANG=fr_FR.UTF-8 in host system.
>
> when building linux kernel, scripts/gen_initramfs_list.sh do 'date -d"$KBUILD_BUILD_TIMESTAMP" +%s'
> In buildroot makefile, KBUILD_BUILD_TIMESTAMP="$(shell date -d @$(SOURCE_DATE_EPOCH))"
> if LANG=fr_FR.UTF-8 in host system, it does not work :
> - LANG=C date -d"$(LANG=C date)" : ok
> - LANG=C date -d"$(LANG=fr_FR.UTF-8 date)" : error
>
> Signed-off-by: Jean-Baptiste Tr?dez <jean-baptiste.tredez@basystemes.fr>
Indeed, seems like the LANG/LC_ALL variables exported in the main
Makefile are not used in the $(shell ...) sub-shells.
However, are you sure it works with LANG=C ? It seems like LC_ALL=C is
needed instead:
thomas at skate:/tmp$ LANG=C date
mardi 6 d?cembre 2016, 11:31:52 (UTC+0100)
thomas at skate:/tmp$ LC_ALL=C date
Tue Dec 6 11:31:59 CET 2016
I also tested with the following test makefile:
====
export LC_ALL=C
foo = $(shell LC_ALL=C date)
all:
date
echo "$(foo)"
====
And indeed, the "export LC_ALL" is enough for the direct "date" call to
work. But for the date call whose output is stored in the "foo"
variable, passing again LC_ALL in the sub-shell is necessary.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-12-06 10:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 10:10 [Buildroot] [PATCH] Makefile: generate KBUILD_BUILD_TIMESTAMP date whith LANG=C Jean-Baptiste Trédez
2016-12-06 10:33 ` Thomas Petazzoni [this message]
2016-12-06 10:48 ` Jean-Baptiste Tredez
2016-12-06 13:02 ` Jérôme Pouiller
2016-12-06 16:41 ` Jean-Baptiste Tredez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161206113310.2f9ebef4@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.