Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM 3.6 not compatible any more? #34103

Closed
MagaTailor opened this issue Jun 5, 2016 · 3 comments
Closed

LLVM 3.6 not compatible any more? #34103

MagaTailor opened this issue Jun 5, 2016 · 3 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.

Comments

@MagaTailor
Copy link

MagaTailor commented Jun 5, 2016

I stopped using local llvm 3.6 on ARM many months ago but needed to use it again today. It doesn't work:

compile: arm-unknown-linux-gnueabihf/rustllvm/PassWrapper.o
/rust-master/src/rustllvm/PassWrapper.cpp: In function ‘bool LLVMRustHasFeature(LLVMTargetMachineRef, const char*)’:
/rust-master/src/rustllvm/PassWrapper.cpp:149:45: error: ‘class llvm::TargetMachine’ has no member named ‘getMCSubtargetInfo’
     const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
                                             ^
/rust-master/src/rustllvm/PassWrapper.cpp:150:11: error: ‘FeatureBitset’ does not name a type
     const FeatureBitset &Bits = MCInfo->getFeatureBits();
           ^
/rust-master/src/rustllvm/PassWrapper.cpp:154:53: error: passing ‘const llvm::MCSubtargetInfo’ as ‘this’ argument of ‘bool llvm::MCSubtargetInfo::isCPUStringValid(llvm::StringRef)’ discards qualifiers [-fpermissive]
     if (MCInfo->isCPUStringValid(x##SubTypeKV[0].Key)) {    \
                                                     ^
/rust-master/src/rustllvm/PassWrapper.cpp:101:23: note: in expansion of macro ‘SUBTARGET’
 #define SUBTARGET_X86 SUBTARGET(X86)
                       ^
/rust-master/src/rustllvm/PassWrapper.cpp:131:9: note: in expansion of macro ‘SUBTARGET_X86’
         SUBTARGET_X86     \
         ^
/rust-master/src/rustllvm/PassWrapper.cpp:158:5: note: in expansion of macro ‘GEN_SUBTARGETS’
     GEN_SUBTARGETS {
     ^
/rust-master/src/rustllvm/PassWrapper.cpp:154:53: error: passing ‘const llvm::MCSubtargetInfo’ as ‘this’ argument of ‘bool llvm::MCSubtargetInfo::isCPUStringValid(llvm::StringRef)’ discards qualifiers [-fpermissive]
     if (MCInfo->isCPUStringValid(x##SubTypeKV[0].Key)) {    \
                                                     ^
/rust-master/src/rustllvm/PassWrapper.cpp:107:23: note: in expansion of macro ‘SUBTARGET’
 #define SUBTARGET_ARM SUBTARGET(ARM)
                       ^
/rust-master/src/rustllvm/PassWrapper.cpp:132:9: note: in expansion of macro ‘SUBTARGET_ARM’
         SUBTARGET_ARM     \
         ^
/rust-master/src/rustllvm/PassWrapper.cpp:158:5: note: in expansion of macro ‘GEN_SUBTARGETS’
     GEN_SUBTARGETS {
     ^
/rust-master/src/rustllvm/PassWrapper.cpp:154:53: error: passing ‘const llvm::MCSubtargetInfo’ as ‘this’ argument of ‘bool llvm::MCSubtargetInfo::isCPUStringValid(llvm::StringRef)’ discards qualifiers [-fpermissive]
     if (MCInfo->isCPUStringValid(x##SubTypeKV[0].Key)) {    \
                                                     ^
/rust-master/src/rustllvm/PassWrapper.cpp:113:27: note: in expansion of macro ‘SUBTARGET’
 #define SUBTARGET_AARCH64 SUBTARGET(AArch64)
                           ^
/rust-master/src/rustllvm/PassWrapper.cpp:133:9: note: in expansion of macro ‘SUBTARGET_AARCH64’
         SUBTARGET_AARCH64 \
         ^
/rust-master/src/rustllvm/PassWrapper.cpp:158:5: note: in expansion of macro ‘GEN_SUBTARGETS’
     GEN_SUBTARGETS {
     ^
/rust-master/src/rustllvm/PassWrapper.cpp:154:53: error: passing ‘const llvm::MCSubtargetInfo’ as ‘this’ argument of ‘bool llvm::MCSubtargetInfo::isCPUStringValid(llvm::StringRef)’ discards qualifiers [-fpermissive]
     if (MCInfo->isCPUStringValid(x##SubTypeKV[0].Key)) {    \
                                                     ^
/rust-master/src/rustllvm/PassWrapper.cpp:119:24: note: in expansion of macro ‘SUBTARGET’
/rust-master/src/rustllvm/PassWrapper.cpp:134:9: note: in expansion of macro ‘SUBTARGET_MIPS’
         SUBTARGET_MIPS    \
         ^
/rust-master/src/rustllvm/PassWrapper.cpp:158:5: note: in expansion of macro ‘GEN_SUBTARGETS’
     GEN_SUBTARGETS {
     ^
/rust-master/src/rustllvm/PassWrapper.cpp:154:53: error: passing ‘const llvm::MCSubtargetInfo’ as ‘this’ argument of ‘bool llvm::MCSubtargetInfo::isCPUStringValid(llvm::StringRef)’ discards qualifiers [-fpermissive]
     if (MCInfo->isCPUStringValid(x##SubTypeKV[0].Key)) {    \
                                                     ^
/rust-master/src/rustllvm/PassWrapper.cpp:125:23: note: in expansion of macro ‘SUBTARGET’
 #define SUBTARGET_PPC SUBTARGET(PPC)
                       ^
/rust-master/src/rustllvm/PassWrapper.cpp:135:9: note: in expansion of macro ‘SUBTARGET_PPC’
         SUBTARGET_PPC
         ^
/rust-master/src/rustllvm/PassWrapper.cpp:158:5: note: in expansion of macro ‘GEN_SUBTARGETS’
     GEN_SUBTARGETS {
     ^
/rust-master/src/rustllvm/PassWrapper.cpp:166:13: error: ‘Bits’ was not declared in this scope
     return (Bits & FeatureEntry->Value) == FeatureEntry->Value;
             ^
/rust-master/src/rustllvm/PassWrapper.cpp:167:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [arm-unknown-linux-gnueabihf/rustllvm/PassWrapper.o] Error 1

I remember some PR about feature detection that modified a few C++ files - looks like it might be related?

@nagisa
Copy link
Member

nagisa commented Jun 5, 2016

Yes, getMCSubtargetInfo is 3.7+. You should be using the same version as the LLVM we bundle (3.8) in order to reduce the incompatibilities.

@MagaTailor
Copy link
Author

3.6 hasn't been deprecated, that's my point.

@nagisa
Copy link
Member

nagisa commented Jun 5, 2016

I do not believe we ever provided any stability guarantees about list of external LLVM versions that may work with rustc.

@steveklabnik steveklabnik added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Jun 6, 2016
steveklabnik added a commit to steveklabnik/rust that referenced this issue Jun 7, 2016
Require LLVM 3.7

We are using getMCTargetInfo which is 3.7+. I’m not sure whether 3.7 works though.

Fixes rust-lang#34103

r? @alexcrichton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
Projects
None yet
Development

No branches or pull requests

3 participants