Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/mupdf/Makefile,v
retrieving revision 1.92
diff -u -p -r1.92 Makefile
--- Makefile 17 Sep 2019 09:22:51 -0000 1.92
+++ Makefile 4 Dec 2019 01:02:32 -0000
@@ -53,6 +53,17 @@ MAKE_FLAGS = CC="${CC}" CXX="${CXX}" \
USE_SYSTEM_LIBS=yes \
build=release verbose=yes
+# mips64* needs lld to link the font files so clang is required.
+# Neither is in LLD_ARCHS, so need to explicitly declare LLD_EMUL.
+.if ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el"
+MAKE_FLAGS += CC="/usr/bin/clang" CXX="/usr/bin/clang++" LDFLAGS="-fuse-ld=lld" LD="/usr/bin/ld.lld"
+. if ${MACHINE_ARCH} == "mips64"
+MAKE_FLAGS += LLD_EMUL="-melf64btsmip"
+. else
+MAKE_FLAGS += LLD_EMUL="-melf64ltsmip"
+. endif
+.endif
+
FAKE_FLAGS = prefix=${PREFIX} mandir=${PREFIX}/man
pre-configure:
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEiKQfd6o81mjI+LWALell7WOCXJMFAl3nBj4ACgkQLell7WOC
XJPllw/5AYSJzPUmRpchP7TKLDv8lObZal3bUeyLiVpEWPcgewzy7IyC+fffpjfT
+NCkjOeCkmCxvvneDXwpWEPmf/6ZNFmofcgi5rIg+Kkg6JYNTr3hD/oAVaigl1Uc
pFvufvbNZAvJ6LBm/K5b7HL/175bncUibUsC2H2J5ozEaMxWnPCI8UfZohKlWSoB
EDgTClbHxwreusHk2talCLdYq2ZtSyN3WptXt2nO7JBSgt0oLJia8JXDQkpFSslU
+DTzNyri/YLuSfMRai3RwIxNm8JUnu9dI32+88hABplv8pob/68GDZwD26ilq+r/
WWy33REuaA/Baqk+T0aHfHC0GWnsXwGv/z8Ta66ggIIVeFSI29fFInp/SgzDEPIK
fa8uKMqOYgfp9BSM6pk7185gw8LreoEC4fJIUN0UC1Gt44DGgzcc4mMNYXHJ1Fdp
S6y9JMpGd2JX0ZaaVu9riOvOqGi7mQRL8WE8FQ2FtHq4bEWVGjspTA1R+5J4Ti8o
7+jAmAFtcu5jsqGyD6v3fR18KEGBaCNidUdpiT+sDnD7hMFZvPDRe9QAJoFBjs/h
jFLxnJuvbj2YJHbv0kjXMzGVE38xlCbXoUiBqkJq01qnfEhjBYT3oFsM5qt5RVpr
m8K8xoZ0asB4iZEsiRH8FxFza8rP6WWSeVl3e5hKxYSmZL+57lA=
=rGKI
-----END PGP SIGNATURE-----
On 12/1/19 5:24 PM, manphiz@gmail.com wrote:
> Hi Ports maintainer,
>
> Hit another problem when trying to build textproc/mupdf, which says
> failed to link 32-bit and 64-bit code:
>
> /usr/bin/ld: build/release/libmupdf.a(Dingbats.cff.o): warning: linking
> PIC files with non-PIC files
> /usr/bin/ld: build/release/libmupdf.a(Dingbats.cff.o): linking 32-bit
> code with 64-bit code
> /usr/bin/ld: failed to merge target specific data of file
> build/release/libmupdf.a(Dingbats.cff.o)
> /usr/bin/ld: build/release/libmupdf.a(NimbusMonoPS-Bold.cff.o): warning:
> linking PIC files with non-PIC files
> /usr/bin/ld: build/release/libmupdf.a(NimbusMonoPS-Bold.cff.o): linking
> 32-bit code with 64-bit code
> /usr/bin/ld: failed to merge target specific data of file
> build/release/libmupdf.a(NimbusMonoPS-Bold.cff.o)
>
> The full build log is attached.
>
With help from Brian, I finally get it built (thanks a lot Brian!) The
problem is that the default linker (ld.bfd) cannot handle the font
archive format well and when linking with fonts and code archive so it
gives the errors in the log. ld.lld is required to make this work.
Also because the linker will be called through compiler, we need to
explicitly use clang. The patch is attached. Please consider refine
and submit. Thanks!
No comments:
Post a Comment