Bug 217688 - mail/libsrs2 linkfail: needs -fPIC
Summary: mail/libsrs2 linkfail: needs -fPIC
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-10 17:46 UTC by Larry Rosenman
Modified: 2017-04-24 17:21 UTC (History)
1 user (show)

See Also:
pi: maintainer-feedback+


Attachments
patch (595 bytes, patch)
2017-03-10 19:18 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Larry Rosenman freebsd_committer freebsd_triage 2017-03-10 17:46:22 UTC
cc -shared  srs2.lo sha1.lo   -Wl,-soname -Wl,libsrs2.so.0 -o .libs/libsrs2.so.0.0.0
/usr/bin/ld: sha1.lo: relocation R_X86_64_PC32 against `__stack_chk_guard@@FBSD_1.0' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
cc: error: linker command failed with exit code 1 (use -v to see invocation)

http://home.lerctr.org:8888/data/p110amd64-host-ports/2017-03-08_21h18m13s/logs/errors/libsrs2-1.0.18_3.log

I made a local mod just bumping PORTREVISION and adding

CFLAGS+= -fPIC

and it compiles fine.  I'm not sure if that's 100% correct.
Comment 1 Tijl Coosemans freebsd_committer freebsd_triage 2017-03-10 19:18:55 UTC
Created attachment 180704 [details]
patch

This patch fixes the real cause.

Disable separate build of libsrs2.a.  It is already built as part of libsrs2.la and the two targets step on each other's toes possibly causing link failures.
Comment 2 Kurt Jaeger freebsd_committer freebsd_triage 2017-04-24 17:20:47 UTC
Committed, thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-04-24 17:21:14 UTC
A commit references this bug:

Author: pi
Date: Mon Apr 24 17:20:32 UTC 2017
New revision: 439335
URL: https://svnweb.freebsd.org/changeset/ports/439335

Log:
  mail/libsrs2: fix linking error...

  - ... by disabling separate build of libsrs2.a

  PR:		217688
  Reported by:	ler
  Submitted by:	tijl

Changes:
  head/mail/libsrs2/Makefile