Bug 193438

Summary: devel/bullet: Build with -fPIC (fixes linking with efl)
Product: Ports & Packages Reporter: Grzegorz Blach <gblach>
Component: Individual Port(s)Assignee: Jose Alonso Cardenas Marquez <acm>
Status: Closed FIXED    
Severity: Affects Some People CC: acm, tijl, tim
Priority: --- Keywords: needs-qa, patch
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Add CXXFLAGS+=-fPIC
koobs: maintainer-approval? (acm)
Alternate patch: build shared libs tijl: maintainer-approval? (acm)

Description Grzegorz Blach freebsd_committer freebsd_triage 2014-09-07 18:10:03 UTC
Created attachment 147022 [details]
Add CXXFLAGS+=-fPIC

I'm working on devel/efl port (https://redports.org/browser/gblach/devel/efl).
On amd64 platform Efl can be linked with Bullet only if Bullet is build with -fPIC. On i386 -fPIC have no impact.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2014-09-08 02:05:41 UTC
Comment on attachment 147022 [details]
Add CXXFLAGS+=-fPIC

Thank you for your submission Grzegorz.

If possible please also include the following QA results to promote quick 
resolution:

 * Attach successful poudriere testport, or redports.org build logs
 * portlint -AC output (after addressing any outstanding issues)
 * Attach a log showing the failed and then successful linking invocation (with your patch applied)
Comment 2 Tijl Coosemans freebsd_committer freebsd_triage 2014-09-08 10:08:40 UTC
Created attachment 147053 [details]
Alternate patch: build shared libs
Comment 3 Tijl Coosemans freebsd_committer freebsd_triage 2014-09-08 10:27:58 UTC
Comment on attachment 147053 [details]
Alternate patch: build shared libs

Adding -fPIC to CFLAGS/CXXFLAGS is a bad practice and we need to stop doing that (if possible!).  It is usually a sign that something else is wrong and it causes executables and static libraries to be compiled with -fPIC as well when normally only shared libraries need it.  In this case it can be avoided by enabling shared libraries in devel/bullet.  Can you test if this patch fixes devel/efl?
Comment 4 Grzegorz Blach freebsd_committer freebsd_triage 2014-09-08 23:46:40 UTC
Patch which enables build of shared libs looks better in my opinion.

This is a log from redports with current bullet port
https://redports.org/~gblach/20140830211834-23159-238971/efl-1.11.1.log

and this is a log with Tijl's patch applied: https://redports.org/~gblach/20140908215452-52737-242345/efl-1.11.1.log
Comment 5 tim 2014-09-22 12:00:55 UTC
This patch is required to build Fawkes on FreeBSD. The problem appears when linking against two (shared) libraries which again link against bullet's LinearMath. Any chance to get this integrated soonish?
Comment 6 commit-hook freebsd_committer freebsd_triage 2014-09-22 16:11:56 UTC
A commit references this bug:

Author: tijl
Date: Mon Sep 22 16:11:11 UTC 2014
New revision: 368969
URL: http://svnweb.freebsd.org/changeset/ports/368969

Log:
  Build shared libraries needed by upcoming devel/efl

  PR:		193438
  Approved by:	maintainer timeout (2 weeks)

Changes:
  head/devel/bullet/Makefile
  head/devel/bullet/pkg-plist