[Llvm-bgq-discuss] Errors when compiling LLVM with Clang for BG/P

Prentice Bisbal prentice.bisbal at rutgers.edu
Thu Mar 14 15:08:59 CDT 2013


dear LLVM_BGQ list,

I'm trying to build LLVM with Clang for BG/P. I downloaded the patches 
for the r157929-20120603 revision from 
http://trac.alcf.anl.gov/projects/llvm-bgq, downloaded the corresponding 
revisions of LLVM and Clang and applied the patches. I downloaded the 
latest version of compiler-rt, since non of the patches modified 
compiler-rt, I figured that I could use the latest version. I recognize 
this may be a wrong assumption. My make eventually fails. Can someone 
offer any assistance? My download/patch/make steps are shown below, 
along with the warning/errors I get during the build.

Questions/comments:

1. Do I need to download a specific version of compiler-rt to match the 
versions of LLVM and Clang?

2. Are there any flags I should set in my environment, or as part of the 
configure command? I've seen a couple web pages that say to set 
CXXFLAGS=-UPPC or CPPFLAGS=-UPPC. Since one page said CPPFLAGS, and the 
other said CXXFLAGS, I'm dubious.

3. I know Hal Finkel provided new patches on the mailing list on 
December 13th 
http://lists.alcf.anl.gov/pipermail/llvm-bgq-discuss/2012-December/000010.html) 
(but I can't get these patches to work. One of the patche files ends 
prematurely, so the patch process fails.

4 Since I'm compiling for a BG/P and the development is focused on the 
BG/Q, I figure these newer patches in (3) probably don't really affect 
me. Right or wrong?

Thanks for your help. Build process/make errors below.

cd /scratch/prentice/build/

mkdir llvm

cd !

# down load patches

wget 
http://trac.alcf.anl.gov/projects/llvm-bgq/raw-attachment/wiki/WikiStart/llvm_bgq_r157929-20120602.patch

wget 
http://trac.alcf.anl.gov/projects/llvm-bgq/raw-attachment/wiki/WikiStart/clang_bgq_r157921-20120603.patch

# checkout specific versions of llvm, clang, and compiler-rt from SVN:

svn -r 157929 co http://llvm.org/svn/llvm-project/llvm/trunk llvm

cd llvm/tools/

svn -r 157921 co http://llvm.org/svn/llvm-project/cfe/trunk clang

cd ../../llvm/projects

svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt

cd ../

# apply patches

patch -p1 < ../llvm_bgq_r157929-20120602.patch

cd tools/clang/

patch -p1 < ../../../clang_bgq_r157921-20120603.patch

# Configure and build

cd ../../

./configure \
--prefix=/usr/local/llvm_bgq-r157929 \
2>&1 | tee configure.log

make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2 EXTRA_OPTIONS=-mminimal-toc 
2>&1 | tee make.log

# This produces this warning:

llvm[2]: Compiling InlineSpiller.cpp for Release+Asserts build
/scratch/prentice/build/llvm/llvm/include/llvm/ADT/PointerIntPair.h: In 
member function ‘PointerTy* llvm::PointerI
ntPair<PointerTy, IntBits, IntType, PtrTraits>::getAddrOfPointer() [with 
PointerTy = void*, unsigned int IntBits =
1u, IntType = bool, PtrTraits = 
llvm::PointerUnionUIntTraits<llvm::VNInfo*, 
llvm::SmallVector<llvm::VNInfo*, 4u>*
 >]’:
/scratch/prentice/build/llvm/llvm/include/llvm/ADT/PointerUnion.h:157: 
instantiated from ‘PT1* llvm::PointerUnio
n<PT1, PT2>::getAddrOfPtr1() [with PT1 = llvm::VNInfo*, PT2 = 
llvm::SmallVector<llvm::VNInfo*, 4u>*]’
/scratch/prentice/build/llvm/llvm/include/llvm/ADT/TinyPtrVector.h:81: 
instantiated from ‘EltTy* llvm::TinyPtrVe
ctor<EltTy>::begin() [with EltTy = llvm::VNInfo*]’
InlineSpiller.cpp:382: instantiated from here
/scratch/prentice/build/llvm/llvm/include/llvm/ADT/PointerIntPair.h:102: 
warning: dereferencing type-punned pointe
r will break strict-aliasing rules

In file included from MCTargetDesc/X86BaseInfo.h:20,
from X86.h:18,
from X86AsmPrinter.h:17,
from X86AsmPrinter.cpp:15:
MCTargetDesc/X86MCTargetDesc.h:105:34: error: X86GenRegisterInfo.inc: No 
such file or directory
MCTargetDesc/X86MCTargetDesc.h:110:31: error: X86GenInstrInfo.inc: No 
such file or directory
MCTargetDesc/X86MCTargetDesc.h:113:35: error: X86GenSubtargetInfo.inc: 
No such file or directory
In file included from X86InstrInfo.h:18,
from X86TargetMachine.h:19,
from X86AsmPrinter.h:19,
from X86AsmPrinter.cpp:15:
X86RegisterInfo.h:20:34: error: X86GenRegisterInfo.inc: No such file or 
directory
In file included from X86TargetMachine.h:19,
from X86AsmPrinter.h:19,
from X86AsmPrinter.cpp:15:
X86InstrInfo.h:23:31: error: X86GenInstrInfo.inc: No such file or directory
In file included from X86ISelLowering.h:18,
from X86TargetMachine.h:20,
from X86AsmPrinter.h:19,
from X86AsmPrinter.cpp:15:
X86Subtarget.h:23:35: error: X86GenSubtargetInfo.inc: No such file or 
directory
MCTargetDesc/X86BaseInfo.h: In function ‘bool 
llvm::X86II::isX86_64ExtendedReg(unsigned int)’:
MCTargetDesc/X86BaseInfo.h:597: error: ‘R8’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:597: error: ‘R9’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:597: error: ‘R10’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:597: error: ‘R11’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:598: error: ‘R12’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:598: error: ‘R13’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:598: error: ‘R14’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:598: error: ‘R15’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:599: error: ‘R8D’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:599: error: ‘R9D’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:599: error: ‘R10D’ is not a member of ‘llvm::X8
MCTargetDesc/X86BaseInfo.h:599: error: ‘R11D’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:600: error: ‘R12D’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:600: error: ‘R13D’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:600: error: ‘R14D’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:600: error: ‘R15D’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:601: error: ‘R8W’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:601: error: ‘R9W’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:601: error: ‘R10W’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:601: error: ‘R11W’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:602: error: ‘R12W’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:602: error: ‘R13W’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:602: error: ‘R14W’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:602: error: ‘R15W’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:603: error: ‘R8B’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:603: error: ‘R9B’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:603: error: ‘R10B’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:603: error: ‘R11B’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:604: error: ‘R12B’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:604: error: ‘R13B’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:604: error: ‘R14B’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:604: error: ‘R15B’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:605: error: ‘XMM8’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:605: error: ‘XMM9’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:605: error: ‘XMM10’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:605: error: ‘XMM11’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:606: error: ‘XMM12’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:606: error: ‘XMM13’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:606: error: ‘XMM14’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:606: error: ‘XMM15’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:607: error: ‘YMM8’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:607: error: ‘YMM9’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:607: error: ‘YMM10’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:607: error: ‘YMM11’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:608: error: ‘YMM12’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:608: error: ‘YMM13’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:608: error: ‘YMM14’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:608: error: ‘YMM15’ is not a member of 
‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:609: error: ‘CR8’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:609: error: ‘CR9’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:609: error: ‘CR10’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:610: error: ‘CR12’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:610: error: ‘CR13’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:610: error: ‘CR14’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:610: error: ‘CR15’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h: In function ‘bool 
llvm::X86II::isX86_64NonExtLowByteReg(unsigned int)’:
MCTargetDesc/X86BaseInfo.h:617: error: ‘SPL’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:617: error: ‘BPL’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:618: error: ‘SIL’ is not a member of ‘llvm::X86’
MCTargetDesc/X86BaseInfo.h:618: error: ‘DIL’ is not a member of ‘llvm::X86’
X86RegisterInfo.h: At global scope:
X86RegisterInfo.h:27: error: expected class-name before ‘{’ token
X86RegisterInfo.h:27: warning: ‘class llvm::X86RegisterInfo’ has virtual 
functions but non-virtual destructor
X86InstrInfo.h:127: error: expected class-name before ‘{’ token
X86InstrInfo.h:127: warning: ‘class llvm::X86InstrInfo’ has virtual 
functions but non-virtual destructor
X86Subtarget.h:42: error: expected class-name before ‘{’ token
X86Subtarget.h:308: error: ‘RegClassVector’ has not been declared
X86TargetMachine.h:46: error: invalid covariant return type for ‘virtual 
const llvm::X86InstrInfo* llvm::X86Target
Machine::getInstrInfo() const’
/scratch/prentice/build/llvm/llvm/include/llvm/Target/TargetMachine.h:104: 
error: overriding ‘virtual const llvm
::TargetInstrInfo* llvm::TargetMachine::getInstrInfo() const’
X86TargetMachine.h:55: error: invalid covariant return type for ‘virtual 
const llvm::X86Subtarget* llvm::X86Target
Machine::getSubtargetImpl() const’
/scratch/prentice/build/llvm/llvm/include/llvm/Target/TargetMachine.h:62: error: 
overriding ‘virtual const llvm:
:TargetSubtargetInfo* llvm::TargetMachine::getSubtargetImpl() const’
X86TargetMachine.h:62: error: invalid covariant return type for ‘virtual 
const llvm::X86RegisterInfo* llvm::X86Tar
getMachine::getRegisterInfo() const’
/scratch/prentice/build/llvm/llvm/include/llvm/Target/TargetMachine.h:125: 
error: overriding ‘virtual const llvm
::TargetRegisterInfo* llvm::TargetMachine::getRegisterInfo() const’
X86AsmPrinter.cpp: In member function ‘void 
llvm::X86AsmPrinter::printLeaMemReference(const llvm::MachineInstr*, u
nsigned int, llvm::raw_ostream&, const char*)’:
X86AsmPrinter.cpp:317: error: ‘RIP’ is not a member of ‘llvm::X86’
X86AsmPrinter.cpp:337: error: ‘ESP’ is not a member of ‘llvm::X86’
/scratch/prentice/build/llvm/llvm/include/llvm/Target/TargetMachine.h: 
In member function ‘const STC& llvm::Target
Machine::getSubtarget() const [with STC = llvm::X86Subtarget]’:
X86AsmPrinter.h:34: instantiated from here
/scratch/prentice/build/llvm/llvm/include/llvm/Target/TargetMachine.h:118: 
error: invalid static_cast from type ‘c
onst llvm::TargetSubtargetInfo*’ to type ‘const llvm::X86Subtarget*’
make[3]: *** 
[/scratch/prentice/build/llvm/llvm/lib/Target/X86/Release+Asserts/X86AsmPrinter.o] 
Error 1
make[3]: Leaving directory 
`/scratch/prentice/build/llvm/llvm/lib/Target/X86'
make[2]: *** [X86/.makeall] Error 2
make[2]: Leaving directory `/scratch/prentice/build/llvm/llvm/lib/Target'
make[1]: *** [Target/.makeall] Error 2
make[1]: Leaving directory `/scratch/prentice/build/llvm/llvm/lib'
make: *** [all] Error 1

-- 
Prentice



More information about the llvm-bgq-discuss mailing list