1

I'm using clang, llvm to compile MySQL and do some analysis. But the link stage is very time consuming(+5min) and I actually do not need the final executable. Only interested in several object files, which are successfully generated before the linking.

What I tried is to export LD AR to /bin/true but it then cannot compile saying no rule to make target xx.a. In general, is there a way to modify the makefile(from automake) only compile but not link?

4

1 回答 1

2

Put my workaround here in case someone is having similar need.

What I did is to export LD to /bin/true so that the last link stage can quickly pass which essentially do nothing but return successfully.

Sometimes, the build system may not honor this ENV variable. In that case, temporarily change `which ld' to a script calling /bin/true(make sure keep the original ld and change it back afterwards!) or use alias ld=/bin/true (haven't tried this method though).

于 2012-07-08T09:08:22.637 回答