Simple user question

Hi everyone, I'm going to be working with LLVM locally to implement and support some of our research projects.

As a first step I am trying to set up our build process to support builds by both GCC and LLVM. I need to be minimally invasive to the current makefile structure, in particular, I don't want to add any conditional tests to what is already there (ie, I don't want the main makefile to test if CXX is LLVM, or if there is an LLVM flag set, or anything like that).

Everything works great except that the current final rule to build the target is essentially "$(CXX) $(LDFLAGS) $^ -o $@". During my LLVM build I've built llvm bytecode libraries, and llvm bytecode targets.

Is there any way to convince llvm-gcc to use llvm-ld during linking rather than the system ld? If there isn't then I'll have to muck with the build a bit more to add something like FINAL_CXX, but everyone will see that and it may generate a bit of annoyance (and will need to be another thing that is modified for our public releases).

Thanks,
Luke