Bug 234857

Summary: cad/qcad: fails to build on i386 with lld as system linker
Product: Ports & Packages Reporter: Ed Maste <emaste>
Component: Individual Port(s)Assignee: Michael Reifenberger <mr>
Status: New ---    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (mr)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 214864    

Description Ed Maste freebsd_committer 2019-01-11 13:58:21 UTC
http://package18.nyi.freebsd.org/build.html?mastername=headi386PR214864-default&build=2019-01-05_21h00m02s
http://package18.nyi.freebsd.org/data/headi386PR214864-default/2019-01-05_21h00m02s/logs/errors/qcad-3.21.3.11.log

ld: error: relocation R_386_PC32 cannot be used against symbol ON_GetPointListBoundingBox(int, int, int, int, double const*, ON_BoundingBox&, int, ON_Xform const*); recompile with -fPIC
>>> defined in /usr/local/lib/libopenNURBS.a(opennurbs_bounding_box.o)
>>> referenced by opennurbs_bezier.cpp:30
>>>               opennurbs_bezier.o:(ON_BezierCurve::GetTightBoundingBox(ON_BoundingBox&, int, ON_Xform const*) const) in archive /usr/local/lib/libopenNURBS.a

ld: error: relocation R_386_PC32 cannot be used against symbol ON_4dPointArray::ON_4dPointArray(); recompile with -fPIC
>>> defined in /usr/local/lib/libopenNURBS.a(opennurbs_array.o)
>>> referenced by opennurbs_bezier.cpp:44
>>>               opennurbs_bezier.o:(ON_PolynomialCurve::ON_PolynomialCurve()) in archive /usr/local/lib/libopenNURBS.a

ld: error: relocation R_386_PC32 cannot be used against symbol ON_Interval::ON_Interval(double, double); recompile with -fPIC
>>> defined in /usr/local/lib/libopenNURBS.a(opennurbs_point.o)
>>> referenced by opennurbs_bezier.cpp:45
>>>               opennurbs_bezier.o:(ON_PolynomialCurve::ON_PolynomialCurve()) in archive /usr/local/lib/libopenNURBS.a

...


It may be as simple as adding LDFLAGS_i386=-Wl,-z,notext to the port's Makefile or adding -fPIC to CFLAGS for the associated objects. (I haven't yet been able to build it locally to try.)
Comment 1 Ed Maste freebsd_committer 2019-07-24 19:35:04 UTC
lld has been enabled as system linker for i386 on stable/12 in advance of 12.1 (base svn r350297, a few minutes ago)