[Buildroot] [PATCH] Makefile: generate KBUILD_BUILD_TIMESTAMP date whith LANG=C
Jean-Baptiste Tredez
jean-baptiste.tredez at basystemes.fr
Tue Dec 6 16:41:13 UTC 2016
Hello,
Le 06/12/2016 à 14:02, Jérôme Pouiller a écrit :
> Hello Jean-Baptiste,
>
> On Tuesday 06 December 2016 11:10:01 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
> Good catch.
>
>> ---
>> linux/linux.mk | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/linux/linux.mk b/linux/linux.mk
>> index a63d1f3..554c5f1 100644
>> --- a/linux/linux.mk
>> +++ b/linux/linux.mk
>> @@ -99,7 +99,7 @@ LINUX_MAKE_ENV += \
>> KBUILD_BUILD_VERSION=1 \
>> KBUILD_BUILD_USER=buildroot \
>> KBUILD_BUILD_HOST=buildroot \
>> - KBUILD_BUILD_TIMESTAMP="$(shell date -d @$(SOURCE_DATE_EPOCH))"
>> + KBUILD_BUILD_TIMESTAMP="$(shell LANG=C date -d @$(SOURCE_DATE_EPOCH))"
> It should also possible to fix problem using backquotes:
>
> KBUILD_BUILD_TIMESTAMP="`date -d @$(SOURCE_DATE_EPOCH)`"
>
> I find it lighter.
It should work but may require a comment. One may not see the importance
of the backquotes and it is hard to track (since the compilation do not
fail in case of error only a binary compare on vmlinux will show the issue).
>
>
> BR,
>
More information about the buildroot
mailing list