Clang 3.9.1 fails to build LLVM 11.0.0

Hi folks. It’s my first time in this mailing list, and definitely not
the last :slight_smile:

Recently, I’ve been into bootstrapping compilers. I’ve encountered
several issues, and will start with this one.

The doc claims that Clang >= 3.5 is required to build LLVM 11.0.0 [1].
So I built LLVM+Clang 3.9.1, then tried to build LLVM 11.0.0. Doing so,
I faced this error:

no matching constructor for initialization of
'llvm::ValueEnumerator::MDRange'

(full log here [2])

Don’t worry, I’ve done my job. For a minimal reproducible example, here
[3] is a script that you should execute on a new Debian 10 system, most
likely a VM.

[1]
https://releases.llvm.org/11.0.0/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library
[2]
https://gist.github.com/concatime/6b5b9bcbc91a74b2913234180a29c159#file-log-txt
[3]
https://gist.github.com/concatime/6b5b9bcbc91a74b2913234180a29c159#file-build-sh

Issam E.

PS: a feedback too about how I report bugs would be awesome!

Not sure we would call that a bug. Looks more like a minor documentation change to a more recent clang version. I wonder which version that is.

Neil Nelson

When we upped our ‘required compiler’ version we were VERY explicit about making sure we set our support matrix accordingly. All of those host compiler versions came after nearly a year of extended debates.

I WOULD expect it to compile with everything from 3.5 and newer, though I don’t know what buildbots we have in place to ensure that is the case.

I do note that this is a bit of a strange bug that I haven’t been able to minimally-reproduce on Godbolt. Presumably this https://godbolt.org/z/xd1f4E is a pretty close minimization of this, and it doesn’t reproduce. For some reason (despite the line-numbers matching what is in the LLVM 11.0 release), it doesn’t seem to be considering line 100 of ValueEnumerator.h, the defaulted default constructor.

Issam: Can you confirm that your copy of ValueEnumerator.h (/root/llvm-project-llvmorg-11.0.0/llvm/lib/Bitcode/Writer/ValueEnumerator.h) line 100 is MDRange() = default;

?

As for bugs, you can go to bugs.llvm.org to report defects, though the signup has a manual process required by one of the admins due to spam.

Issam: Can you confirm that your copy of ValueEnumerator.h
(/root/llvm-project-llvmorg-11.0.0/llvm/lib/Bitcode/Writer/ValueEnumerator.h)
line 100 is MDRange() = default; ?

I confirm. Here is the preprocessed compilation unit:
https://godbolt.org/z/fhTTWh

As for bugs, you can go to bugs.llvm.org to report defects, though the signup
has a manual process required by one of the admins due to spam.

Ok, I will email bugs-admin@lists.llvm.org to signup.

I manually reduced it by ~1/2: https://godbolt.org/z/TE91ad

Presumably The oddness is that the SmallDenseMap in ValueEnumerator AND the AlignedCharArrayUnion in SmallDenseMap are both necessary. To reproduce, but I can't imagine why that would be .

I also found out that this issue happens in 10.0.1 and 10.0.0, but not
in 9.0.1. I added these versions in my build script. Ideally, this issue
would be patched for 11.0.1. Still wondering how this was not detected
before..