Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 655140 - sys-devel/llvm-5.0.2 invalid C++ code (detected by gcc-8.1.0)
Summary: sys-devel/llvm-5.0.2 invalid C++ code (detected by gcc-8.1.0)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-07 07:41 UTC by Helmut Jarausch
Modified: 2019-02-23 17:16 UTC (History)
3 users (show)

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


Attachments
build log xz-compressed (llvm-5.0.2.build.xz,187.17 KB, application/x-xz)
2018-05-07 07:41 UTC, Helmut Jarausch
Details
patches.tar.bz2 (patches.tar.bz2,11.64 KB, application/x-bzip)
2018-05-07 16:15 UTC, Michał Górny
Details
Patch to resolve issue for llvm:5 (gcc-8.patch,1.27 KB, patch)
2018-07-06 15:51 UTC, Ben Chaney
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2018-05-07 07:41:54 UTC
Created attachment 530300 [details]
build log  xz-compressed

gcc-8.1.0 is more rigorous about type checking.
It bails out with
/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h: 
In member function 'llvm::Expected<std::vector<char> > 
llvm::orc::remote::OrcRemoteTargetClient<ChannelT>::readMem(char*, llvm::JITTargetAddress, uint64_t)':
include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h:722:26: error: 
could not convert '((llvm::orc::remote::OrcRemoteTargetClient<ChannelT>*)this)->callB<llvm::orc::remote::OrcRemoteTargetRPCAPI::ReadMem>(Src, Size)' 
from 'Expected<vector<unsigned char,allocator<unsigned char>>>' 
to   'Expected<vector<char,allocator<char>>>'
     return callB<ReadMem>(Src, Size);
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-05-07 14:16:05 UTC
Did you happen to test 6.0.0?
Comment 2 Helmut Jarausch 2018-05-07 16:03:32 UTC
(In reply to Michał Górny from comment #1)
> Did you happen to test 6.0.0?

I have no such problems with version 6.0.0-r1,
but some packages depend on llvm:5

Thanks,
Helmut
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-05-07 16:06:03 UTC
Yeah, I was just wondering if it boils down to backporting something between the two versions.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-05-07 16:15:15 UTC
Created attachment 530358 [details]
patches.tar.bz2

Could you please try with the attached patches?  I don't have hardware to build gcc8 at the moment.
Comment 5 Helmut Jarausch 2018-05-07 16:58:13 UTC
(In reply to Michał Górny from comment #4)
> Created attachment 530358 [details]
> patches.tar.bz2
> 
> Could you please try with the attached patches?  I don't have hardware to
> build gcc8 at the moment.

Yes, thanks, it compiles fine under gcc-8.1.0
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-05-11 07:20:26 UTC
Sadly, that includes some API changes, so I don't think I can backport that.  I'm afraid I'll have to wait till someone writes a minimal patch for it.
Comment 7 Eugene Bright 2018-06-13 17:33:18 UTC
I'd look here.
https://bugzilla.redhat.com/show_bug.cgi?id=1540620
Comment 8 seirra blake 2018-07-04 15:58:22 UTC
in case it may be beneficial for others; see https://github.com/prototype99/prototype99 for an llvm ebuild containing the relevant patches that may be installed using layman. i was a little unsure on the versioning, so feel free to open an issue on it if it is incorrect.
Comment 9 Ben Chaney 2018-07-06 15:51:00 UTC
Created attachment 538578 [details, diff]
Patch to resolve issue for llvm:5

This patch taken from redhat's upstream lets llvm-5.0.2 build with gcc-8 on my machine
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-07-06 16:34:47 UTC
(In reply to Ben Chaney from comment #9)
> Created attachment 538578 [details, diff] [details, diff]
> Patch to resolve issue for llvm:5
> 
> This patch taken from redhat's upstream lets llvm-5.0.2 build with gcc-8 on
> my machine

Do I understand correctly that only this one patch is necessary?
Comment 11 Ben Chaney 2018-07-06 20:33:03 UTC
(In reply to Michał Górny from comment #10)
> (In reply to Ben Chaney from comment #9)
> > Created attachment 538578 [details, diff] [details, diff] [details, diff]
> > Patch to resolve issue for llvm:5
> > 
> > This patch taken from redhat's upstream lets llvm-5.0.2 build with gcc-8 on
> > my machine
> 
> Do I understand correctly that only this one patch is necessary?

That is correct.
Comment 12 Ben Chaney 2018-07-06 22:51:34 UTC
The patch also enabled llvm-4.0.1-r1 to compile without modification.
Comment 13 Larry the Git Cow gentoo-dev 2018-07-07 07:38:17 UTC
The bug has been closed via the following commit(s):

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

commit 2deb2d52d186165bf0d2d45405438e91f6a9a6de
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2018-07-07 07:27:18 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2018-07-07 07:38:10 +0000

    sys-devel/llvm: Patch gcc-8 compatibility in <6
    
    Thanks to Ben Chaney for providing the patch.
    
    Closes: https://bugs.gentoo.org/655140

 ...turn-type-in-ORC-readMem-client-interface.patch | 31 ++++++++++++++++++++++
 sys-devel/llvm/llvm-4.0.1-r1.ebuild                |  3 +++
 sys-devel/llvm/llvm-5.0.2.ebuild                   |  3 +++
 3 files changed, 37 insertions(+)