"The build timeout" build failure(s) — clang 13.0.0

The binary produced by clang is wrong when built with -D_FORTIFY_SOURCE=2. For example, the code:
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

int main ()
{
    char *data;
    int  pagesize;
    int fd, foo;
    pagesize = getpagesize ();
    fd = open ("conftest.mmap", O_RDWR);
    data = (char *) malloc (pagesize);
    foo = read (fd, data, pagesize);
}
compiled with:
clang++ -o conftest -g  -O2  -D_FORTIFY_SOURCE=2 conftest.cpp
will be stucked in an infinity loop. Reported upstream as bug 16821
PackageVersionSupposed error messageFull log Bug report
cpputest 4.0-2E: Build killed with signal TERM after 150 minutes of inactivity Log
mbedtls 2.16.9-0.1E: Build killed with signal TERM after 150 minutes of inactivity Log

2 errors