Bug 230208

Summary: multimedia/xvid: fail to link with lld as /usr/bin/ld on i386
Product: Ports & Packages Reporter: Ed Maste <emaste>
Component: Individual Port(s)Assignee: Thomas Zander <riggs>
Status: Closed FIXED    
Severity: Affects Only Me Flags: riggs: maintainer-feedback+
Priority: ---    
Version: Latest   
Hardware: i386   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230214
Bug Depends on:    
Bug Blocks: 214864    

Description Ed Maste freebsd_committer 2018-07-30 23:49:19 UTC
The migration to the LLVM project's lld linker as the system linker (/usr/bin/ld) for FreeBSD is in progress - it is the case for arm64 and amd64 today, and i386 will switch once ports issues are addressed - see exp-run in PR214864.

Linking multimedia/xvid with lld as /usr/bin/ld on i386 produces errors of the form:
/usr/bin/ld: error: can't create dynamic relocation R_386_32 against local symbol in readonly segment; recompile object files with -fPIC
>>> defined in bitstream/x86_asm/cbp_mmx.o
>>> referenced by ../../src/bitstream/x86_asm/cbp_mmx.asm
>>>               bitstream/x86_asm/cbp_mmx.o:(calc_cbp_mmx)
Comment 1 commit-hook freebsd_committer 2018-08-05 10:25:36 UTC
A commit references this bug:

Author: riggs
Date: Sun Aug  5 10:24:49 UTC 2018
New revision: 476404
URL: https://svnweb.freebsd.org/changeset/ports/476404

Log:
  Set LLD_UNSAFE on i386 in preparation for switch to lld on FreeBSD 12

  PR:		230208
  Reported by:	emaste

Changes:
  head/multimedia/xvid/Makefile
Comment 2 commit-hook freebsd_committer 2018-09-18 16:04:30 UTC
A commit references this bug:

Author: emaste
Date: Tue Sep 18 16:04:20 UTC 2018
New revision: 480032
URL: https://svnweb.freebsd.org/changeset/ports/480032

Log:
  multimedia/xvid: link with -znotext on i386

  This port links some non-PIC code, which fails with lld as it defaults
  to disallowing relocations against read-only segments. For i386 we can
  just add -znotext unconditionally: for GNU BFD ld it just affirms BFD's
  existing default.

  PR:		214864, 230208
  Approved by:	bapt
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D17195

Changes:
  head/multimedia/xvid/Makefile