Bug 216473

Summary: multimedia/x265: fails to build on aarch64
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: mi, mikael
Priority: --- Keywords: needs-patch
Version: LatestFlags: bugzilla: maintainer-feedback? (mi)
Hardware: Any   
OS: Any   
URL: https://bitbucket.org/multicoreware/x265/issues/294/how-to-cross-compile-x265-20-for-aarch64
Bug Depends on:    
Bug Blocks: 201763, 216471    
Attachments:
Description Flags
aarch64 fix none

Description Jan Beich freebsd_committer freebsd_triage 2017-01-26 00:10:32 UTC
/usr/bin/ld: common/CMakeFiles/common.dir/common.cpp.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stderrp@@FBSD_1.0' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: common/CMakeFiles/common.dir/common.cpp.o(.text+0x1e0): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stderrp@@FBSD_1.0'
/usr/bin/ld: final link failed: Bad value
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

http://thunderx1.nyi.freebsd.org/data/110arm64-default/432308/logs/errors/x265-2.2.log
http://thunderx1.nyi.freebsd.org/data/110arm64-quarterly/432290/logs/errors/x265-1.9.log
Comment 1 Mikael Urankar freebsd_committer freebsd_triage 2017-01-26 11:45:12 UTC
Created attachment 179328 [details]
aarch64 fix

It builds fine on -current with the attached patch.
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-01-26 14:31:24 UTC
A commit references this bug:

Author: jbeich
Date: Thu Jan 26 14:31:02 UTC 2017
New revision: 432495
URL: https://svnweb.freebsd.org/changeset/ports/432495

Log:
  multimedia/x265: unbreak on aarch64[1] and mips

  /usr/bin/ld: common/CMakeFiles/common.dir/common.cpp.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stderrp@@FBSD_1.0' can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld: common/CMakeFiles/common.dir/common.cpp.o(.text+0x1e0): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stderrp@@FBSD_1.0'
  /usr/bin/ld: final link failed: Bad value

  /usr/bin/ld: x265: hidden symbol `__sync_fetch_and_add_4' in /usr/lib/libgcc.a(stdatomic.o) is referenced by DSO
  /usr/bin/ld: final link failed: Nonrepresentable section on output

  PR:		216473 [1]
  Reported by:	pkg-fallout
  Submitted by:	mikael.urankar@gmail.com [1]
  Approved by:	portmgr blanket

Changes:
  head/multimedia/x265/Makefile
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-01-26 14:35:30 UTC
A commit references this bug:

Author: jbeich
Date: Thu Jan 26 14:35:00 UTC 2017
New revision: 432496
URL: https://svnweb.freebsd.org/changeset/ports/432496

Log:
  MFH: r432495

  multimedia/x265: unbreak on aarch64[1] and mips

  /usr/bin/ld: common/CMakeFiles/common.dir/common.cpp.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stderrp@@FBSD_1.0' can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld: common/CMakeFiles/common.dir/common.cpp.o(.text+0x1e0): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stderrp@@FBSD_1.0'
  /usr/bin/ld: final link failed: Bad value

  /usr/bin/ld: x265: hidden symbol `__sync_fetch_and_add_4' in /usr/lib/libgcc.a(stdatomic.o) is referenced by DSO
  /usr/bin/ld: final link failed: Nonrepresentable section on output

  PR:		216473 [1]
  Reported by:	pkg-fallout
  Submitted by:	mikael.urankar@gmail.com [1]
  Approved by:	portmgr blanket
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2017Q1/
  branches/2017Q1/multimedia/x265/Makefile
Comment 4 Jan Beich freebsd_committer freebsd_triage 2017-01-26 14:36:39 UTC
Thanks. Landed.