aboutsummaryrefslogtreecommitdiff
path: root/net-im/uTox
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2020-02-02 00:07:37 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2020-02-02 00:07:37 +0000
commitf8c11b4f6a85aa515d66a1224cb7272b15b81ae4 (patch)
tree8607549c3f8a536c668f74d5e1d22679120ad9aa /net-im/uTox
parent2e076c1cd3d50e0ce554745bcc91116caf121943 (diff)
downloadports-f8c11b4f6a85aa515d66a1224cb7272b15b81ae4.tar.gz
ports-f8c11b4f6a85aa515d66a1224cb7272b15b81ae4.zip
Notes
Diffstat (limited to 'net-im/uTox')
-rw-r--r--net-im/uTox/Makefile18
1 files changed, 16 insertions, 2 deletions
diff --git a/net-im/uTox/Makefile b/net-im/uTox/Makefile
index 8db500cd363b..b2fed12b219e 100644
--- a/net-im/uTox/Makefile
+++ b/net-im/uTox/Makefile
@@ -31,8 +31,6 @@ USES= cmake compiler:c11 desktop-file-utils openal pkgconfig xorg
USE_XORG= ice sm x11 xext xrender
CMAKE_OFF= ENABLE_LTO ENABLE_TESTS
-# Uses ld -b binary without -m
-LLD_UNSAFE= yes
WRKSRC= ${WRKDIR}/uTox
OPTIONS_DEFINE= DBUS
@@ -41,6 +39,22 @@ OPTIONS_DEFAULT= DBUS
DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus
DBUS_CMAKE_BOOL= ENABLE_DBUS
+.if ${/usr/bin/ld:L:tA} == /usr/bin/ld.lld
+# ld.lld lacks default output emulation. Using -b binary without
+# explicit -m will fail. Mapping taken from lld/ELF/Driver.cpp.
+_LLD_EMUL_aarch64= aarch64elf_fbsd
+_LLD_EMUL_amd64= elf_x86_64_fbsd
+_LLD_EMUL_armv6= armelf_fbsd
+_LLD_EMUL_armv7= armelf_fbsd
+_LLD_EMUL_i386= elf_i386_fbsd
+_LLD_EMUL_powerpc= elf32ppc_fbsd
+_LLD_EMUL_powerpc64= elf64ppc_fbsd
+
+post-patch:
+ @${REINPLACE_CMD} 's,[[:<:]]ld[[:>:]],ld -m${_LLD_EMUL_${ARCH}},' \
+ ${WRKSRC}/src/xlib/CMakeLists.txt
+.endif
+
do-test:
@cd ${TEST_WRKSRC} && \
${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} \