LLVM CygWin build error ?

For some reason, maybe something I have missed, but the llvm/bin files do not have any extension, ie a ‘.exe’ extension. Otherwise they are normal cygwin binaries.

I used the following commands :-

/usr/src/llvm/configure --prefix=/usr/llvm
make
make install

Aaron

I'm not sure what the specific problem is, but please make sure you follow the instructions in this document:
http://llvm.cs.uiuc.edu/docs/CFEBuildInstrs.html

Building the C frontend is not as easy as it should be right now, so it is very important to follow the instructions.

-Chris

For some reason, maybe something I have missed, but the llvm/bin files do not have any extension, ie a '.exe' extension.
Otherwise they are normal cygwin binaries.

mklib generates .exe extensions but make install removes them, which presumably is the correct behaviour, to allow Cygwin to all them but not Windows.

I'm not sure what the specific problem is, but please make sure you follow the instructions in this document:
http://llvm.cs.uiuc.edu/docs/CFEBuildInstrs.html

Building the C frontend is not as easy as it should be right now, so it is very important to follow the instructions.

I have followed the instructions through as best as I can but get no joy. I would be willing to devote more time to testing the build process in the future.

Where are the precompiled binaries for llvm-gcc ? Could I please have a copy :slight_smile:

Aaron

You can get them from the 1.4 release download page:

http://llvm.cs.uiuc.edu/releases/

Click on the "download" link next to the 1.4 release.

Reid

Cheers,
Aaron

Sorry but I cannot seem to find the precompiled gcc frontend executive in either the 1.4 or 1.3 releases.

Aaron

Aaron,

After the registration page (you only have to do it once), you will see
the releases page. Under "Download LLVM 1.4" there are several links
that start with "GCC Front End Binaries for". Binaries are provided for
Linux/x86, Solaris/Sparc, and MacOS X/PowerPC.

Reid

Thu, 2005-02-24 at 13:58, Aaron Gray wrote:

There do not seem to be any binaries for CygWin only Linux and the Mac :frowning:

I tried building the frontend on CygWin but ended up with a makeinfo error then a build error that I could not do anything about.

I will have to get my Linux Laptop from home and use that.

Many thanks,

Aaron

Linking lli debug executable (without symbols)
/mounts/zion/disks/0/localhome/pmeredit/llvm/lib/Debug/lli-interpreter.o(.te
xt+0x643a): In function
`llvm::Interpreter::callExternalFunction(llvm::Function*,
std::vector<llvm::GenericValue, std::allocator<llvm::GenericValue> >
const&)':
/localhome/pmeredit/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.c
pp:98: undefined reference to `llvm::WriteBytecodeToFile(llvm::Module
const*, std::basic_ostream<char, std::char_traits<char> >&)'
collect2: ld returned 1 exit status
make: *** [/mounts/zion/disks/0/localhome/pmeredit/llvm/tools/Debug/lli]
Error 1

So, it's not linking in Writer.o, which is understandable since lli, as is,
has no use for Writer.o. My question is where in this system of Makefiles
are the object files to be linked into lli specified? I've looked through
all the Makefiles and I can't find anything :frowning:

Yeah, cygwin is a bit of a beast. There's no pre-compiled binary
available (I'm working on it). If you want to build yourself, follow
the instructions in the CFEBuildInstr.html document carefully,
especially noting the Cygwin specific stuff. For example, you can't use
the default gcc that comes with Cygwin. I've been successful with GCC
3.4.3 on Cygwin.

I've uploaded a zipped tar file my Cygwin CFE "install" directory. You
can get it here: http://illuvium.com/download/
Use at your own risk (i.e. it works for me, but your mileage may vary).

Reid.

Hi Patrick,

You need to modify your makefile for building your version of lli so
that it includes the LLVMBCWriter.o library. You can do this with a line
like:

LLVM_LIBS=LLVMBCWriter

if you're using the LLVM Makefile system. Otherwise you just need to
make sure that {Debug,Release}/lib/LLVMBCWriter.o gets added to the link
line.

Reid.

Where do I add that line? Just putting it in the vanilla Makefile in
tools/lli doesn't work.

I forgot that lli was "special". It uses the "JIT" keywoard which means
"figure out the right libraries to use for a JIT compiler and runtime".

So, just add this, to tools/lli/Makefile:

USEDLIBS := LLVMBCWriter

That worked for me.

Reid.

Yikes, my tree must be more outdated than I thought. My library is still
called bcwriter. Unfortunately when I add that line I get even more errors,
seems like the only solution is going to be updating everything :wink:

Where do I add that line? Just putting it in the vanilla Makefile in
tools/lli doesn't work.

It should be

USEDLIBS = LLVMBCWriter

In the lli Makefile. See the llc Makefile as an example.

-Tanya

Thanks Tanya and Reid. I finally got it working (and my tree is really is
very outdated). It looks like when you specify USEDLIBS = it then overrides
whatever it would normally call and only uses these (rather than a union of
the default and USEDLIBS, like I had expected). So I had to specify every
library that lli uses (and I probably specified some that it doesn't).
Important thing is that it works though :slight_smile:

Yeah, cygwin is a bit of a beast. There's no pre-compiled binary
available (I'm working on it). If you want to build yourself, follow
the instructions in the CFEBuildInstr.html document carefully,
especially noting the Cygwin specific stuff. For example, you can't use
the default gcc that comes with Cygwin. I've been successful with GCC
3.4.3 on Cygwin.

I updated my CygWin GCC to 3.4.3 and binutils back to 2.15. Read CFEBuildInstr.html a couple of times. Tried building it, but got an error with makeinfo then a biuld error I could not do anything about.

I was able to build LLVM with no problem.

I've uploaded a zipped tar file my Cygwin CFE "install" directory. You
can get it here: http://illuvium.com/download/
Use at your own risk (i.e. it works for me, but your mileage may vary).

Great, thanks. It seems alot smaller than what I got when compiling from the CVS. There's no stdlib++v3 or libiberty, or texi documentation, in your version.

Maybe I should be building llvm-gcc from the downloadable release rather than from the CVS !

Many thanks,

Aaron

Reid,

Great, thanks. It seems alot smaller than what I got when compiling from the CVS. There's no stdlib++v3 or libiberty, or texi documentation, in your version.

I would be greatful if you would tell me what flags did you use on configure.

Aaron

Hey,

I have written a pass and wishes to measure its performance overhead after running it over a program.I also wish to measure the size of code segment once the program is in native code.What are the easy ways in llvm to achieve this?Are there any tools available in llvm for the same ?What exactly is this llvm-prof ?

Thanks a lot ,

Tanu

Hey,

I have written a pass and wishes to measure its performance overhead after running it over a program.I also wish to measure the size of code segment once the program is in native code.What are the easy ways in llvm to achieve this?Are there any tools available in llvm for the same

I'm not sure specifically what you want, but you should just be able to compile the program with and without your pass (e.g. you could add it to gccas/ld and add an option to enable or disable it). Compile it both ways and compare the results?

?What exactly is this llvm-prof ?

llvm-prof is an interface to the a basic block, edge, and function profiler. llvm-prof is just a front-end that formats profile data for human consumption. If you look at the llvm/utils/profile.pl, you can play around with it.

-Chris