Bug 195343 - audio/libsidplay2 shoud be compiled with adding "-fPIC" to CFLAGS.
Summary: audio/libsidplay2 shoud be compiled with adding "-fPIC" to CFLAGS.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-24 18:21 UTC by SASAKI Katuhiro
Modified: 2014-12-29 14:55 UTC (History)
2 users (show)

See Also:


Attachments
A log and an errors when audio/xmms2 was built. (115.29 KB, text/plain)
2014-11-24 18:21 UTC, SASAKI Katuhiro
no flags Details
This is a patch for audio/libsidplay2. (419 bytes, patch)
2014-11-24 18:24 UTC, SASAKI Katuhiro
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description SASAKI Katuhiro 2014-11-24 18:21:32 UTC
Created attachment 149783 [details]
A log and an errors when audio/xmms2 was built.

Building "SID" enabled audio/xmms2 on 10.1-R/amd64 faild as following.

% cd /usr/ports/audio/xmms2
% sudo make
...
Optional configuration:
======================= 
Enabled:  et, launcher, mdns, nycli, pixmaps, vistest 
..
====================== 
Output:  airplay, alsa, ao, diskwrite, ices, jack, null, oss, pulse 
..
sid, sndfile, speex, tremor, tta, vocoder, vorbis, wave, wavpack, xml, xspf 
Disabled:  coreaudio, gvfs, nms, sc68, sun, waveout 
'configure' finished successfully (4.603s)
===>  Building for xmms2-0.8_14
...
[217/285] cxxshlib: _build_/src/plugins/sid/sid.c.1.o _build_/src/plugins/sid/sidplay_wrapper.cpp.1.o _build_/src/plugins/sid/md5.cpp.1.o -> _build_/src/plugins/sid/libxmms_sid.so
/usr/bin/ld: /usr/local/lib/sidplay/builders/libresid-builder.a(resid-builder.o): relocation R_X86_64_32S against `_ZTV12ReSIDBuilder' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/sidplay/builders/libresid-builder.a: could not read symbols: Bad value
c++: error: linker command failed with exit code 1 (use -v to see invocation)
Waf: Leaving directory `/var/portbuild/usr/ports/audio/xmms2/work/xmms2-0.8DrO_o/_build_'
Build failed
...
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/audio/xmms2
*** Error code 1

Stop.

As shown, error was occurred. And the message "relocation R_X86_64_32S against `_ZTV12ReSIDBuilder' can not be used when making a shared object; recompile with -fPIC" was recognised.
Then, I work on adding "CFlAGS+=-fPIC" to Makefile of audio/libsidplay2 and bulding & installing audio/libsidplay2. After that, bulding audio/xmms2 finished normaly.

When using i386, "CFlAGS+=-fPIC" is not necessary. So I changed "CFLAGS+=-fPIC" to "CFLAGS_amd64+=-fPIC".
Comment 1 SASAKI Katuhiro 2014-11-24 18:24:26 UTC
Created attachment 149784 [details]
This is a patch for audio/libsidplay2.

This patch add "CFLAGS_amd64+=-fPIC" to Makefile of audion/libsidplay2.
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-12-26 19:37:30 UTC
A commit references this bug:

Author: riggs
Date: Fri Dec 26 19:36:41 UTC 2014
New revision: 375650
URL: https://svnweb.freebsd.org/changeset/ports/375650

Log:
  - Fix build break of ports expecting -fPIC for libsidplay2 on amd64
  - Bump PORTREVISION of libsidplay2 and sidplay2 (package change)

  PR:		195343
  Submitted by:	crest@sahiro.org
  MFH:		2014Q4

Changes:
  head/audio/libsidplay2/Makefile
  head/audio/sidplay2/Makefile
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-12-29 14:55:03 UTC
A commit references this bug:

Author: riggs
Date: Mon Dec 29 14:54:54 UTC 2014
New revision: 375791
URL: https://svnweb.freebsd.org/changeset/ports/375791

Log:
  MFH: r375650

  - Fix build break of ports expecting -fPIC for libsidplay2 on amd64
  - Bump PORTREVISION of libsidplay2 and sidplay2 (package change)

  PR:		195343
  Submitted by:	crest@sahiro.org
  Approved by:	ports-secteam (rea)

Changes:
_U  branches/2014Q4/
  branches/2014Q4/audio/libsidplay2/Makefile