[MacPorts] #53361: libgmp gives illegal text-relocation error when linking with other programs in Sierra

MacPorts noreply at macports.org
Sat Jan 21 02:30:20 UTC 2017


#53361: libgmp gives illegal text-relocation error when linking with other programs
in Sierra
----------------------+-----------------
 Reporter:  cytan299  |      Owner:
     Type:  defect    |     Status:  new
 Priority:  Normal    |  Milestone:
Component:  ports     |    Version:
 Keywords:            |       Port:
----------------------+-----------------
 libgmp @6.1.2_0 when linking with other programs in Sierra I get the
 following error:

 ld: illegal text-relocation to '___gmp_binvert_limb_table' in
 /opt/local/lib/libgmp.a(mp_minv_tab.o) from '___gmpn_divexact_1' in
 /opt/local/lib/libgmp.a(dive_1.o) for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see
 invocation)

 I fixed this by downloading the gmp source and during configure using:

 configure --with-pic

 After doing this, and overwriting the libgmp.a and libgmp.10.dylib in
 /opt/local/lib, llinking with other programs does not give above error.

 The above fix came from:

 https://github.com/Homebrew/legacy-homebrew/issues/12946

 I am running: MacOSX 10.12.2 Sierra with:

 gcc -v
 Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
 --with-gxx-include-dir=/usr/include/c++/4.2.1
 Apple LLVM version 8.0.0 (clang-800.0.42.1)
 Target: x86_64-apple-darwin16.3.0
 Thread model: posix
 InstalledDir:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

--
Ticket URL: <https://trac.macports.org/ticket/53361>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list