[LLVMdev] Can't get llvmg++ to work

Reid Spencer reid at x10sys.com
Thu Aug 19 08:45:23 PDT 2004


On Wed, 2004-08-18 at 22:14, Jeff Cohen wrote:
> I'm another new person to LLVM.

Hi Jeff. Welcome.

> I can't successfully compile and
> execute a simple C++ program.  The compiler seems to work, as it
> produces a.out and a.out.bc files, but I get a whole bunch of warnings:
> 
> WARNING: Found global types that are not compatible:
>          "struct.std::messages<wchar_t>"* %_ZN9__gnu_cxx10messages_cE
>            [16 x sbyte]* %_ZN9__gnu_cxx10messages_cE
... clip ... 

These are "normal" warnings. Essentially there are things getting linked
together by gcc that are not the same type. gcc won't tell you about
this (it can't) but we do. There's not much that can be done about this
except to change fundamental things in various libraries which we
consider "ill advised".  Anyway, you can ignore the "global types that
are not compatible" messages from llvm-gcc as they are generally
harmless.

> and many many more like this.  Then when I try to run a.out:
> 
> Could not resolve external global address: stdout
> Abort (core dumped)

This sounds like runtime library problems.

> 
> I'm running FreeBSD 5.2.1 with gcc 3.3.3.  I had some problem starting
> the build as I had to get linux binary emulation to work.  (The problem
> here is that FreeBSD can be made compatible with 5 different distros,
> and not all of them work with LLVM.  I used linux_base-8; linux_base-6
> did not work.)  I did have some build errors, which look like they may
> be relevant:
> 
> gmake[3]: Entering directory `/usr/home/llvm/obj/runtime/GCCLibraries/crtend'
> Compiling crtend.c to bytecode
> Compiling listend.ll to bytecode
> Linking comp_main.bc component...
> Compiling Exception.cpp to bytecode
> Linking comp_genericeh.bc component...
> Compiling SJLJ-Exception.cpp to bytecode
> In file included from /usr/home/llvm/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../../../include/c++/3.4-llvm/i686-pc-linux-gnu/bits/c++config.h:35,
>                  from /usr/home/llvm/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../../../include/c++/3.4-llvm/cstdlib:49,
>                  from /usr/home/llvm/obj/../runtime/GCCLibraries/crtend/SJLJ-Exception.cpp:16:
> /usr/home/llvm/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../../../include/c++/3.4-llvm/i686-pc-linux-gnu/bits/os_defines.h:39:22: features.h: No such file or directory
> In file included from /usr/include/sys/_types.h:33,
>                  from /usr/include/stdlib.h:42,
>                  from /usr/home/llvm/cfrontend/x86/llvm-gcc/bin/../lib/gcc/i686-pc-linux-gnu/3.4-llvm/../../../../include/c++/3.4-llvm/cstdlib:52,
>                  from /usr/home/llvm/obj/../runtime/GCCLibraries/crtend/SJLJ-Exception.cpp:16:
> /usr/include/machine/_types.h:88: error: declaration does not declare anything
> gmake[3]: *** [/usr/home/llvm/obj/runtime/GCCLibraries/crtend/BytecodeObj/SJLJ-Exception.bc] Error 1
> gmake[3]: Target `all' not remade because of errors.
> gmake[3]: Leaving directory `/usr/home/llvm/obj/runtime/GCCLibraries/crtend'
> gmake[2]: *** [crtend/.makeall] Error 2

Ah, yeah, that would do it. You have an error making the C Runtime
library. The C Runtime library contains the definition of "stdout" which
is what lli complained about above. You need to make sure that you can
completely build and install the runtime directory or stuff like this
will happen.  As for the specific error, I'm not sure as I haven't BSD'd
in a long while. Obviously you need to look at
/usr/include/machine/_types.h:88 and figure out if you can fix it
without breaking the rest of your system.  What gcc version are you
using?

Also, as a general note, make sure you follow precisely the steps for
building the c front end. If you discover any BSDisms that aren't
documented, we'd love to hear about them.

Thanks,

Reid.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040819/ff2f4a5d/attachment.sig>


More information about the llvm-dev mailing list