It seems reducing the optimisation level bypass this error. However I now face another error :
===> Installing for digest-20190127
=> Generating pre-install file lists
/bin/sh ./mkinstalldirs /var/tmp/pkgbuild/pkgtools/digest/work/.destdir/usr/pkg/bin
mkdir /var/tmp/pkgbuild/pkgtools/digest/work/.destdir/usr/pkg/bin
/usr/bin/install -c -s -o root -g wheel -m 755 digest /var/tmp/pkgbuild/pkgtools/digest/work/.destdir/usr/pkg/bin/digest
/bin/sh ./mkinstalldirs /var/tmp/pkgbuild/pkgtools/digest/work/.destdir/usr/pkg/man/man1
mkdir /var/tmp/pkgbuild/pkgtools/digest/work/.destdir/usr/pkg/man
mkdir /var/tmp/pkgbuild/pkgtools/digest/work/.destdir/usr/pkg/man/man1
/usr/bin/install -c -o root -g wheel -m 644 digest.1 /var/tmp/pkgbuild/pkgtools/digest/work/.destdir/usr/pkg/man/man1/digest.1
=> Automatic manual page handling
=> Generating post-install file lists
=> Checking file-check results for digest-20190127
=> Checking for non-existent script interpreters in digest-20190127
=> Checking for missing run-time search paths in digest-20190127
/usr/bin/awk: no program filename
*** Error code 2
Stop.
bmake[1]: stopped in /srv/pkgsrc/pkgtools/digest
*** Error code 1
Stop.
bmake: stopped in /srv/pkgsrc/pkgtools/digest