Christian Weisgerber:

> Stuart Henderson:
> 
> > arch-defines seems the right place - it might be helpful to add the
> > "-m" in ${LLD_EMUL} so that it can be used directly in command lines,
> > rather than have consumers check whether it's non-empty and add "-m"
> > themselves?
> 
> Hmm, I guess we could do that.

Here's that alternative:

Index: infrastructure/mk/arch-defines.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/arch-defines.mk,v
retrieving revision 1.52
diff -u -p -r1.52 arch-defines.mk
--- infrastructure/mk/arch-defines.mk   8 Aug 2018 09:19:40 -0000       1.52
+++ infrastructure/mk/arch-defines.mk   10 Sep 2018 16:25:36 -0000
@@ -59,6 +59,17 @@ LIBCXX = stdc++ pthread
 LIBECXX = estdc++>=17 pthread
 .endif
 
+.if ${PROPERTIES:Mlld}
+# see llvm/tools/lld/ELF/Driver.cpp
+.  for A E in aarch64 aarch64elf  arm armelf  amd64 elf_amd64  i386 elf_i386
+.    if ${MACHINE_ARCH} == $A
+LLD_EMUL = -m$E
+.    endif
+.  endfor
+.else
+LLD_EMUL =
+.endif
+
 # system version wide specifics
 _SYSTEM_VERSION = 0
 _SYSTEM_VERSION-aarch64 = 2
Index: net/utox/Makefile
===================================================================
RCS file: /cvs/ports/net/utox/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- net/utox/Makefile   9 Aug 2018 23:25:58 -0000       1.4
+++ net/utox/Makefile   10 Sep 2018 16:29:08 -0000
@@ -34,4 +34,6 @@ NO_TEST =     yes
 
 WRKDIST =      ${WRKDIR}/uTox
 
+CONFIGURE_ARGS =-DLLD_EMUL:String=${LLD_EMUL}
+
 .include <bsd.port.mk>
Index: net/utox/patches/patch-src_xlib_CMakeLists_txt
===================================================================
RCS file: net/utox/patches/patch-src_xlib_CMakeLists_txt
diff -N net/utox/patches/patch-src_xlib_CMakeLists_txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/utox/patches/patch-src_xlib_CMakeLists_txt      10 Sep 2018 16:29:08 
-0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+lld 6.0.0 needs an explicit -memulation
+
+Index: src/xlib/CMakeLists.txt
+--- src/xlib/CMakeLists.txt.orig
++++ src/xlib/CMakeLists.txt
+@@ -13,7 +13,7 @@ endif()
+ ## Native Icon data
+ #########################################
+ add_custom_command(OUTPUT icon.o
+-    COMMAND cd ${uTox_SOURCE_DIR}/ && ld -r -b binary -o 
${utoxNATIVE_BINARY_DIR}/icon.o icons/utox-128x128.png
++    COMMAND cd ${uTox_SOURCE_DIR}/ && ld -r -b binary ${LLD_EMUL} -o 
${utoxNATIVE_BINARY_DIR}/icon.o icons/utox-128x128.png
+     DEPENDS ../../icons/utox-128x128.png )
+ set_source_files_properties( icon.o PROPERTIES EXTERNAL_OBJECT true GENERATED 
true )
+ add_library(icon STATIC icon.o)
Index: www/mozplugger/Makefile
===================================================================
RCS file: /cvs/ports/www/mozplugger/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- www/mozplugger/Makefile     4 Sep 2018 12:46:25 -0000       1.17
+++ www/mozplugger/Makefile     10 Sep 2018 16:29:08 -0000
@@ -21,6 +21,7 @@ USE_GMAKE =           Yes
 NO_TEST =              Yes
 
 CONFIGURE_STYLE =      gnu dest
+CONFIGURE_ARGS =       LLD_EMUL=${LLD_EMUL}
 
 FAKE_FLAGS =           PLUGINDIRS=${WRKINST}${TRUEPREFIX}/lib/mozilla/plugins
 
Index: www/mozplugger/patches/patch-configure
===================================================================
RCS file: www/mozplugger/patches/patch-configure
diff -N www/mozplugger/patches/patch-configure
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ www/mozplugger/patches/patch-configure      10 Sep 2018 16:29:08 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+lld 6.0.0 needs an explicit -memulation
+
+Index: configure
+--- configure.orig
++++ configure
+@@ -3137,7 +3137,7 @@ fi
+ LDSHARED='-shared -Wl,--version-script=exportmap'
+ PLATFORM="x`uname`"
+ XCFLAGS="-fPIC -Wall -O2 -Wdeclaration-after-statement"
+-BIN2O="ld -r -b binary"
++BIN2O="ld -r -b binary ${LLD_EMUL}"
+ MOZPLUGGER_SO_BLOB="mozplugger_so_blob.o"
+ 
+ if test "${PLATFORM}" = xIRIX; then
-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to