Could anyone please help me look at this problem ???
I will pay 10 bucks(PayPal only), really.
Strange ! Please help me! I’m getting crasy
Build Command:
cmake -DLLVM_TARGETS_TO_BUILD=LoongArch -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Debug -G "Ninja" ../llvm
ninja -j1
Environment:
LLVM-project-llvmorg-10.0.0
clang 10.0.0
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Debug Info:
Undefined reference to llvm::LoongArchTargetLowering::LoongArchCC::LoongArchCC(
I checked My code, it definitely well defined in LoongArchISelLowering.h and be included by LoongArchISelLowering.cpp as follow:
// LoongArchISelLowering.h
namespace llvm {
...
class LoongArchTargetLowering : public TargetLowering {
protected:
class LoongArchCC {
public:
...
LoongArchCC(CallingConv::ID CallConv, bool IsILP32S, CCState &Info,
SpecialCallingConvType SpecialCallingConv = NoSpecialCallingConv);
...
}
}
}
// LoongArchISelLowering.cpp
SDValue
LoongArchTargetLowering::LowerReturn(...) const {
...
LoongArchCC LoongArchCCInfo(CallConv, ABI.IsILP32S(), CCInfo); //this is line 109 where error occur
...
}
I also asked my teacher to check it and he said my doesn’t have any problem ,it’s just a simple class constructor call. I first thought that might because I build llvm by -j4 so the compiler could had started to linking library while something hadn’t be done. But when I delete all the Build files and build it with -j1 command, it still failed.
In case you want to see my full code: github Url