[LLVMdev] darwin dragon-egg build issues

Jack Howarth howarth at bromo.med.uc.edu
Fri Apr 9 20:14:28 PDT 2010


On Fri, Apr 09, 2010 at 10:23:12PM -0400, Jack Howarth wrote:
>    Is anyone building dragon-egg on darwin? I am trying
> to build against the fink gcc45 package that I have prepared
> for darwin and a updated fink llvm 2.7 package that is built
> as...
> 
> ../llvm-2.7/configure --prefix=/sw --prefix=/sw/lib/llvm --mandir=/sw/share/man --infodir=/sw/share/info --with-gmp=/sw --with-libiconv-prefix=/usr --with-system-zlib --with-as=/Developer/usr/bin/as --with-ld=/Developer/usr/bin/ld --with-nm=/Developer/usr/bin/nm --enable-optimized --enable-assertions --enable-pic --enable-targets=host-only
> 
> Since the gcc45 package installs symlinks to the compilers
> in /sw/bin as gcc-4, g++-4, etc, I executed...
> 
> GCC=/sw/bin/gcc-4 LLVM_CONFIG=/sw/lib/llvm/bin/llvm-config make
> 
> This fails with...
> 
> g++ -c  -I/sw/lib/llvm/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -MD -MP -DIN_GCC -DREVISION=\"100909M\" -DTARGET_NAME=\"x86_64-apple-darwin10.3.0\" -I/Users/howarth/llvm_svn/dragonegg -Iplugin/include -Wall -Werror -I/sw/lib/llvm/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2  -fno-exceptions -fno-rtti -fno-common -Woverloaded-virtual /Users/howarth/llvm_svn/dragonegg/utils/target.cpp
> <command-line>: error: "__STDC_LIMIT_MACROS" redefined
> <command-line>: error: this is the location of the previous definition
> <command-line>: error: "__STDC_CONSTANT_MACROS" redefined
> <command-line>: error: this is the location of the previous definition
> make: *** [target.o] Error 1
> 
> with GCC apparently being insufficent to redirect the compilers. Instead, I had to use...
> 
> GCC=/sw/bin/gcc-4 CC=/sw/bin/gcc-4 CXX=/sw/bin/g++-4 LLVM_CONFIG=/sw/lib/llvm/bin/llvm-config make
> 
> This however fails with...
> 
> /sw/bin/gcc-4 -c  -I/sw/lib/llvm/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -MD -MP -DIN_GCC -DREVISION=\"100909M\" -DTARGET_NAME=\"x86_64-apple-darwin10.3.0\" -I/Users/howarth/llvm_svn/dragonegg -Iplugin/include -I/Users/howarth/llvm_svn/dragonegg/x86 -I/Users/howarth/llvm_svn/dragonegg/darwin -Wall -Werror -I/sw/lib/llvm/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2  -fno-common /Users/howarth/llvm_svn/dragonegg/llvm-cache.c
> In file included from /Users/howarth/llvm_svn/dragonegg/llvm-cache.c:28:0:
> /Users/howarth/llvm_svn/dragonegg/llvm-cache.h:31:20: fatal error: config.h: No such file or directory
> compilation terminated.
> make: *** [llvm-cache.o] Error 1
> 
> If I manually run /sw/lib/llvm/bin/llvm-config, I get...
> 
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --prefix
> /sw/lib/llvm
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --src-root
> /sw/src/fink.build/llvm-2.7-1/llvm-2.7
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --obj-root
> /sw/src/fink.build/llvm-2.7-1/llvm_objdir
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --bindir
> /sw/lib/llvm/bin
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --includedir
> /sw/lib/llvm/include
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --libdir 
> /sw/lib/llvm/lib
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --cppflags
> -I/sw/lib/llvm/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --cflags
> -I/sw/lib/llvm/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2  -fno-common
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --cxxflags
> -I/sw/lib/llvm/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2  -fno-exceptions -fno-rtti -fno-common -Woverloaded-virtual
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --ldflags
> -L/sw/lib/llvm/lib  -lpthread -lm 
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --libs
> -lLLVMLinker -lLLVMipo -lLLVMInterpreter -lLLVMInstrumentation -lLLVMJIT -lLLVMExecutionEngine -lLLVMBitWriter -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMMCParser -lLLVMX86AsmPrinter -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMX86Info -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAsmParser -lLLVMArchive -lLLVMBitReader -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport -lLLVMSystem
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --libnames 
> libLLVMLinker.a libLLVMipo.a libLLVMInterpreter.a libLLVMInstrumentation.a libLLVMJIT.a libLLVMExecutionEngine.a libLLVMBitWriter.a libLLVMX86Disassembler.a libLLVMX86AsmParser.a libLLVMMCParser.a libLLVMX86AsmPrinter.a libLLVMX86CodeGen.a libLLVMSelectionDAG.a libLLVMX86Info.a libLLVMAsmPrinter.a libLLVMCodeGen.a libLLVMScalarOpts.a libLLVMInstCombine.a libLLVMTransformUtils.a libLLVMipa.a libLLVMAsmParser.a libLLVMArchive.a libLLVMBitReader.a libLLVMAnalysis.a libLLVMTarget.a libLLVMMC.a libLLVMCore.a libLLVMSupport.a libLLVMSystem.a
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --components
> all analysis archive asmparser asmprinter backend bitreader bitwriter codegen core engine executionengine instcombine instrumentation interpreter ipa ipo jit linker mc mcparser native nativecodegen scalaropts selectiondag support system target transformutils x86 x86asmparser x86asmprinter x86codegen x86disassembler x86info
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --targets-built
> x86
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --host-target
> x86_64-apple-darwin10.3.0
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --build-mode
> Release
> 
> Out of those, actually the --src-root and --obj-root mess up and
> output...
> 
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --obj-root
> /sw/src/fink.build/llvm-2.7-1/llvm_objdirbash-3.2$ 
> 
> and
> 
> bash-3.2$ /sw/lib/llvm/bin/llvm-config --src-root
> /sw/src/fink.build/llvm-2.7-1/llvm-2.7bash-3.2$ 
> 
> with a missing newline after the output. It seems that
> dragonegg gets confused by the fact that llvm actually
> installs the headers in...
> 
> /sw/lib/llvm/include/llvm 
> 
> and
> 
> /sw/lib/llvm/include/llvm-c
> 
> rather than directly into /sw/lib/llvm/include.
>                                       Jack
> 

If I compare how my llvm-gcc42 package builds against
the llvm package files, I find...

g++ -c -g -O2 -mdynamic-no-pic -DIN_GCC -W -Wall -Wwrite-strings -pedantic -Wno-long-long -Wno-variadic-macros -Wmissing-format-attribute -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"x86_64-apple-darwin10.3.0\" -frandom-seed=0 -DNDEBUG -I. -I. -I../../llvm-gcc4.2-2.7.source/gcc -I../../llvm-gcc4.2-2.7.source/gcc/. -I../../llvm-gcc4.2-2.7.source/gcc/../include -I../../llvm-gcc4.2-2.7.source/gcc/../libcpp/include -I/sw/include  -I../../llvm-gcc4.2-2.7.source/gcc/../libdecnumber -I../libdecnumber -I/sw/lib/llvm/include -I/sw/include -DENABLE_LLVM -I/sw/lib/llvm/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS   -I. -I. -I../../llvm-gcc4.2-2.7.source/gcc -I../../llvm-gcc4.2-2.7.source/gcc/. -I../../llvm-gcc4.2-2.7.source/gcc/../include -I../../llvm-gcc4.2-2.7.source/gcc/../libcpp/include -I/sw/include  -I../../llvm-gcc4.2-2.7.source/gcc/../libdecnumber -I../libdecnumber -I/sw/lib/llvm/include ../../llvm-gcc4.2-2.7.source/gcc/llvm-main.cpp -o llvm-main.o

where in ../../llvm-gcc4.2-2.7.source/gcc/llvm-main.cpp, we have...

#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/PrettyStackTrace.h"

Shouldn't dragonegg be doing the same...providing
explicit paths from what 'llvm-config --includedir'
returns? Where exactly are some of these headers supposed
to be coming from in llvm-cache.h?

#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "target.h"
#include "tree.h"

Shouldn't some of these have explicit paths like...

#include "llvm/Config/config.h"

or

#include "llvm/Target/target.h"

as is the case in llvm-gcc4.2?
               Jack




> 
> 
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list