Bug 222852

Summary: archivers/p7zip: armv7 arch needs -fPIC cflags
Product: Ports & Packages Reporter: guyyur
Component: Individual Port(s)Assignee: Raphael Kubo da Costa <rakuco>
Status: Closed FIXED    
Severity: Affects Only Me CC: freebsd-arm
Priority: --- Flags: rakuco: maintainer-feedback+
Version: Latest   
Hardware: arm   
OS: Any   

Description guyyur 2017-10-07 19:03:48 UTC
The newly added armv7 arch needs -fPIC when building p7zip.

Without it, it fails with:
/usr/bin/ld: 7zEncode.o(.text+0x2d04): unresolvable R_ARM_MOVW_ABS_NC
relocation against symbol `_ZTIi@@CXXABI_1.3'
/usr/bin/ld: final link failed: Nonrepresentable section on output
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** [../../../../bin/7z.so] Error code 1

make[3]: stopped in
/usr/wrkdir/usr/ports/archivers/p7zip/work/p7zip_16.02/CPP/7zip/Bundles/Format7zFree
1 error

Adding the following line to the Makefile resolves the problem
CFLAGS_armv7= -fPIC
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-10-07 19:11:23 UTC
A commit references this bug:

Author: rakuco
Date: Sat Oct  7 19:10:45 UTC 2017
New revision: 451477
URL: https://svnweb.freebsd.org/changeset/ports/451477

Log:
  Pass -fPIC on armv7 as well.

  This fixes the following build error:

  /usr/bin/ld: 7zEncode.o(.text+0x2d04): unresolvable R_ARM_MOVW_ABS_NC relocation against symbol `_ZTIi@@CXXABI_1.3'
  /usr/bin/ld: final link failed: Nonrepresentable section on output
  c++: error: linker command failed with exit code 1 (use -v to see invocation)

  PR:		222852
  Submitted by:	guyyur@gmail.com

Changes:
  head/archivers/p7zip/Makefile
Comment 2 Raphael Kubo da Costa freebsd_committer freebsd_triage 2017-10-07 19:12:07 UTC
Committed, thanks!