Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 835867

Summary: sys-devel/clang-13.0.1 has a bad default library path
Product: Gentoo Linux Reporter: Jannik Glückert <jannik.glueckert>
Component: Current packagesAssignee: LLVM support project <llvm>
Status: RESOLVED FIXED    
Severity: normal CC: Adrian.Bassett, mgorny, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/llvm/llvm-project/commit/afaefb671fe12e7788d3e8de6b6193b935fbf16c
See Also: https://github.com/llvm/llvm-project/issues/54952
Whiteboard:
Package list:
Runtime testing required: ---

Description Jannik Glückert 2022-03-23 21:44:47 UTC
clang-13.0.1 and 14.0.0 only add the 32bit LLVM & clang library path, but not the 64bit versions to the default search dirs - this results in linking errors when trying to link libLLVM & friends in 64bit mode

clang -print-search-dirs :
programs: =/usr/lib/llvm/13/bin:/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin
libraries: =/usr/lib/llvm/13/bin/../../../../lib/clang/13.0.1:/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1:/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../lib64:/lib/../lib64:/usr/lib/../lib64:/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/lib:/usr/lib/llvm/13/bin/../lib:/lib:/usr/lib

Not sure if this was also present in 13.0.0 and earlier
Comment 1 Mike Lothian 2022-03-23 23:16:53 UTC
For 14:

clang -print-search-dirs
programs: =/usr/lib/llvm/14/bin:/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin
libraries: =/usr/lib/llvm/14/bin/../../../../lib/clang/14.0.0:/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1:/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../lib64:/lib/../lib64:/usr/lib/../lib64:/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/lib:/usr/lib/llvm/14/bin/../lib:/usr/lib/llvm/14/bin/../lib64:/lib:/usr/lib
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-03-24 08:32:22 UTC
If I read the diff right, the lib64 paths were added for OpenMP runtime, so it probably "improved" by accident.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-03-24 08:38:35 UTC
Unfortunately, I can't find where non-suffixed path is being added.  It might be a part of the complex logic for finding GCC install.
Comment 4 Mike Lothian 2022-03-25 22:34:08 UTC
I think this is the fix for 14

https://github.com/llvm/llvm-project/commit/afaefb671fe12e7788d3e8de6b6193b935fbf16c
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-25 22:34:38 UTC
(In reply to Mike Lothian from comment #4)
> I think this is the fix for 14
> 
> https://github.com/llvm/llvm-project/commit/
> afaefb671fe12e7788d3e8de6b6193b935fbf16c

Yep, we've been working with meowray to get it in.
Comment 6 Larry the Git Cow gentoo-dev 2022-03-25 23:21:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b6d9bf8ee0ebf690292f03468667f1d4fa73d5b

commit 8b6d9bf8ee0ebf690292f03468667f1d4fa73d5b
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2022-03-25 22:07:22 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2022-03-25 23:21:22 +0000

    sys-devel/clang: Backport wrong library search path fix
    
    Closes: https://bugs.gentoo.org/835867
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 sys-devel/clang/Manifest                                        | 2 +-
 sys-devel/clang/{clang-14.0.0.ebuild => clang-14.0.0-r1.ebuild} | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 7 Mike Lothian 2022-04-15 11:29:57 UTC
It looks like this patch wasn't backported to 14.0.1 from main. Would you mind creating a 14.0.1-r1?
Comment 8 Larry the Git Cow gentoo-dev 2022-04-17 15:45:51 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66a7c34c9374df4e6b44f299cc6876d75c19ef7f

commit 66a7c34c9374df4e6b44f299cc6876d75c19ef7f
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-04-17 15:45:12 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-04-17 15:45:40 +0000

    sys-devel/clang: restore library search path patch to 14.0.1
    
    Closes: https://bugs.gentoo.org/835867
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/clang/Manifest                                        | 2 +-
 sys-devel/clang/{clang-14.0.1.ebuild => clang-14.0.1-r1.ebuild} | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)