Bug 235590 - devel/cpu_features: build with CFLAGS=-fPIC
Summary: devel/cpu_features: build with CFLAGS=-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: Steven Kreuzer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-08 04:25 UTC by Koichiro Iwao
Modified: 2019-02-13 02:12 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (skreuzer)


Attachments
patch (587 bytes, text/plain)
2019-02-08 04:25 UTC, Koichiro Iwao
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Koichiro Iwao freebsd_committer 2019-02-08 04:25:27 UTC
Created attachment 201829 [details]
patch

Unless devel/cpu_features is built with -fPIC option, applications that links to libcpu_features.a fails to build. No ports depends on libcpu_features.a so far but a port I'm creating depends on the library.

/usr/bin/ld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC
>>> defined in /usr/local/lib/libcpu_features.a(cpuinfo_x86.c.o)
>>> referenced by cpuinfo_x86.c
>>>               cpuinfo_x86.c.o:(.rodata+0x8) in archive /usr/local/lib/libcpu_features.a
Comment 1 commit-hook freebsd_committer 2019-02-13 02:11:45 UTC
A commit references this bug:

Author: skreuzer
Date: Wed Feb 13 02:11:18 UTC 2019
New revision: 492822
URL: https://svnweb.freebsd.org/changeset/ports/492822

Log:
  Generate position independent code

  PR:		235590
  Submitted by:	Koichiro Iwao <meta@FreeBSD.org>

Changes:
  head/devel/cpu_features/Makefile
Comment 2 Steven Kreuzer freebsd_committer 2019-02-13 02:12:24 UTC
Port has been updated to pass -fPIC to cc. Thanks for the report