Bug 217688

Summary: mail/libsrs2 linkfail: needs -fPIC
Product: Ports & Packages Reporter: Larry Rosenman <ler>
Component: Individual Port(s)Assignee: Kurt Jaeger <pi>
Status: Closed FIXED    
Severity: Affects Only Me CC: tijl
Priority: --- Flags: pi: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch none

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