| Summary: | graphics/lprof-devel: fails to build with LLD 7 | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Jan Beich <jbeich> | ||||||
| Component: | Individual Port(s) | Assignee: | Dmitry Marakasov <amdmi3> | ||||||
| Status: | Closed FIXED | ||||||||
| Severity: | Affects Only Me | CC: | amdmi3, emaste, ndowens04 | ||||||
| Priority: | --- | Keywords: | needs-patch | ||||||
| Version: | Latest | Flags: | amdmi3:
maintainer-feedback+
|
||||||
| Hardware: | Any | ||||||||
| OS: | Any | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 214864, 230355 | ||||||||
| Attachments: |
|
||||||||
|
Description
Jan Beich
2018-08-29 11:51:53 UTC
Can be worked around via LLD_UNSAFE. I can't bisect LLD commits to figure out why LLD 6 built fine. In order to reproduce outside of clang700-import (e.g., on 11.2) try adding the following to Makefile.local:
BUILD_DEPENDS+= ld.lld70:devel/llvm70
LDFLAGS+= -fuse-ld=${LOCALBASE}/bin/ld.lld70
Example build log: https://ptpb.pw/JAre
Created attachment 196688 [details]
Fix LD error; Add License
graphics/lprof-devel:
* Fix LD errors
* Added License while here
Tested on 12-Current and built fine
Comment on attachment 196688 [details] Fix LD error; Add License > +LICENSE= GPLv3 License headers in the source contain "or (at your option) any later version" clause, so you may want to add "+" suffix i.e., LICENSE=GPLv3+. > +LDD_UNSAFE= yes Typo: LDD -> LLD Created attachment 196693 [details]
Fix LD error; Add License
Approved, please commit. Let me try something. Think I may have found a way to not use lld_undafe I’m not on a PC but can if you remove LLD_UNSAFE and add: CFLAGS+= -fPIC This fixes linker issues. Figured this out on one port I’ve been working on Seems adding fPIC solves the linker issues on 12. Atleast on ones I’ve tried (In reply to Nathan from comment #9) > Seems adding fPIC solves the linker issues on 12. Atleast on ones I’ve tried Did you use LLD 7 which hasn't landed to -CURRENT yet? -fPIC doesn't help here, see https://ptpb.pw/r0Mf (clang700-import@r338392 amd64) (In reply to Nathan from comment #9) Indeed, one common failure with lld is 3rd party code for a shared object that isn't compiled with -fPIC, because that implies that the output will have relocations against .text which GNU ld allows by default and lld does not. LLD_UNSAFE=yes is a big but easy hammer for this - just revert to GNU ld. Adding -Wl,-z,notext to LDFLAGS is a medium hammer - link with lld but allow the text relocation. Adding -fPIC CFLAGS is the most "correct" fix but introduces code and perhaps performance changes. Note that this is not the only type of issue that prevents use of LLD, and some software will still fail to link with LLD with -fPIC. (In reply to Jan Beich from comment #10) Nope I have clang 6.0.1
I added LDFLAGS= -fuse-ld=${LOCALBASE/bin/ld.lldd70}
to this port's Makefile, I didn't get no error on amd64 12-cur
A commit references this bug: Author: amdmi3 Date: Fri Dec 28 18:15:55 UTC 2018 New revision: 488613 URL: https://svnweb.freebsd.org/changeset/ports/488613 Log: - Add license - Fix build with LLD PR: 230994 Submitted by: ndowens@yahoo.com Reported by: jbeich@FreeBSD.org Changes: head/graphics/lprof-devel/Makefile |