I'm another new person to LLVM. 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 WARNING: Found global types that are not compatible: "struct.std::messages<wchar_t>"* %_ZN9__gnu_cxx10messages_wE [16 x sbyte]* %_ZN9__gnu_cxx10messages_wE WARNING: Found global types that are not compatible: "struct.std::numpunct<char>"* %_ZN9__gnu_cxx10numpunct_cE [12 x sbyte]* %_ZN9__gnu_cxx10numpunct_cE WARNING: Found global types that are not compatible: "struct.std::numpunct<wchar_t>"* %_ZN9__gnu_cxx10numpunct_wE [12 x sbyte]* %_ZN9__gnu_cxx10numpunct_wE WARNING: Found global types that are not compatible: "struct.std::__codecvt_abstract_base<wchar_t,char,__mbstate_t>"* %_ZN9__gnu_cxx10time_get_cE [8 x sbyte]* %_ZN9__gnu_cxx10time_get_cE WARNING: Found global types that are not compatible: "struct.std::__codecvt_abstract_base<wchar_t,char,__mbstate_t>"* %_ZN9__gnu_cxx10time_get_wE [8 x sbyte]* %_ZN9__gnu_cxx10time_get_wE WARNING: Found global types that are not compatible: "struct.std::__codecvt_abstract_base<wchar_t,char,__mbstate_t>"* %_ZN9__gnu_cxx10time_put_cE [8 x sbyte]* %_ZN9__gnu_cxx10time_put_cE WARNING: Found global types that are not compatible: "struct.std::__codecvt_abstract_base<wchar_t,char,__mbstate_t>"* %_ZN9__gnu_cxx10time_put_wE [8 x sbyte]* %_ZN9__gnu_cxx10time_put_wE and many many more like this. Then when I try to run a.out: Could not resolve external global address: stdout Abort (core dumped) 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
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 2Ah, 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>
On Thu, 19 Aug 2004 08:45:23 -0700 Reid Spencer <reid at x10sys.com> wrote:> > 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.I didn't build cfontend; I used the prebuilt linux binaries. That could be part of the problem. Here's the line in error in _types.h: typedef __int32_t __register_t; typedef __int32_t __segsz_t; /* segment size (in pages) */>> typedef __uint32_t __size_t; /* sizeof() */typedef __int32_t __ssize_t; /* byte count or error */ typedef __int32_t __time_t; /* time()... */ Seems perfectly reasonable. The other error was a missing file features.h. I am indeed missing this file; it's probably linux specific. It seems my best bet is to try and build the front end myself. I'm using gcc 3.3.3.
On Wed, 18 Aug 2004, Jeff Cohen wrote:> I'm another new person to LLVM. 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_cENote that, for the record, LLVM is perfectly correct to spew these warnings. These are due to funny games that libstdc++ is playing to make sure that 'std::cout' and friends are initialized before they are used. Despite it being correct, it's not useful at all. Because of that, I applied this patch: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040816/017351.html ... which should silence these warnings. For your other problems, I would recommend (like others) that you rebuild your CFE. Please let us know if you have any other problems! -Chris -- http://llvm.org/ http://nondot.org/sabre/
On Thu, 19 Aug 2004 08:45:23 -0700 Reid Spencer <reid at x10sys.com> wrote:> > 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. >OK. I've built the front end without any heartaches, but I did encountered the following glitches: The documentation of --with-llvmgccdir is a bit ambiguous. I had to try several paths before I got the right one. It should state that the directory is <path>/cfrontend/<platform>/llvm-gcc. I figured it was a good idea to throw away any part of the runtime that did compile successfully, so I "cd runtime" and did a "gmake clean". This apparently deleted too many files, as I then got: gmake[3]: *** No rule to make target `/usr/home/llvm/obj/runtime/GCCLibraries/crtend/BytecodeObj/crtend.bc', needed by `/usr/home/llvm/obj/runtime/GCCLibraries/crtend/BytecodeObj/comp_main.bc'. Stop. Rerunning configure cured the problem. But that touched something that triggers a lot of recompilation. Alas the machine I'm using is underpowered and it'll be a while before it's finished. In the hardware requirements you might want to add 128MB as the minimum for x86 systems. Please don't ask how I know that :-) I can create a tarbell of the FreeBSD binaries and upload it to you if you like (once I confirm everything is working properly). Jeff