libtool needs to be patched to handle LLD as it parses -v output. With lld -v gives
$ ld -v LLD 4.0.0 ld: error: no input files ld: error: target emulation unknown: -m or at least one .o file required $ ld -v 2>/dev/null LLD 4.0.0 Currently trying to build Mesa errors out with: libtool: link: c++ -shared -fPIC -DPIC --whole-archive ../../.libs/libmesa.a common/.libs/libmegadriver_stub.a common/.libs/libdricommon.a common/.libs/libxmlconfig.a swrast/.libs/libswrast_dri.a --no-whole-archive -L/usr/lib -L/usr/X11R6/lib -ldrm -lexpat -lm -lpthread -O2 -Wl,-Bsymbolic -Wl,--gc-sections -o .libs/mesa_dri_drivers.so The -Wl from --whole-archive and --no-whole-archive is missing as the ld -v tests fail and --whole-archive added because the ld --help | grep tests pass. There is an invalid regex error when running auto* with base m4 so this also adds a build dep on the gnu one. Index: Makefile =================================================================== RCS file: /cvs/ports/devel/libtool/Makefile,v retrieving revision 1.84 diff -u -p -r1.84 Makefile --- Makefile 11 Mar 2016 19:59:13 -0000 1.84 +++ Makefile 15 Mar 2017 15:03:09 -0000 @@ -7,7 +7,7 @@ VERSION= 2.4.2 DISTNAME= libtool-${VERSION} PKGNAME-main= ${DISTNAME} PKGNAME-ltdl= libltdl-${VERSION} -REVISION-main= 0 +REVISION-main= 1 REVISION-ltdl= 1 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_GNU:=libtool/} @@ -22,7 +22,8 @@ MAINTAINER= Brad Smith <b...@comstyle.co PERMIT_PACKAGE_CDROM= Yes AUTOCONF_VERSION= 2.67 -BUILD_DEPENDS= ${MODGNU_AUTOCONF_DEPENDS} +BUILD_DEPENDS= ${MODGNU_AUTOCONF_DEPENDS} \ + devel/m4 MAKE_ENV+= ${_lt_libs} MAKE_FLAGS+= ${_lt_libs} @@ -30,7 +31,7 @@ MAKE_FLAGS+= ${_lt_libs} # do not set libtool(1) to /usr/bin/libtool, for obvious reasons USE_LIBTOOL= No -CONFIGURE_STYLE= gnu +CONFIGURE_STYLE= autoconf CONFIGURE_ENV= GREP=/usr/bin/grep \ ac_cv_f77_compiler_gnu=yes \ lt_cv_prog_compiler_c_o_F77=yes \ Index: patches/patch-libltdl_m4_libtool_m4 =================================================================== RCS file: patches/patch-libltdl_m4_libtool_m4 diff -N patches/patch-libltdl_m4_libtool_m4 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-libltdl_m4_libtool_m4 15 Mar 2017 14:40:10 -0000 @@ -0,0 +1,25 @@ +$OpenBSD$ +--- libltdl/m4/libtool.m4.orig Thu Mar 16 01:37:48 2017 ++++ libltdl/m4/libtool.m4 Thu Mar 16 01:39:48 2017 +@@ -3073,8 +3073,8 @@ AC_CACHE_VAL(lt_cv_path_LD, + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. +- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in +- *GNU* | *'with BFD'*) ++ case `"$lt_cv_path_LD" -v 2>/dev/null </dev/null` in ++ *GNU* | *'with BFD'* | *LLD*) + test "$with_gnu_ld" != no && break + ;; + *) +@@ -3113,8 +3113,8 @@ dnl AC_DEFUN([AC_PROG_LD], []) + m4_defun([_LT_PATH_LD_GNU], + [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, + [# I'd rather use --version here, but apparently some GNU lds only accept -v. +-case `$LD -v 2>&1 </dev/null` in +-*GNU* | *'with BFD'*) ++case `$LD -v 2>/dev/null </dev/null` in ++*GNU* | *'with BFD'* | *LLD*) + lt_cv_prog_gnu_ld=yes + ;; + *)