Bug 230215 - multimedia/libfame: fail to link with lld as /usr/bin/ld on i386
Summary: multimedia/libfame: 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:59 UTC by Ed Maste
Modified: 2018-08-18 08:55 UTC (History)
1 user (show)

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 2018-07-30 23:59:33 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/libfame with lld on i386 fails with errors of the form:

/usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: _mmx_1 in readonly segment; recompile object files with -fPIC
>>> defined in fame.lo
>>> referenced by fame_encoder_mpeg.c
>>>               fame_encoder_mpeg.lo:(mpeg_encode_intra_mb)

/usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: _mmx_cos in readonly segment; recompile object files with -fPIC
>>> defined in fame.lo
>>> referenced by fame_encoder_mpeg.c
>>>               fame_encoder_mpeg.lo:(mpeg_encode_intra_mb)

http://package18.nyi.freebsd.org/data/headi386PR214864-default/2018-07-30_18h09m59s/logs/errors/libfame-0.9.1_5.log
Comment 1 Ed Maste freebsd_committer 2018-08-01 12:34:50 UTC
I think this Makefile addition may work:

.if ${ARCH} == i386
# PR230215 Allow relocations against read-only segments (override lld default)
LDFLAGS+=-Wl,-z,notext
.endif
Comment 2 Thomas Zander freebsd_committer 2018-08-18 08:55:38 UTC
LLD_UNSAFE committed in r477486.