Marius Bakke <mba...@fastmail.com> writes:

> Ludovic Courtès <l...@gnu.org> writes:
>
>> Marius Bakke <mba...@fastmail.com> skribis:
>>
>>> Efraim Flashner <efr...@flashner.co.il> writes:
>>>
>>>> On Wed, Aug 30, 2017 at 09:10:42PM +0200, Marius Bakke wrote:
>>>>> Since we're on the topic, I would like to switch to GCC 6 or 7 soon...
>>>>> Are we agile enough to use the very latest GCC by default yet? :-)
>>>>
>>>> That would be nice to at least move to GCC 6. My aarch64 board is
>>>> currently idle, I can see how well it works on my machine.
>>>
>>> The main issue with GCC 6 is that we need to port the SOURCE_DATE_EPOCH
>>> patches again.  But we might want to do that even if switching to 7.
>>
>> I think we should upgrade.  My preference would be GCC 6, which I think
>> may trigger fewer build failures than GCC 7, but maybe GCC 7 would be
>> fine.
>>
>> Are you sure the SOURCE_DATE_EPOCH thing isn’t already in GCC 6?
>
> I just checked out the gcc-6_4_0-release tag and ran `git grep
> SOURCE_DATE_EPOCH`.  No results :/
>
> However I tried cherry-picking the two commits and there was only one
> trivial conflict in gcc/c-family/c-common.h (apart from ChangeLog
> updates, which were omitted).  Patch attached and building!

It works!

$ cat sde.c
#include <stdio.h>
int main()
{
    printf( "__DATE__ says: %s \n", __DATE__ );
    printf( "__TIME__ says: %s \n", __TIME__ );
    return 0;
}
$ ./pre-inst-env guix environment --pure --ad-hoc gcc@6 binutils glibc
bash: tty: command not found
[env]$ gcc sde.c && ./a.out
__DATE__ says: Aug 31 2017 
__TIME__ says: 17:09:07 
[env]$ SOURCE_DATE_EPOCH=1 gcc sde.c && ./a.out
__DATE__ says: Jan  1 1970 
__TIME__ says: 00:00:01 
[env]$ SOURCE_DATE_EPOCH=-1 gcc sde.c && ./a.out
sde.c: In function 'main':
sde.c:4:5: error: environment variable SOURCE_DATE_EPOCH must expand to a 
non-negative integer less than or equal to 253402300799
     printf( "__DATE__ says: %s \n", __DATE__ );
     ^~~~~~

\o/

Attachment: signature.asc
Description: PGP signature

Reply via email to