Bug 222852 - archivers/p7zip: armv7 arch needs -fPIC cflags
Summary: archivers/p7zip: armv7 arch needs -fPIC cflags
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Only Me
Assignee: Raphael Kubo da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-07 19:03 UTC by guyyur
Modified: 2017-10-07 19:12 UTC (History)
1 user (show)

See Also:
rakuco: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 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 2017-10-07 19:12:07 UTC
Committed, thanks!