t-crest / patmos-llvm

Port of the LLVM compiler infrastructure to the time-predictable processor Patmos
Other
15 stars 8 forks source link

Doesn't compile on MacOs #27

Open Emoun opened 4 years ago

Emoun commented 4 years ago

Compilation fails on MacOs. When I run it, I get an error about various labels being undefined for x86_64:

Undefined symbols for architecture x86_64:
  "llvm::MachineInstr::addOperand(llvm::MachineFunction&, llvm::MachineOperand const&)", referenced from:
      (anonymous namespace)::PatmosSPMark::runOnMachineModule(llvm::Module const&) in PatmosSPMark.cpp.o
      llvm::PatmosSPReduce::applyPredicates(llvm::SPScope*, llvm::MachineFunction&) in PatmosSPReduce.cpp.o
      llvm::PatmosSPReduce::insertStackLocInitializations(llvm::SPScope*) in PatmosSPReduce.cpp.o
      llvm::PatmosSPReduce::insertDefToRegLoc(llvm::MachineBasicBlock&, unsigned int, unsigned int, llvm::SmallVectorImpl<llvm::MachineOperand> const&, bool, bool, bool) in PatmosSPReduce.cpp.o
      llvm::PatmosSPReduce::insertDefToS0SpillSlot(llvm::MachineBasicBlock&, unsigned int, unsigned int, unsigned int, llvm::SmallVectorImpl<llvm::MachineOperand> const&) in PatmosSPReduce.cpp.o
      llvm::PatmosSPReduce::insertDefToStackLoc(llvm::MachineBasicBlock&, unsigned int, unsigned int, llvm::SmallVectorImpl<llvm::MachineOperand> const&) in PatmosSPReduce.cpp.o
      llvm::PatmosSPReduce::insertUseSpillLoad(llvm::RAInfo const&, llvm::_PredicatedBlock<llvm::MachineBasicBlock, llvm::MachineInstr, llvm::MachineOperand>*) in PatmosSPReduce.cpp.o
      ...

This is not necessarily an issue with the code, as it also doesn't compile on bc4cc75be381dad64cae2f397ad21c72c164311a. Even going back to before I began committing, and patching it like bc4cc75be381dad64cae2f397ad21c72c164311a, it still doesn't compile. Therefore, this might have something to do with the age of the project, and could be solved by updating to a newer version of LLVM.

schoeberl commented 4 years ago

This issue is known, as I reported it long time ago. But I don't find the issue now. My LLVM on macOS is resent.

Emoun commented 4 years ago

Yes, I just wanted to have an open issue on it to be able to track it.

schoeberl commented 2 years ago

Related question (not this issue): there was a precompiled version for Mac available (with build.sh -q llvm2), but it gave some link errors:

<unknown>:0: error: symbol '.LBB305_1' can not be undefined in a subtraction expression
<unknown>:0: error: symbol '.LBB579_1' can not be undefined in a subtraction expression

Is there any progress in this direction? Would really love to see this working on macOS, as I'm currently trying to get lingua franca running again on Patmos here at UCB.

Emoun commented 2 years ago

@schoeberl I'm currently looking into getting the new toolchain updated for use with the build script. So, hopefully by next week I'm at a place where others can test.