You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

  1. From 2fdfb4404ab811cb00227a3de111437b829e55cf 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. Since commit applied in moby [61a3285 Support cross-compile for arm]
  6. it hardcoded var-CC to support cross-compile for arm
  7. Correct it with "${parameter:-word}" format, it is helpful for user
  8. define toolchains
  9. (Use Default Values. If parameter is unset or null, the expansion of
  10. word is substituted. Otherwise, the value of parameter is substituted.)
  11. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
  12. Upstream-commit: 3c701e4db1b8646c2324ae524b4e7ca1b1147a07
  13. Component: engine
  14. ---
  15. components/engine/hack/make/.binary | 10 +++++-----
  16. 1 file changed, 5 insertions(+), 5 deletions(-)
  17. diff --git a/components/engine/hack/make/.binary b/components/engine/hack/make/.binary
  18. index 53de6749e5..66f4ca05f3 100644
  19. --- a/components/engine/hack/make/.binary
  20. +++ b/components/engine/hack/make/.binary
  21. @@ -44,27 +44,27 @@ if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARC
  22. # must be cross-compiling!
  23. case "$(go env GOOS)/$(go env GOARCH)" in
  24. windows/amd64)
  25. - export CC=x86_64-w64-mingw32-gcc
  26. + export CC="${CC:-x86_64-w64-mingw32-gcc}"
  27. export CGO_ENABLED=1
  28. ;;
  29. linux/arm)
  30. case "${GOARM}" in
  31. 5|"")
  32. - export CC=arm-linux-gnueabi-gcc
  33. + export CC="${CC:-arm-linux-gnueabi-gcc}"
  34. export CGO_ENABLED=1
  35. ;;
  36. 7)
  37. - export CC=arm-linux-gnueabihf-gcc
  38. + export CC="${CC:-arm-linux-gnueabihf-gcc}"
  39. export CGO_ENABLED=1
  40. ;;
  41. esac
  42. ;;
  43. linux/arm64)
  44. - export CC=aarch64-linux-gnu-gcc
  45. + export CC="${CC:-aarch64-linux-gnu-gcc}"
  46. export CGO_ENABLED=1
  47. ;;
  48. linux/amd64)
  49. - export CC=x86_64-linux-gnu-gcc
  50. + export CC="${CC:-x86_64-linux-gnu-gcc}"
  51. export CGO_ENABLED=1
  52. ;;
  53. esac