Skip to contentSkip to conversation

golang-cross: add ccache support

PATCH New Amy Fong 1 participant 1 message Jun 19, 2015

lore
Share & tools
lore

Amy Fong

author
#0 lore raw

PATCH 1/1 golang-cross: add ccache support

From a6cb7ce2d69d59e10d273a1a1011d6c703d3ee13 Mon Sep 17 00:00:00 2001
From: Amy Fong <[email protected]>
Date: Fri, 19 Jun 2015 11:47:57 -0400
Subject: [PATCH] golang-cross: add ccache support

golang doesn't work with ccache. In the current state, a lot of parsing happens where it'll grab the first string in CC or LD and uses that for its builds. When ccache is enabled, it results in trying to do builds with just ccache.

The brokeness is seen when building with apps that uses cgo, like docker. To enable ccache to work, some string comparisons and changes to parsing had to be made.

---
 recipes-containers/docker/docker_git.bb |   5 --
 recipes-devtools/go/files/ccache.patch  | 147 ++++++++++++++++++++++++++++++++
 recipes-devtools/go/golang-cross.inc    |   1 +
 recipes-devtools/go/golang-cross_1.3.bb |   3 -
 4 files changed, 148 insertions(+), 8 deletions(-)
 create mode 100644 recipes-devtools/go/files/ccache.patch
recipes-containers/docker/docker_git.bb +0 -5
index 8bcaee9..f3c4007 100644
@@ -27,11 +27,6 @@ SRC_URI = "\
 	file://disable_sha1sum_startup.patch \
 	"
 
-# The golang-cross embeds a compiler invocation for the pre-parser
-# that is incompatible with the $CC definition used by the compiler
-# templates so disable CCACHE
-CCACHE = ""
-
 # Apache-2.0 for docker
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=1cc0497778922bfd6cb48721deb80dc7"
recipes-devtools/go/files/ccache.patch new file +147 -0

147 lines not on this page · raw message

recipes-devtools/go/golang-cross.inc +1 -0
index ce4ee0e..be2c1eb 100644
@@ -6,6 +6,7 @@ PROVIDES = "virtual/${TARGET_PREFIX}golang"
 SRC_URI = "\
 	http://golang.org/dl/go${PV}.src.tar.gz \
 	file://bsd_svid_source.patch \
+	file://ccache.patch \
 	"
 
 S="${WORKDIR}/go"
recipes-devtools/go/golang-cross_1.3.bb +0 -3
index 6d538f9..fcb0e7a 100644
@@ -1,7 +1,4 @@
 inherit cross
 
-# CCACHE does not work properly with GO
-CCACHE = ""
-
 require golang-cross.inc
 require golang-${PV}.inc
Signature · 1 line
2.1.4