=> Bootstrap dependency digest>=20010302: found digest-20160304
===> Skipping vulnerability checks.
WARNING: No /var/db/pkg/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/sbin/pkg_admin -K /var/db/pkg fetch-pkg-vulnerabilities'.
=> Checksum SHA1 OK for postgresql-9.1.24.tar.bz2
=> Checksum RMD160 OK for postgresql-9.1.24.tar.bz2
=> Checksum SHA512 OK for postgresql-9.1.24.tar.bz2
===> Installing dependencies for postgresql91-plperl-9.1.24
==========================================================================
The supported build options for postgresql91-plperl are:

	bonjour dtrace gssapi kerberos ldap pam xml

You can select which build options to use by setting PKG_DEFAULT_OPTIONS
or the following variable.  Its current value is shown:

	PKG_OPTIONS.postgresql91 (not defined)

==========================================================================
==========================================================================
The following variables will affect the build process of this package,
postgresql91-plperl-9.1.24.  Their current value is shown below:

        * PGSQL_BLCKSZ (not defined)
        * SSLBASE = /usr
        * SSLCERTS = /etc/openssl/certs
        * SSLDIR = /etc/openssl
        * SSLKEYS = /etc/openssl/private

You may want to abort the process now with CTRL-C and change their value
before continuing.  Be sure to run `/usr/bin/make clean' after
the changes.
==========================================================================
=> Tool dependency bison>=1.0: found bison-3.0.4nb3
=> Tool dependency gmake>=3.81: found gmake-4.1nb3
=> Tool dependency perl>=5.24.0: found perl-5.24.1
=> Tool dependency checkperms>=1.1: found checkperms-1.11nb1
=> Build dependency cwrappers>=20150314: found cwrappers-20170112
=> Full dependency postgresql91-server>=9.1.24: found postgresql91-server-9.1.24
=> Full dependency postgresql91-client>=9.1.20nb1: found postgresql91-client-9.1.24
=> Full dependency perl<5.26.0: found perl-5.24.1
=> Full dependency perl>=5.24.0: found perl-5.24.1
===> Overriding tools for postgresql91-plperl-9.1.24
===> Extracting for postgresql91-plperl-9.1.24
touch /data/scratch/databases/postgresql91-plperl/work/postgresql-9.1.24/src/template/dragonfly
cp /data/scratch/databases/postgresql91-plperl/work/postgresql-9.1.24/src/backend/port/dynloader/freebsd.c  /data/scratch/databases/postgresql91-plperl/work/postgresql-9.1.24/src/backend/port/dynloader/dragonfly.c
cp /data/scratch/databases/postgresql91-plperl/work/postgresql-9.1.24/src/backend/port/dynloader/freebsd.h  /data/scratch/databases/postgresql91-plperl/work/postgresql-9.1.24/src/backend/port/dynloader/dragonfly.h
cp /data/scratch/databases/postgresql91-plperl/work/postgresql-9.1.24/src/include/port/freebsd.h  /data/scratch/databases/postgresql91-plperl/work/postgresql-9.1.24/src/include/port/dragonfly.h
cp /data/scratch/databases/postgresql91-plperl/work/postgresql-9.1.24/src/makefiles/Makefile.freebsd  /data/scratch/databases/postgresql91-plperl/work/postgresql-9.1.24/src/makefiles/Makefile.dragonfly
===> Patching for postgresql91-plperl-9.1.24
=> Applying pkgsrc patches for postgresql91-plperl-9.1.24
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-config_perl.m4
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-config_perl.m4
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-config_perl.m4,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
|
|--- config/perl.m4.orig	2010-02-23 18:35:06.000000000 +0000
|+++ config/perl.m4
--------------------------
Patching file config/perl.m4 using Plan A...
Hunk #1 succeeded at 57.
done
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-configure
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-configure
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-configure,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
|
|--- configure.orig	2011-06-09 23:40:42.000000000 +0000
|+++ configure
--------------------------
Patching file configure using Plan A...
Hunk #1 succeeded at 2197 (offset 1 line).
Hunk #2 succeeded at 7341 (offset 183 lines).
done
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-contrib_dblink_Makefile
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-contrib_dblink_Makefile
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-contrib_dblink_Makefile,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
|
|--- contrib/dblink/Makefile.orig	2011-09-15 06:35:28.000000000 +0000
|+++ contrib/dblink/Makefile
--------------------------
Patching file contrib/dblink/Makefile using Plan A...
Hunk #1 succeeded at 4.
done
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-contrib_dblink_dblink.c
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-contrib_dblink_dblink.c
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-contrib_dblink_dblink.c,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
|
|--- contrib/dblink/dblink.c.orig	2010-07-06 19:18:54.000000000 +0000
|+++ contrib/dblink/dblink.c
--------------------------
Patching file contrib/dblink/dblink.c using Plan A...
Hunk #1 succeeded at 59.
done
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_Makefile.shlib
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_Makefile.shlib
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-src_Makefile.shlib,v 1.2 2012/07/16 21:17:12 asau Exp $
|
|--- src/Makefile.shlib.orig	2012-05-31 23:07:09.000000000 +0000
|+++ src/Makefile.shlib
--------------------------
Patching file src/Makefile.shlib using Plan A...
Hunk #1 succeeded at 172.
Hunk #2 succeeded at 192.
done
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_backend_Makefile
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_backend_Makefile
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-src_backend_Makefile,v 1.1.1.1 2011/09/15 08:27:39 adam Exp $
|
|--- src/backend/Makefile.orig	2010-07-05 18:54:37.000000000 +0000
|+++ src/backend/Makefile
--------------------------
Patching file src/backend/Makefile using Plan A...
Hunk #1 succeeded at 17.
done
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_backend_utils_adt_datetime.c
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_backend_utils_adt_datetime.c
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-src_backend_utils_adt_datetime.c,v 1.1 2015/01/23 15:06:01 joerg Exp $
|
|--- src/backend/utils/adt/datetime.c.orig	2014-07-21 19:14:13.000000000 +0000
|+++ src/backend/utils/adt/datetime.c
--------------------------
Patching file src/backend/utils/adt/datetime.c using Plan A...
Hunk #1 succeeded at 29.
done
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_interfaces_ecpg_pgtypeslib_interval.c
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_interfaces_ecpg_pgtypeslib_interval.c
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-src_interfaces_ecpg_pgtypeslib_interval.c,v 1.2 2016/05/23 14:27:34 adam Exp $
|
|--- src/interfaces/ecpg/pgtypeslib/interval.c.orig	2016-05-23 13:15:10.000000000 +0000
|+++ src/interfaces/ecpg/pgtypeslib/interval.c
--------------------------
Patching file src/interfaces/ecpg/pgtypeslib/interval.c using Plan A...
Hunk #1 succeeded at 14.
done
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_makefiles_Makefile.solaris
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_makefiles_Makefile.solaris
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-src_makefiles_Makefile.solaris,v 1.1 2011/10/12 19:45:57 hans Exp $
|
|--- src/makefiles/Makefile.solaris.orig	2011-09-23 00:00:48.000000000 +0200
|+++ src/makefiles/Makefile.solaris	2011-10-11 11:53:51.948565783 +0200
--------------------------
Patching file src/makefiles/Makefile.solaris using Plan A...
Hunk #1 succeeded at 23.
done
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_pl_plperl_GNUmakefile
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_pl_plperl_GNUmakefile
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-src_pl_plperl_GNUmakefile,v 1.3 2012/03/03 14:01:12 adam Exp $
|
|--- src/pl/plperl/GNUmakefile.orig	2012-02-23 22:53:36.000000000 +0000
|+++ src/pl/plperl/GNUmakefile
--------------------------
Patching file src/pl/plperl/GNUmakefile using Plan A...
Hunk #1 succeeded at 60.
Hunk #2 succeeded at 69.
done
=> Verifying /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_pl_plperl_plperl.h
=> Applying pkgsrc patch /data/pkgsrc-current/databases/postgresql91-plperl/../../databases/postgresql91/patches/patch-src_pl_plperl_plperl.h
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|$NetBSD: patch-src_pl_plperl_plperl.h,v 1.1 2011/10/12 19:45:57 hans Exp $
|
|--- src/pl/plperl/plperl.h.orig	2011-09-22 23:57:57.000000000 +0200
|+++ src/pl/plperl/plperl.h	2011-10-12 20:36:11.783264869 +0200
--------------------------
Patching file src/pl/plperl/plperl.h using Plan A...
Hunk #1 succeeded at 44.
done
===> Creating toolchain wrappers for postgresql91-plperl-9.1.24
===> Configuring for postgresql91-plperl-9.1.24
=> Modifying GNU configure scripts to avoid --recheck
=> Replacing config-guess with pkgsrc versions
=> Replacing config-sub with pkgsrc versions
=> Replacing install-sh with pkgsrc version
=> Fixing locale directory references.
=> Checking for portability problems in extracted files
checking build system type... x86_64--netbsd
checking host system type... x86_64--netbsd
checking which template to use... netbsd
checking whether to build with 64-bit integer date/time support... yes
checking whether NLS is wanted... yes
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for WAL segment size... 16MB
checking for x86_64--netbsd-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc supports -Wdeclaration-after-statement... yes
checking whether gcc supports -Wendif-labels... yes
checking whether gcc supports -Wformat-security... yes
checking whether gcc supports -fno-strict-aliasing... yes
checking whether gcc supports -fwrapv... yes
checking whether gcc supports -fexcess-precision=standard... yes
checking whether gcc supports -fno-aggressive-loop-optimizations... yes
checking whether the C compiler still works... yes
checking how to run the C preprocessor... gcc -E
checking allow thread-safe client libraries... yes
checking whether to build with Tcl... no
checking whether to build Perl modules... yes
checking whether to build Python modules... no
checking whether to build with GSSAPI support... no
checking whether to build with Kerberos 5 support... no
checking whether to build with PAM support... no
checking whether to build with LDAP support... no
checking whether to build with Bonjour support... no
checking whether to build with OpenSSL support... no
checking whether to build with SELinux support... no
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... (cached) /usr/bin/egrep
checking for ld used by GCC... /data/scratch/databases/postgresql91-plperl/work/.cwrapper/bin/ld
checking if the linker (/data/scratch/databases/postgresql91-plperl/work/.cwrapper/bin/ld) is GNU ld... yes
checking for x86_64--netbsd-ranlib... no
checking for ranlib... ranlib
checking for x86_64--netbsd-strip... no
checking for strip... strip
checking whether it is possible to strip libraries... yes
checking for x86_64--netbsd-ar... no
checking for ar... ar
checking for tar... /bin/tar
checking whether ln -s works... yes
checking for gawk... /usr/bin/awk
checking for a thread-safe mkdir -p... config/install-sh -c -d
configure: using bison (GNU Bison) 3.0.4
checking for flex... /data/scratch/databases/postgresql91-plperl/work/.tools/bin/lex
configure: using lex 2.5.39
configure: using perl 5.24.1
checking for Perl archlibexp... /usr/pkg/lib/perl5/5.24.0/x86_64-netbsd-thread-multi
checking for Perl privlibexp... /usr/pkg/lib/perl5/5.24.0
checking for Perl useshrplib... true
checking for flags to link embedded Perl... -Wl,-E  -Wl,-R/usr/pkg/lib/perl5/5.24.0/x86_64-netbsd-thread-multi/CORE -Wl,-rpath,/usr/pkg/lib -fstack-protector -L/usr/pkg/lib  -L/usr/pkg/lib/perl5/5.24.0/x86_64-netbsd-thread-multi/CORE -lperl -lm -lcrypt -lpthread
checking for main in -lm... yes
checking for library containing setproctitle... none required
checking for library containing dlopen... none required
checking for library containing socket... none required
checking for library containing shl_load... no
checking for library containing getopt_long... none required
checking for library containing crypt... -lcrypt
checking for library containing fdatasync... none required
checking for library containing sched_yield... none required
checking for library containing gethostbyname_r... none required
checking for library containing shmget... none required
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking crypt.h usability... no
checking crypt.h presence... no
checking for crypt.h... no
checking dld.h usability... no
checking dld.h presence... no
checking for dld.h... no
checking fp_class.h usability... no
checking fp_class.h presence... no
checking for fp_class.h... no
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking ieeefp.h usability... yes
checking ieeefp.h presence... yes
checking for ieeefp.h... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking sys/pstat.h usability... no
checking sys/pstat.h presence... no
checking for sys/pstat.h... no
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/sem.h usability... yes
checking sys/sem.h presence... yes
checking for sys/sem.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/sockio.h usability... yes
checking sys/sockio.h presence... yes
checking for sys/sockio.h... yes
checking sys/tas.h usability... no
checking sys/tas.h presence... no
checking for sys/tas.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking ucred.h usability... no
checking ucred.h presence... no
checking for ucred.h... no
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking kernel/OS.h usability... no
checking kernel/OS.h presence... no
checking for kernel/OS.h... no
checking kernel/image.h usability... no
checking kernel/image.h presence... no
checking for kernel/image.h... no
checking SupportDefs.h usability... no
checking SupportDefs.h presence... no
checking for SupportDefs.h... no
checking for net/if.h... yes
checking for sys/ucred.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... yes
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for quiet inline (no complaint if unreferenced)... yes
checking for preprocessor stringizing operator... yes
checking for signed types... yes
checking for working volatile... yes
checking for __func__... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking for tzname... yes
checking for union semun... no
checking for struct sockaddr_un... yes
checking for struct sockaddr_storage... yes
checking for struct sockaddr_storage.ss_family... yes
checking for struct sockaddr_storage.__ss_family... no
checking for struct sockaddr_storage.ss_len... yes
checking for struct sockaddr_storage.__ss_len... no
checking for struct sockaddr.sa_len... yes
checking for struct addrinfo... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for long long int... yes
checking for locale_t... yes
checking for struct cmsgcred... no
checking for struct option... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of off_t... 8
checking for int timezone... yes
checking types of arguments for accept()... int, int, struct sockaddr *, socklen_t *
checking whether gettimeofday takes only one argument... no
checking for wcstombs_l declaration... yes
checking for cbrt... yes
checking for dlopen... yes
checking for fcvt... no
checking for fdatasync... yes
checking for getifaddrs... yes
checking for getpeerucred... no
checking for getrlimit... yes
checking for mbstowcs_l... yes
checking for memmove... yes
checking for poll... yes
checking for pstat... no
checking for pthread_is_threaded_np... no
checking for readlink... yes
checking for scandir... yes
checking for setproctitle... yes
checking for setsid... yes
checking for sigprocmask... yes
checking for symlink... yes
checking for sysconf... yes
checking for towlower... yes
checking for utime... yes
checking for utimes... yes
checking for waitpid... yes
checking for wcstombs... yes
checking for wcstombs_l... yes
checking for fseeko... yes
checking for posix_fadvise... yes
checking whether posix_fadvise is declared... yes
checking whether fdatasync is declared... yes
checking whether strlcat is declared... yes
checking whether strlcpy is declared... yes
checking whether F_FULLFSYNC is declared... no
checking for struct sockaddr_in6... yes
checking for PS_STRINGS... no
checking for snprintf... yes
checking for vsnprintf... yes
checking whether snprintf is declared... yes
checking whether vsnprintf is declared... yes
checking for isinf... yes
checking for crypt... yes
checking for erand48... yes
checking for getopt... yes
checking for getrusage... yes
checking for inet_aton... yes
checking for mkdtemp... yes
checking for random... yes
checking for rint... yes
checking for srandom... yes
checking for strdup... yes
checking for strerror... yes
checking for strlcat... yes
checking for strlcpy... yes
checking for strtol... yes
checking for strtoul... yes
checking for unsetenv... yes
checking for getpeereid... yes
checking for getaddrinfo... yes
checking for getopt_long... yes
checking for sigsetjmp... yes
checking whether sys_siglist is declared... yes
checking for syslog... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for opterr... yes
checking for optreset... yes
checking for strtoll... yes
checking for strtoull... yes
checking for atexit... yes
checking for builtin locking functions... yes
checking for pthread_join in LIBS= with CFLAGS= -pthread ... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for cc_r... gcc
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for strerror_r... yes
checking for getpwuid_r... yes
checking for gethostbyname_r... yes
checking whether getpwuid_r takes a fifth argument... yes
checking whether strerror_r returns int... yes
checking test program... ok
checking whether printf supports argument control... yes
checking whether long int is 64 bits... yes
checking size of void *... 8
checking size of size_t... 8
checking size of long... 8
checking whether to build with float4 passed by value... yes
checking whether to build with float8 passed by value... yes
checking alignment of short... 2
checking alignment of int... 4
checking alignment of long... 8
checking alignment of double... 8
checking for int8... no
checking for uint8... no
checking for int64... no
checking for uint64... no
checking for sig_atomic_t... yes
checking for POSIX signal interface... yes
checking for working memcmp... yes
checking for library containing bind_textdomain_codeset... -lintl
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for msgfmt... msgfmt
checking for msgmerge... msgmerge
checking for xgettext... xgettext
checking for onsgmls... no
checking for nsgmls... no
checking for openjade... no
checking for jade... no
checking for DocBook V4.2... no
checking for DocBook stylesheets... no
checking for collateindex.pl... no
checking for xsltproc... no
checking for osx... no
checking for sgml2xml... no
checking for sx... no
checking thread safety of required library functions... yes
checking whether gcc supports -Wl,--as-needed... yes
configure: using CFLAGS=-O2 -I/usr/include -I/usr/pkg/include -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fno-aggressive-loop-optimizations
configure: using CPPFLAGS=-I/usr/include -I/usr/pkg/include 
configure: using LDFLAGS=-L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib/perl5/5.24.0/x86_64-netbsd-thread-multi/CORE  -Wl,--as-needed
configure: creating ./config.status
config.status: creating GNUmakefile
config.status: creating src/Makefile.global
config.status: creating src/include/pg_config.h
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s
config.status: linking src/backend/port/dynloader/netbsd.c to src/backend/port/dynloader.c
config.status: linking src/backend/port/sysv_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/backend/port/unix_latch.c to src/backend/port/pg_latch.c
config.status: linking src/backend/port/dynloader/netbsd.h to src/include/dynloader.h
config.status: linking src/include/port/netbsd.h to src/include/pg_config_os.h
config.status: linking src/makefiles/Makefile.netbsd to src/Makefile.port