Skip to content

LLVM 3.6 not compatible any more? #34103

Closed
@MagaTailor

Description

@MagaTailor

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions