Bug 235590

Summary: devel/cpu_features: build with CFLAGS=-fPIC
Product: Ports & Packages Reporter: Koichiro Iwao <meta>
Component: Individual Port(s)Assignee: Steven Kreuzer <skreuzer>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (skreuzer)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Description Flags
patch none

Description Koichiro Iwao freebsd_committer 2019-02-08 04:25:27 UTC
Created attachment 201829 [details]

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

  Generate position independent code

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

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