Bug 230208 - multimedia/xvid: fail to link with lld as /usr/bin/ld on i386
Summary: multimedia/xvid: fail to link with lld as /usr/bin/ld on i386
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: i386 Any
: --- Affects Only Me
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks: 214864
  Show dependency treegraph
 
Reported: 2018-07-30 23:49 UTC by Ed Maste
Modified: 2018-09-18 16:04 UTC (History)
0 users

See Also:
riggs: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 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 freebsd_triage 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 freebsd_triage 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