[LLVMdev] First Pass at building dragon egg-3.3 for clang 3.3 - using gcc-4.7

Duncan Sands baldrick at free.fr
Thu Jul 25 07:00:10 PDT 2013


Hi,

On 25/07/13 15:47, Lou Picciano wrote:
> Duncan,
> Many thanks for your comments.
>
> The core issue we're running into is this:
>
>     $ GCC=/usr/bin/gcc LLVM_CONFIG=/usr/bin/llvm-config make
>     Compiling utils/TargetInfo.cpp
>     Linking TargetInfo
>     ld: fatal: library -lLLVMSupport: not found

llvm-config is supposed to say where the libraries are.  Take a look at the
output of
   usr/bin/llvm-config --ldflags

On my system it outputs
  -L/usr/local/lib   -lrt -ldl -lpthread -lz
and indeed libLLVMSupport is there
   $ ls /usr/local/lib/libLLVMSupport*
   /usr/local/lib/libLLVMSupport.a

>     ld: fatal: file processing errors. No output written to TargetInfo
>     collect2: error: ld returned 1 exit status
>
> All other gyrations are attempts to shoehorn LLVMSupport into the compile. I've
> been sourcing the Makefile and README for hints.
>
> To your point on declaring the location of gcc: Oddly, though gcc (4.7) is
> available to the environment, the Makefile does not find it without explicit
> direction:
>
>     dragonegg-3.3.src$ make
>     make: cc: Command not found

What O/S is this on?  Most linux O/S's auto-define the CC variable to point to
the system C compiler.  For example on my system
   $ echo $CC
   gcc
It looks like on your system CC is defined to be equal to cc but there is no
such compiler.  Sounds like a misconfigured system.

Best wishes, Duncan.

>
> Thanks in advance, Lou Picciano
>
> (and apologies for the top posting; crappy email client)
>
> On 25/07/13 04:38, Lou Picciano wrote:
>> LLVM Friends,
>>
>> First time attempting a build of dragonegg, using our shiny new install of
>> clang-3.3. I'm clearly off to a terrifying start!
>>
>>
>> dragonegg-3.3.src$ CXX=/usr/bin/gcc
> This says to compile using gcc
>    GCC=/usr/bin/gcc
> This says that the plugin will be used with /usr/bin/gcc when built.
>    ENABLE_LLVM_PLUGINS=1
>> LLVM_CONFIG=/usr/bin/llvm-config
>
> CFLAGS=-I/usr/clang/3.3/lib/clang/3.3/include
>> CXXFLAGS="-I/usr/clang/3.3/lib/clang/3.3/include"
> These say to use clang headers.  Not sure why you want to use clang headers when
> compiling using gcc.
>    make
>>
>> Compiling utils/TargetInfo.cpp
>> In file included from /usr/clang/3.3/include/llvm/Support/DataTypes.h:67:0,
>>                   from /usr/clang/3.3/include/llvm/Support/type_traits.h:20,
>>                   from /usr/clang/3.3/include/llvm/ADT/StringRef.h:13,
>>                   from /usr/clang/3.3/include/llvm/ADT/Twine.h:13,
>>                   from /usr/clang/3.3/include/llvm/ADT/Triple.h:13,
>>                   from
>> /home/drlou/Downloads/dragonegg-3.3.src/utils/TargetInfo.cpp:23:
>> /usr/clang/3.3/lib/clang/3.3/include/stdint.h:32:54: error: missing binary
>> operator before token "("
> This seems to be saying that gcc doesn't like the clang headers.  I suggest you
> don't use them.
> Anyway, not sure why you are trying to do this so complicated, doesn't this
> work:
>     make
> ?
> Other comments:
>     CXX is for providing a C++ compiler, so should be g++ not gcc
>      Since /usr/bin/gcc is in your path, probably you don't need CXX to force this
>      compiler (or did you put clang in front of it in your path?; if so it still
>      shouldn't be needed since clang can also compile dragonegg)
>     GCC=/usr/bin/gcc is probably not needed, since it is the default
> Ciao, Duncan.




More information about the llvm-dev mailing list