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

Bug 695726

Summary: dev-util/perf-5.1.15 USE=clang with sys-devel/clang:9 - util/c++/clang.cpp:74:8: error: ‘class clang::CompilerInstance’ has no member named ‘setVirtualFileSystem’; did you mean ‘getVirtualFileSystem’?
Product: Gentoo Linux Reporter: Erik Zeek <zeekec>
Component: Current packagesAssignee: Naohiro Aota <naota>
Status: RESOLVED FIXED    
Severity: normal CC: b.buschinski, dlan, dschridde+gentoobugs, gaireg+bgo, mail, maintainer-needed, treecleaner
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: dev-util:perf-5.1.15:20190927-122735.log.gz
emerge --info '=dev-util/perf-5.1.15::gentoo'
possible fix
build.log
perf-5.3.7-compat-clang-9.patch (supporting all versions of sys-devel/clang supported by Gentoo)

Description Erik Zeek 2019-09-27 12:36:12 UTC
Created attachment 591164 [details]
dev-util:perf-5.1.15:20190927-122735.log.gz

x86_64-pc-linux-gnu-g++ -Wp,-MD,util/c++/.clang.o.d -Wp,-MT,util/c++/clang.o -O2 -pipe -ggdb -mtune=native -march=native -std=gnu++11 -fno-exceptions -fno-rtti -Wall -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wno-strict-aliasing -I/gentoo/tmp/portage/dev-util/perf-5.1.15/work/linux-5.1/tools/perf/util/include -I/gentoo/tmp/portage/dev-util/perf-5.1.15/work/linux-5.1/tools/perf/arch/x86/include -I/gentoo/tmp/portage/dev-util/perf-5.1.15/work/linux-5.1/tools/include/uapi -I/gentoo/tmp/portage/dev-util/perf-5.1.15/work/linux-5.1/tools/include/ -I/gentoo/tmp/portage/dev-util/perf-5.1.15/work/linux-5.1/tools/arch/x86/include/uapi -I/gentoo/tmp/portage/dev-util/perf-5.1.15/work/linux-5.1/tools/arch/x86/include/ -I/gentoo/tmp/portage/dev-util/perf-5.1.15/work/linux-5.1/tools/arch/x86/ -I/gentoo/tmp/portage/dev-util/perf-5.1.15/work/linux-5.1/tools/perf/util -I/gentoo/tmp/portage/dev-util/perf-5.1.15/work/linux-5.1/tools/perf -I/gentoo/tmp/portage/dev-util/perf-5.1.15/work/linux-5.1/tools/lib/ -DHAVE_LIBCLANGLLVM_SUPPORT -I/usr/lib/llvm/9/include -D"BUILD_STR(s)=#s"   -c -o util/c++/clang.o util/c++/clang.cpp
util/c++/clang.cpp: In function ‘std::unique_ptr<llvm::Module> perf::getModuleFromSource(llvm::opt::ArgStringList, llvm::StringRef, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>)’:
util/c++/clang.cpp:74:8: error: ‘class clang::CompilerInstance’ has no member named ‘setVirtualFileSystem’; did you mean ‘getVirtualFileSystem’?
   74 |  Clang.setVirtualFileSystem(&*VFS);
      |        ^~~~~~~~~~~~~~~~~~~~
      |        getVirtualFileSystem
mv: cannot stat 'util/c++/.clang.o.tmp': No such file or directory
Comment 1 Erik Zeek 2019-09-27 12:37:03 UTC
Created attachment 591166 [details]
emerge --info '=dev-util/perf-5.1.15::gentoo'
Comment 2 Maciej S. Szmigiero 2019-10-11 14:02:26 UTC
+1

Probably broken by https://reviews.llvm.org/D59377
Comment 3 Maciej S. Szmigiero 2019-10-11 14:03:15 UTC
Created attachment 592478 [details, diff]
possible fix
Comment 4 Dennis Schridde 2019-10-26 08:36:51 UTC
Created attachment 594042 [details]
build.log

dev-util/perf-5.3.7 is also affected.
Comment 5 Dennis Schridde 2019-12-11 06:43:55 UTC
(In reply to Maciej S. Szmigiero from comment #3)
> Created attachment 592478 [details, diff] [details, diff]
> possible fix

Can you please send that patch upstream, with a preprocessor guard?
#if CLANG_VERSION_MAJOR < 9
 setVirtualFileSystem...
#else
 createFileManager...
#endif

It appears that they do not yet have a fix for this in Linux 5.5: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/c++/clang.cpp

Look at the logs for other recent contributors, if you need help getting your patch to the right people:
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/tools/perf/util/c++/clang.cpp
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/tools/perf
Comment 6 Dennis Schridde 2019-12-20 15:51:24 UTC
Created attachment 600214 [details, diff]
perf-5.3.7-compat-clang-9.patch (supporting all versions of sys-devel/clang supported by Gentoo)

(In reply to Dennis Schridde from comment #5)

Attached patch uses preprocessor guards to support all versions of sys-devel/clang currently supported by Gentoo.
Comment 7 Larry the Git Cow gentoo-dev 2019-12-27 02:56:08 UTC
The bug has been closed via the following commit(s):

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

commit f3dd9104e7803e30f988fc8c83c092998fa1560d
Author:     Naohiro Aota <naota@gentoo.org>
AuthorDate: 2019-12-25 21:47:13 +0000
Commit:     Naohiro Aota <naota@gentoo.org>
CommitDate: 2019-12-27 02:46:13 +0000

    version bump with some fixes
    
    This commit add a multiple python version support to address python3
    installtion issue. (based on a patch from Holger Hoffstätte
    <holger@applied-asynchrony.com>)
    
    Also, this commit add a patch to build with >=sys-devel/clang-9. (patch
    from Maciej S. Szmigiero <mail@maciej.szmigiero.name> and Dennis
    Schridde <devurandom@gmx.net>).
    
    Closes: https://bugs.gentoo.org/679762
    Closes: https://bugs.gentoo.org/695726
    Signed-off-by: Naohiro Aota <naota@gentoo.org>

 dev-util/perf/Manifest                          |   2 +
 dev-util/perf/files/perf-5.4.6-fix-clang9.patch |  17 ++
 dev-util/perf/perf-5.4.6.ebuild                 | 246 ++++++++++++++++++++++++
 3 files changed, 265 insertions(+)
Comment 8 Maciej S. Szmigiero 2019-12-27 12:33:29 UTC
(In reply to Dennis Schridde from comment #5)
> (In reply to Maciej S. Szmigiero from comment #3)
> > Created attachment 592478 [details, diff] [details, diff] [details, diff]
> > possible fix
> 
> Can you please send that patch upstream, with a preprocessor guard?

Will try to send this upstream this weekend.
Comment 9 Dennis Schridde 2019-12-27 18:12:34 UTC
(In reply to Maciej S. Szmigiero from comment #8)
> (In reply to Dennis Schridde from comment #5)
> > (In reply to Maciej S. Szmigiero from comment #3)
> > > Created attachment 592478 [details, diff] [details, diff] [details, diff] [details, diff]
> > > possible fix
> > 
> > Can you please send that patch upstream, with a preprocessor guard?
> 
> Will try to send this upstream this weekend.

comment #6 with attachment #600214 [details, diff] contains such patch.  Feel free to send it.  You may add my `Reviewed-by: Dennis Schridde <devurandom@gmx.net>` [1], since I can confirm that it works [2].

[1]: https://git.wiki.kernel.org/index.php/CommitMessageConventions
[2]: https://github.com/devurandom/gentoo-patches/commit/fa18695a08cb5460172f86c9bb6698242dafa8ee
Comment 10 Maciej S. Szmigiero 2019-12-28 17:15:56 UTC
Patch sent upstream.