Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 738948 - dev-util/codeblocks-20.03-r1 fails to link with LLD because of /usr/lib in the link command line
Summary: dev-util/codeblocks-20.03-r1 fails to link with LLD because of /usr/lib in th...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sergey Torokhov
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: LD-is-lld, systemwide-lld
  Show dependency tree
 
Reported: 2020-08-25 12:41 UTC by Agostino Sarubbo
Modified: 2021-04-18 08:56 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,42.22 KB, text/plain)
2020-08-25 12:41 UTC, Agostino Sarubbo
Details
1-autoconf.out (1-autoconf.out,124 bytes, text/plain)
2020-08-25 12:41 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-08-25 12:41:30 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-util/codeblocks-20.03-r1 fails to link with LLD because of /usr/lib in the link command line.
Discovered on: amd64 (internal ref: tinderbox)

NOTE:
This PR gives an idea about a fix: https://github.com/PhotoFlare/photoflare/pull/248/files.
Comment 1 Agostino Sarubbo gentoo-dev 2020-08-25 12:41:33 UTC
Created attachment 656608 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2020-08-25 12:41:34 UTC
Created attachment 656610 [details]
1-autoconf.out

1-autoconf.out
Comment 3 Sergey Torokhov 2020-08-25 14:16:01 UTC
(In reply to Agostino Sarubbo from comment #0)
> 
> NOTE:
> This PR gives an idea about a fix:
> https://github.com/PhotoFlare/photoflare/pull/248/files.

Maybe conditional patching with `get_libdir` function to use correct library path is worth to use?
Comment 4 Sergey Torokhov 2020-09-19 16:03:41 UTC
(In reply to Agostino Sarubbo from comment #0)
> https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/
> 
> Issue: dev-util/codeblocks-20.03-r1 fails to link with LLD because of
> /usr/lib in the link command line.
> Discovered on: amd64 (internal ref: tinderbox)
> 
> NOTE:
> This PR gives an idea about a fix:
> https://github.com/PhotoFlare/photoflare/pull/248/files.

The clang and llvm linker (lld) are used :) I didn't see at first.

I confirm that I can reproduce this issue by command:
> LDFLAGS="${LDFLAGS} -fuse-ld=lld" FEATURES="-ccache" USE="-contrib -fortran -pch" CC="clang" CXX="clang++" ebuild codeblocks-20.03-r1.ebuild clean compile


It's seems the problem with tinyxml.pc file provided by dev-lib/tinyxml.
When lld is used then pkgconfig tries to set variables directly from tinyxml.pc and  add them to LDFLAGS, i.e. -L/usr/lib -ltinyxml.

Could check if issue resolved if you replace in /usr/share/pkgconfig/tinyxml.pc
/lib with /lib64 ? It fix it for me with lld. 

It seems this is onny package where /lib is used instead of /lib64 for ~amd64 arch. If this is resolved issue then dev-libs/tinyxml could be updated with patching of tinyxml.pc with appropriate arch by (get_libdir). Sorry,  it's my early fault.
Comment 5 Larry the Git Cow gentoo-dev 2020-09-23 09:00:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f4675fd1036e0a31215bac7e994b5d26d7e1cd5

commit 4f4675fd1036e0a31215bac7e994b5d26d7e1cd5
Author:     Sergey Torokhov <torokhov-s-a@yandex.ru>
AuthorDate: 2020-09-19 23:01:28 +0000
Commit:     Bernard Cafarelli <voyageur@gentoo.org>
CommitDate: 2020-09-23 09:00:09 +0000

    dev-libs/tinyxml: fix libdir path in tinyxml.pc file
    
    While using clang/llvm/lld env the on configuration phase
    the information about library directory is taken from tinyxml.pc file.
    
    On the amd64 arch system the use of lld linker instead of ldd
    results in linking error as LDFLAGS is additionally filled with
    `-L/usr/lib -ltinyxml` instead of `-L/usr/lib64 -ltinyxml`.
    
    I.e. it causes linking error for dev-util/codeblocks package
    on clang/llvm/lld systems.
    
    Closes: https://bugs.gentoo.org/738948
    
    Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
    Closes: https://github.com/gentoo/gentoo/pull/17606
    Signed-off-by: Bernard Cafarelli <voyageur@gentoo.org>

 dev-libs/tinyxml/tinyxml-2.6.2-r4.ebuild | 67 ++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)