Bug 248748

Summary: print/texlive-base: linker error: ld: error: duplicate symbol: dpi
Product: Ports & Packages Reporter: O. Hartmann <ohartmann>
Component: Individual Port(s)Assignee: Niclas Zeising <zeising>
Status: Closed FIXED    
Severity: Affects Many People CC: hrs, ohartmann, zeising
Priority: --- Flags: bugzilla: maintainer-feedback? (hrs)
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 248756    

Description O. Hartmann 2020-08-19 07:24:00 UTC
With LLVM11 in base, -fno-common is now the standard of clang and in the vain of this change several ports fail to compile/link due to a duplicate symbol error, see below.

A quick and dirty fix, as suggested by FreeBSD developers, is to add CFLAGS+=-fcommon to the set of compiler options. 


[...]
--- ttf2pk ---
/bin/sh ./libtool  --tag=CC    --mode=link cc -Wimplicit -Wreturn-type -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing   -fstack-protector-strong -o ttf2pk errormsg.o filesrch.o ftlib.o  ligkern.o newobj.o parse.o  subfont.o texenc.o ttfenc.o pklib.o ttf2pk.o  ttflib.o -L/usr/local/lib -lkpathsea -L/usr/local/lib -lfreetype -lz -lm
libtool: link: cc -Wimplicit -Wreturn-type -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -fstack-protector-strong -o ttf2pk errormsg.o filesrch.o ftlib.o ligkern.o newobj.o parse.o subfont.o texenc.o ttfenc.o pklib.o ttf2pk.o ttflib.o  -L/usr/local/lib -lkpathsea -lfreetype -lz -lm
ld: error: duplicate symbol: dpi
>>> defined at ftlib.c
>>>            ftlib.o:(dpi)
>>> defined at pklib.c
>>>            pklib.o:(.bss+0x940)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [ttf2pk] Error code 1

make[6]: stopped in /usr/ports/print/texlive-base/work/texlive-20150521-source/texk/ttf2pk2
1 error

make[6]: stopped in /usr/ports/print/texlive-base/work/texlive-20150521-source/texk/ttf2pk2
*** [recurse] Error code 1

make[4]: stopped in /usr/ports/print/texlive-base/work/texlive-20150521-source/texk
Comment 1 Niclas Zeising freebsd_committer freebsd_triage 2020-08-19 17:33:50 UTC
This should be fixed with ports r545441.

Please reopen if this is still an issue.