diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2019-09-18 09:58:40 +0200 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-09-23 02:30:19 -0400 |
commit | e7787cb01be91d3798594687a475d5b085f29ede (patch) | |
tree | 6b28c8fb4bd614d84861523fb6e0319beb050df1 /recipes-containers/docker | |
parent | b626ea1d49590b1e275d349491d4a6c552b7f20b (diff) | |
download | meta-virtualization-e7787cb01be91d3798594687a475d5b085f29ede.tar.gz |
docker-ce: improve hardcoded CC for cross compile
Since commit applied in moby [61a3285 Support cross-compile for arm]
it hardcoded var-CC to support cross-compile for arm
Correct it with "${parameter:-word}" format, it is helpful for user
define toolchains
(Use Default Values. If parameter is unset or null, the expansion of
word is substituted. Otherwise, the value of parameter is substituted.)
https://github.com/moby/moby/commit/61a3285864d3f1b489f48f765b61b2c7bd300372
This fixes a build issue seen when building docker-ce:
exec: "aarch64-linux-gnu-gcc": executable file not found in $PATH
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/docker')
-rw-r--r-- | recipes-containers/docker/docker-ce_git.bb | 1 | ||||
-rw-r--r-- | recipes-containers/docker/files/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch | 61 |
2 files changed, 62 insertions, 0 deletions
diff --git a/recipes-containers/docker/docker-ce_git.bb b/recipes-containers/docker/docker-ce_git.bb index a3e27a53..215f1140 100644 --- a/recipes-containers/docker/docker-ce_git.bb +++ b/recipes-containers/docker/docker-ce_git.bb | |||
@@ -25,6 +25,7 @@ SRC_URI = "\ | |||
25 | git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=git/libnetwork \ | 25 | git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=git/libnetwork \ |
26 | file://0001-libnetwork-use-GO-instead-of-go.patch \ | 26 | file://0001-libnetwork-use-GO-instead-of-go.patch \ |
27 | file://docker.init \ | 27 | file://docker.init \ |
28 | file://0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch \ | ||
28 | " | 29 | " |
29 | 30 | ||
30 | require docker.inc | 31 | require docker.inc |
diff --git a/recipes-containers/docker/files/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch b/recipes-containers/docker/files/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch new file mode 100644 index 00000000..70fdaf83 --- /dev/null +++ b/recipes-containers/docker/files/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 1263fdb50a540e9db742694b7cee08284ad986d0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Wed, 17 Jul 2019 17:34:04 +0800 | ||
4 | Subject: [PATCH] imporve hardcoded CC on cross compile | ||
5 | |||
6 | Since commit applied in moby [61a3285 Support cross-compile for arm] | ||
7 | it hardcoded var-CC to support cross-compile for arm | ||
8 | |||
9 | Correct it with "${parameter:-word}" format, it is helpful for user | ||
10 | define toolchains | ||
11 | |||
12 | (Use Default Values. If parameter is unset or null, the expansion of | ||
13 | word is substituted. Otherwise, the value of parameter is substituted.) | ||
14 | |||
15 | Upstream-Status: Submitted [https://github.com/moby/moby/pull/39546] | ||
16 | |||
17 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
18 | --- | ||
19 | components/engine/hack/make/.binary | 10 +++++----- | ||
20 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
21 | |||
22 | diff --git a/src/import/components/engine/hack/make/.binary b/src/import/components/engine/hack/make/.binary | ||
23 | index 53de6749e5..66f4ca05f3 100644 | ||
24 | --- a/src/import/components/engine/hack/make/.binary | ||
25 | +++ b/src/import/components/engine/hack/make/.binary | ||
26 | @@ -44,27 +44,27 @@ if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARC | ||
27 | # must be cross-compiling! | ||
28 | case "$(go env GOOS)/$(go env GOARCH)" in | ||
29 | windows/amd64) | ||
30 | - export CC=x86_64-w64-mingw32-gcc | ||
31 | + export CC="${CC:-x86_64-w64-mingw32-gcc}" | ||
32 | export CGO_ENABLED=1 | ||
33 | ;; | ||
34 | linux/arm) | ||
35 | case "${GOARM}" in | ||
36 | 5|"") | ||
37 | - export CC=arm-linux-gnueabi-gcc | ||
38 | + export CC="${CC:-arm-linux-gnueabi-gcc}" | ||
39 | export CGO_ENABLED=1 | ||
40 | ;; | ||
41 | 7) | ||
42 | - export CC=arm-linux-gnueabihf-gcc | ||
43 | + export CC="${CC:-arm-linux-gnueabihf-gcc}" | ||
44 | export CGO_ENABLED=1 | ||
45 | ;; | ||
46 | esac | ||
47 | ;; | ||
48 | linux/arm64) | ||
49 | - export CC=aarch64-linux-gnu-gcc | ||
50 | + export CC="${CC:-aarch64-linux-gnu-gcc}" | ||
51 | export CGO_ENABLED=1 | ||
52 | ;; | ||
53 | linux/amd64) | ||
54 | - export CC=x86_64-linux-gnu-gcc | ||
55 | + export CC="${CC:-x86_64-linux-gnu-gcc}" | ||
56 | export CGO_ENABLED=1 | ||
57 | ;; | ||
58 | esac | ||
59 | -- | ||
60 | 2.23.0 | ||
61 | |||