On Jan 7, 2007, at 6:24 PM, Reid Spencer wrote: > I wish I could retract email. > > The patch I just sent didn't have differences for sub-directories in > it. > Please don't apply it. Instead use this one which should bring you > up to > date with Apple's changes. Again, this applies to r240 of the llvm-gcc > SVN mirror. > > Some things to note. If your target is not x86, x86-64, or ppc and > your > operating system is not darwin or linux, this probably won't work. > You'll get a link error like this: > > ../../src-1/gcc/llvm-convert.cpp:3118: undefined reference to > `TreeToLLVM::TargetIntrinsicLower(unsigned int, llvm::Value*, > llvm::Value*&, llvm::Type const*, std::vector<llvm::Value*, > std::allocator<llvm::Value*> >&, llvm::SmallVector<tree_node*, 8u>&, > llvm::BasicBlock*, bool, bool)' > > That's because the makefiles aren't quite ready to compile a target > specific C++ file yet.
After quick look, I think makefiles are ready. However, if any target relies on llvm-i386.cpp to provide these undefined symbols then config.gcc needs to be updated to inform this to makefiles for such targets. Each target can use their own target specific C++ source file, no need to put everything in llvm-i386.c pp or llvm-ppc.cpp. > Fortunately there is a work around: So this is not a work around, but right way to fix it. Thanks! - Devang > > 1. Edit gcc/config.gcc > 2. Find the case statement at line 558 > 3. Find the pattern that matches your target in the cases that follow. > 4. Add the following right after the "tmake_file" line for your > target. > # APPLE LOCAL begin LLVM > out_cxx_file=i386/llvm-i386.cpp > # APPLE LOCAL end LLVM > > For example, find the line that matches this pattern: ^i.*linux > around line 964. That has an example of the correct patch. It looks > like > this: > > i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*- > knetbsd*-gnu) > # Intel 80386's running GNU/* > # with ELF format using glibc 2 > tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h > svr4.h linux.h i386/linux.h" > # APPLE LOCAL begin LLVM > out_cxx_file=i386/llvm-i386.cpp > # APPLE LOCAL end LLVM > case ${target} in > > The APPLE section is what you add. > > Reid. > > > > Reid. > > On Sun, 2007-01-07 at 17:14 -0800, Reid Spencer wrote: >> All, >> >> Attached is a cumulative patch with all changes in the Apple >> repository >> since the mirror's r240 revision. If you haven't applied the various >> patches sent in the last few days, this one will be much easier. >> >> The attached patch also contains one thing that the Apple repository >> doesn't have: fixes to i386.h for changes in the result type of >> Module::getOrInsertFunction. >> >> This patch compiles/works fine for me on Linux/x86 >> >> Reid. >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits@cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<LLVM- >> GCC-2007-01-07.patch> > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits