[Buildroot] [git commit] pv: support ccache builds

Peter Korsgaard peter at korsgaard.com
Sun Nov 17 07:36:49 UTC 2013

commit: http://git.buildroot.net/buildroot/commit/?id=21161a0889ae5b6c416773597bb24475340619bd
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

When using ccache TARGET_CC is something like
    ccache gcc

This causes problems in the pv build which attempts to
override LD because the command ends up being
    make [...] LD=/tools/ccache /tools/gcc LDFLAGS="[...]

As a result, during the build phase it attempts to build
/tools/gcc which succeeds by doing nothing:
    make[1]: Nothing to be done for `/tools/gcc'.

and during the install phase you get the real build which
errors out on the LD error this snippet was attempting to
    ld -r -o src/library.o src/library/getopt.o \
    ld: src/library/gettext.o: Relocations in generic ELF \
        (EM: 40)
    src/library/gettext.o: error adding symbols: File in \
        wrong format

Signed-off-by: Andrew Ruder <andrew.ruder at elecsyscorp.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
 package/pv/pv.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/package/pv/pv.mk b/package/pv/pv.mk
index 00502d3..5f1a54b 100644
--- a/package/pv/pv.mk
+++ b/package/pv/pv.mk
@@ -17,7 +17,7 @@ PV_LICENSE_FILES = doc/COPYING
 # the correct one. By passing the below values for LD and LDFLAGS, we
 # ensure that 'gcc' is used to do these partial linking steps.
+	LD="$(TARGET_CC)" \
 	LDFLAGS="-Wl,-r -nostdlib"
 $(eval $(autotools-package))

More information about the buildroot mailing list