Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 708320 - =dev-lang/rust-1.41.0 fails to build on gcc-10: error: use of enum 'Qualifiers' without previous declaration
Summary: =dev-lang/rust-1.41.0 fails to build on gcc-10: error: use of enum 'Qualifier...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Georgy Yakovlev
URL: https://github.com/llvm/llvm-project/...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2020-02-05 07:41 UTC by Sergei Trofimovich (RETIRED)
Modified: 2020-06-14 19:06 UTC (History)
1 user (show)

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


Attachments
dev-lang:rust-1.41.0:20200205-073029.log.xz (dev-lang:rust-1.41.0:20200205-073029.log.xz,500.17 KB, application/x-xz)
2020-02-05 07:43 UTC, Sergei Trofimovich (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich (RETIRED) gentoo-dev 2020-02-05 07:41:56 UTC
The build failure looks like:

"""
[  0%] Building CXX object lib/Demangle/CMakeFiles/LLVMDemangle.dir/MicrosoftDemangle.cpp.o
In file included from /tmp/portage/dev-lang/rust-1.41.0/work/rustc-1.41.0-src/src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangle.h:13,
                 from /tmp/portage/dev-lang/rust-1.41.0/work/rustc-1.41.0-src/src/llvm-project/llvm/lib/Demangle/MicrosoftDemangle.cpp:16:
/tmp/portage/dev-lang/rust-1.41.0/work/rustc-1.41.0-src/src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h:33:6: error: use of enum 'Qualifiers' without previous declaration
   33 | enum Qualifiers : uint8_t {
      |      ^~~~~~~~~~
/tmp/portage/dev-lang/rust-1.41.0/work/rustc-1.41.0-src/src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h:33:17: error: expected unqualified-id before ':' token
   33 | enum Qualifiers : uint8_t {
      |                 ^
"""

The fix is already upstream: https://github.com/llvm/llvm-project/commit/b288d90b39f4b905c02092a9bfcfd6d78f99b191.patch and is very simple:

--- a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
+++ b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
@@ -16,6 +16,8 @@
 #include "llvm/Demangle/DemangleConfig.h"
 #include "llvm/Demangle/StringView.h"
 #include <array>
+#include <cstdint>
+#include <string>
 
 namespace llvm {
 namespace itanium_demangle {
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2020-02-05 07:43:33 UTC
Created attachment 611764 [details]
dev-lang:rust-1.41.0:20200205-073029.log.xz
Comment 2 Georgy Yakovlev archtester gentoo-dev 2020-02-05 09:00:32 UTC
thanks for the pointer to the patch =)

I don't have gcc10 chroots/systems yet, and this is only relevant for users not using system-llvm, tested on gcc-9, all fine.

I'll commit the patch to 1.41 for now, but likely other versions are affected as well, because they bundle llvm-9 (with some cherry picks)

probably they should cherry pick this as well, not sure when rebase on 10 gonna happen.
Comment 3 Larry the Git Cow gentoo-dev 2020-02-05 09:01:07 UTC
The bug has been referenced in the following commit(s):

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

commit aab36ad45d07887af2a9e110f57762f7c3bbdcbb
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2020-02-05 08:50:31 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2020-02-05 09:00:51 +0000

    dev-lang/rust: fix build of bundled llvm with gcc10
    
    Bug: https://bugs.gentoo.org/708320
    Package-Manager: Portage-2.3.87, Repoman-2.3.20
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-lang/rust/files/llvm-gcc10.patch | 34 ++++++++++++++++++++++++++++++++++
 dev-lang/rust/rust-1.41.0.ebuild     |  1 +
 2 files changed, 35 insertions(+)
Comment 4 Georgy Yakovlev archtester gentoo-dev 2020-02-05 09:08:36 UTC
they already have it in their nightly/current rust submodule

https://github.com/rust-lang/llvm-project/commit/98b1752888c0282bf5504b67484b92d8d069f1b8

so all good from upstream side.
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2020-03-02 23:17:49 UTC
The patch seems to be present in =dev-lang/rust-1.41.1
Comment 6 Georgy Yakovlev archtester gentoo-dev 2020-03-03 04:08:06 UTC
can't see it in 1.41.1
we still patch the source and it applies.

here's the changeset
https://github.com/rust-lang/rust/compare/1.41.0...1.41.1

llvm-submodule changeset does not include this patch
Comment 7 Georgy Yakovlev archtester gentoo-dev 2020-03-03 04:12:42 UTC
as for this bug, I'll close it as affected versions are gone.
we need to stabilize 1.41.1 first and clean up everything below second.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2020-03-03 08:12:24 UTC
Oh, I see. I've missed #comment3. My apologies for the confusion.
Comment 9 Georgy Yakovlev archtester gentoo-dev 2020-03-24 17:17:17 UTC
no problem.

with 1.42.0 upstream included the patch.
I'll do a cleanup of everything below 1.41.1 in a week or two.
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2020-06-14 11:14:38 UTC
Probably fixed. I haven't seen build failures recently.
Comment 11 Georgy Yakovlev archtester gentoo-dev 2020-06-14 19:06:11 UTC
yeah, closing. old versions are gone, new versions have fix. thanks for reminder.