build: ccache support for cross build
PATCH 1/1 build: ccache support for cross build
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
[1]
https://mesonbuild.com/Machine-files.html
--- config/arm/arm32_armv8_linux_gcc | 4 ++-- config/arm/arm64_armada_linux_gcc | 4 ++-- config/arm/arm64_armv8_linux_clang_ubuntu | 4 ++-- config/arm/arm64_armv8_linux_gcc | 4 ++-- config/arm/arm64_bluefield_linux_gcc | 4 ++-- config/arm/arm64_centriq2400_linux_gcc | 4 ++-- config/arm/arm64_cn10k_linux_gcc | 4 ++-- config/arm/arm64_cn9k_linux_gcc | 4 ++-- config/arm/arm64_dpaa_linux_gcc | 4 ++-- config/arm/arm64_emag_linux_gcc | 4 ++-- config/arm/arm64_graviton2_linux_gcc | 4 ++-- config/arm/arm64_kunpeng920_linux_gcc | 4 ++-- config/arm/arm64_kunpeng930_linux_gcc | 4 ++-- config/arm/arm64_n1sdp_linux_gcc | 4 ++-- config/arm/arm64_n2_linux_gcc | 4 ++-- config/arm/arm64_stingray_linux_gcc | 4 ++-- config/arm/arm64_thunderx2_linux_gcc | 4 ++-- config/arm/arm64_thunderxt83_linux_gcc | 4 ++-- config/arm/arm64_thunderxt88_linux_gcc | 4 ++-- config/ppc/ppc64le-power8-linux-gcc | 4 ++-- config/ppc/ppc64le-power8-linux-gcc-ubuntu | 4 ++-- config/x86/cross-mingw | 4 ++-- 22 files changed, 44 insertions(+), 44 deletions(-)
config/arm/arm32_armv8_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'arm-linux-gnueabihf-gcc' -cpp = 'arm-linux-gnueabihf-cpp' +c = ['ccache', 'arm-linux-gnueabihf-gcc'] +cpp = ['ccache', 'arm-linux-gnueabihf-cpp'] ar = 'arm-linux-gnueabihf-gcc-ar' strip = 'arm-linux-gnueabihf-strip' pkgconfig = 'arm-linux-gnueabihf-pkg-config'
config/arm/arm64_armada_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-ar' as = 'aarch64-linux-gnu-as' strip = 'aarch64-linux-gnu-strip'
config/arm/arm64_armv8_linux_clang_ubuntu +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'clang' -cpp = 'clang++' +c = ['ccache', 'clang'] +cpp = ['ccache', 'clang++'] ar = 'llvm-ar' strip = 'llvm-strip' llvm-config = 'llvm-config'
config/arm/arm64_armv8_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_bluefield_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_centriq2400_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_cn10k_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_cn9k_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_dpaa_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-ar' as = 'aarch64-linux-gnu-as' strip = 'aarch64-linux-gnu-strip'
config/arm/arm64_emag_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_graviton2_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_kunpeng920_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_kunpeng930_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_n1sdp_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_n2_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_stingray_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_thunderx2_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_thunderxt83_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_thunderxt88_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/ppc/ppc64le-power8-linux-gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'powerpc64le-linux-gcc' -cpp = 'powerpc64le-linux-cpp' +c = ['ccache', 'powerpc64le-linux-gcc'] +cpp = ['ccache', 'powerpc64le-linux-cpp'] ar = 'powerpc64le-linux-gcc-ar' strip = 'powerpc64le-linux-strip'
config/ppc/ppc64le-power8-linux-gcc-ubuntu +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'powerpc64le-linux-gnu-gcc' -cpp = 'powerpc64le-linux-gnu-cpp' +c = ['ccache', 'powerpc64le-linux-gnu-gcc'] +cpp = ['ccache', 'powerpc64le-linux-gnu-cpp'] ar = 'powerpc64le-linux-gnu-ar' strip = 'powerpc64le-linux-gnu-strip'
config/x86/cross-mingw +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'x86_64-w64-mingw32-gcc' -cpp = 'x86_64-w64-mingw32-g++' +c = ['ccache', 'x86_64-w64-mingw32-gcc'] +cpp = ['ccache', 'x86_64-w64-mingw32-g++'] ld = 'x86_64-w64-mingw32-ld' ar = 'x86_64-w64-mingw32-ar' strip = 'x86_64-w64-mingw32-strip'
Signature · 1 line
2.36.1
Quoted 10 lines · On Thu, Jun 02, 2022 at 02:53:55PM +0530, [email protected] wrote:
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>
Does this still work even if ccache is not available? That's not fully clear from the docs, but it seems to be that if an array is passed the whole array is used as the command, rather than just one element of the array. That would imply that cross-builds now require ccache. Is that acceptable?
/Bruce
Quoted 8 lines · Bruce Richardson
Quoted 6 lines · On Thu, Jun 02, 2022 at 02:53:55PM +0530, [email protected] wrote:
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
Quoted 6 lines
Quoted 4 lines
[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>Does this still work even if ccache is not available? That's not fully
Yes.
Quoted 4 lines
clear from the docs, but it seems to be that if an array is passed the whole array is used as the command, rather than just one element of the array. That would imply that cross-builds now require ccache. Is that acceptable?
I have removed ccache from the build machine still it works.
Quoted 3 lines
/Bruce
02/06/2022 11:43, Jerin Jacob:
Quoted 17 lines
Quoted 8 lines · Bruce Richardson
Quoted 6 lines · On Thu, Jun 02, 2022 at 02:53:55PM +0530, [email protected] wrote:
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
Quoted 6 lines
Quoted 4 lines
[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>Does this still work even if ccache is not available? That's not fully
Quoted 8 lines
Yes.
Quoted 4 lines
clear from the docs, but it seems to be that if an array is passed the whole array is used as the command, rather than just one element of the array. That would imply that cross-builds now require ccache. Is that acceptable?
I have removed ccache from the build machine still it works.
I don't understand why it works without ccache.
In general, I would prefer we have a mechanism to update the cross file on the fly, depending on the setup.
We have this for toolchain prefix name.
The prefix depends on where the toochain comes from.
In a "normal" build system, we set the prefix with an environment variable, not by writing a file.
Quoted 21 lines · Thomas Monjalon
02/06/2022 11:43, Jerin Jacob:
Quoted 19 lines
Quoted 8 lines · Bruce Richardson
Quoted 6 lines · On Thu, Jun 02, 2022 at 02:53:55PM +0530, [email protected] wrote:
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
Quoted 6 lines
Quoted 4 lines
[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>Does this still work even if ccache is not available? That's not fully
Yes.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
clear from the docs, but it seems to be that if an array is passed the whole array is used as the command, rather than just one element of the array. That would imply that cross-builds now require ccache. Is that acceptable?
I have removed ccache from the build machine still it works.
I don't understand why it works without ccache.
Meson is detecting valid compiler prefix. ccache is one of them.
See
https://github.com/fabio-porcedda/meson/commit/44db495f5ece43645ca3994dc95895c76a828530
https://github.com/mesonbuild/meson/issues/1392
Quoted 3 lines
In general, I would prefer we have a mechanism to update the cross file on the fly, depending on the setup.
I believe, It would be a departure from the meson cross-file concept.
Quoted 6 lines
We have this for toolchain prefix name.
The prefix depends on where the toochain comes from.
In a "normal" build system, we set the prefix with an environment variable, not by writing a file.
Quoted 40 lines · Jerin Jacob
Quoted 21 lines · Thomas Monjalon
02/06/2022 11:43, Jerin Jacob:
Quoted 19 lines
Quoted 8 lines · Bruce Richardson
Quoted 6 lines · On Thu, Jun 02, 2022 at 02:53:55PM +0530, [email protected] wrote:
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
Quoted 6 lines
Quoted 4 lines
[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>Does this still work even if ccache is not available? That's not fully
Yes.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
clear from the docs, but it seems to be that if an array is passed the whole array is used as the command, rather than just one element of the array. That would imply that cross-builds now require ccache. Is that acceptable?
I have removed ccache from the build machine still it works.
I don't understand why it works without ccache.
Meson is detecting valid compiler prefix. ccache is one of them.
See
https://github.com/fabio-porcedda/meson/commit/44db495f5ece43645ca3994dc95895c76a828530
https://github.com/mesonbuild/meson/issues/1392Quoted 1 line
Quoted 5 lines
Quoted 2 lines
In general, I would prefer we have a mechanism to update the cross file on the fly, depending on the setup.
I believe, It would be a departure from the meson cross-file concept.
I don't see why we could script it and use it if people wanted. The cross-file used should be stored in the build directory, so it's associated with the build.
/Bruce
Quoted 30 lines · Jerin Jacob
Quoted 28 lines · Thomas Monjalon
02/06/2022 11:43, Jerin Jacob:
Quoted 25 lines
Quoted 8 lines · Bruce Richardson
Quoted 6 lines · On Thu, Jun 02, 2022 at 02:53:55PM +0530, [email protected] wrote:
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
Quoted 6 lines
Quoted 4 lines
[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>Does this still work even if ccache is not available? That's not fully
Yes.
Quoted 4 lines
clear from the docs, but it seems to be that if an array is passed the whole array is used as the command, rather than just one element of the array. That would imply that cross-builds now require ccache. Is that acceptable?
I have removed ccache from the build machine still it works.
Quoted 7 lines
Quoted 1 line
I don't understand why it works without ccache.
Meson is detecting valid compiler prefix. ccache is one of them.
See
https://github.com/fabio-porcedda/meson/commit/44db495f5ece43645ca3994dc95895c76a828530
https://github.com/mesonbuild/meson/issues/1392
I hope there are no other review comments to fix it for this patch. Since it is improving the build time for cross-build. If there is no objection to this patch, Please merge it.
Quoted 15 lines
Quoted 6 lines
In general, I would prefer we have a mechanism to update the cross file on the fly, depending on the setup.
I believe, It would be a departure from the meson cross-file concept.
Quoted 6 lines
We have this for toolchain prefix name.
The prefix depends on where the toochain comes from.
In a "normal" build system, we set the prefix with an environment variable, not by writing a file.
08/06/2022 10:22, Jerin Jacob:
Quoted 35 lines · Jerin Jacob
Quoted 34 lines · Thomas Monjalon
Quoted 21 lines
02/06/2022 11:43, Jerin Jacob:
Quoted 19 lines
Quoted 8 lines · Bruce Richardson
Quoted 6 lines · On Thu, Jun 02, 2022 at 02:53:55PM +0530, [email protected] wrote:
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
Quoted 6 lines
Quoted 4 lines
[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>Does this still work even if ccache is not available? That's not fully
Yes.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
clear from the docs, but it seems to be that if an array is passed the whole array is used as the command, rather than just one element of the array. That would imply that cross-builds now require ccache. Is that acceptable?
I have removed ccache from the build machine still it works.
I don't understand why it works without ccache.
Meson is detecting valid compiler prefix. ccache is one of them.
Quoted 7 lines
Quoted 3 lines
See
https://github.com/fabio-porcedda/meson/commit/44db495f5ece43645ca3994dc95895c76a828530
https://github.com/mesonbuild/meson/issues/1392I hope there are no other review comments to fix it for this patch. Since it is improving the build time for cross-build. If there is no objection to this patch, Please merge it.
I've tested it now and I see a big blocker.
This patch is breaking the use of devtools/test-meson-builds.sh so I cannot merge it as-is, sorry.
Quoted 41 lines · Thomas Monjalon
08/06/2022 10:22, Jerin Jacob:
Quoted 39 lines · Jerin Jacob
Quoted 37 lines · Thomas Monjalon
Quoted 21 lines
02/06/2022 11:43, Jerin Jacob:
Quoted 19 lines
Quoted 8 lines · Bruce Richardson
Quoted 6 lines · On Thu, Jun 02, 2022 at 02:53:55PM +0530, [email protected] wrote:
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
Quoted 6 lines
Quoted 4 lines
[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>Does this still work even if ccache is not available? That's not fully
Yes.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
clear from the docs, but it seems to be that if an array is passed the whole array is used as the command, rather than just one element of the array. That would imply that cross-builds now require ccache. Is that acceptable?
I have removed ccache from the build machine still it works.
I don't understand why it works without ccache.
Meson is detecting valid compiler prefix. ccache is one of them.
See
https://github.com/fabio-porcedda/meson/commit/44db495f5ece43645ca3994dc95895c76a828530
https://github.com/mesonbuild/meson/issues/1392
Quoted 7 lines
Quoted 3 lines
I hope there are no other review comments to fix it for this patch. Since it is improving the build time for cross-build. If there is no objection to this patch, Please merge it.
I've tested it now and I see a big blocker.
This patch is breaking the use ofdevtools/test-meson-builds.shso I cannot merge it as-is, sorry.
I assume you are referring to fixing the DPDK_TARGET update due to the cross-file update.
If so, it is fixed in v2 at
http://patches.dpdk.org/project/dpdk/patch/[email protected]/
Thanks
Quoted 3 lines
Stanisław Kardach
Acked-byQuoted 47 lines · Jerin Jacob
Quoted 45 lines · Thomas Monjalon
08/06/2022 10:22, Jerin Jacob:
Quoted 42 lines · Jerin Jacob
Quoted 30 lines · Thomas Monjalon
Quoted 28 lines
02/06/2022 11:43, Jerin Jacob:
Quoted 25 lines
Quoted 8 lines · Bruce Richardson
Quoted 6 lines · On Thu, Jun 02, 2022 at 02:53:55PM +0530, [email protected] wrote:
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
Quoted 6 lines
Quoted 4 lines
[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>Does this still work even if ccache is not available? That's not fully
Yes.
Quoted 4 lines
clear from the docs, but it seems to be that if an array is passed the whole array is used as the command, rather than just one element of the array. That would imply that cross-builds now require ccache. Is that acceptable?
I have removed ccache from the build machine still it works.
Quoted 7 lines
Quoted 1 line
I don't understand why it works without ccache.
Meson is detecting valid compiler prefix. ccache is one of them.
See
https://github.com/fabio-porcedda/meson/commit/44db495f5ece43645ca3994dc95895c76a828530
https://github.com/mesonbuild/meson/issues/1392I hope there are no other review comments to fix it for this patch. Since it is improving the build time for cross-build. If there is no objection to this patch, Please merge it.
Quoted 8 lines
Quoted 3 lines
I've tested it now and I see a big blocker.
This patch is breaking the use ofdevtools/test-meson-builds.shso I cannot merge it as-is, sorry.I assume you are referring to fixing the
DPDK_TARGETupdate due to the cross-file update.
If so, it is fixed in v2 at
http://patches.dpdk.org/project/dpdk/patch/[email protected]/
I've just tested it on a clean Ubuntu 20.04 docker with only RISC-V toolchain, no ccache and indeed compilation works. Both directly with meson and via test-meson-builds.sh.
Seems like ccache is parsed in special way by meson as using any other unknown command just fails meson configuration.
Also setting CC/CXX env variable makes meson bail (even if I use the cross-file value), so I'm not sure if there is a better way to do it.
PATCH v2 1/1 build: ccache support for cross build
In reply to [email protected]From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
Also, updated devtools/test-meson-builds.sh
script to find the correct DPDK_TARGET due to
change in cross file syntax.
[1]
https://mesonbuild.com/Machine-files.html
---
v2:
- Rebased with master, therefore added update riscv64 cross files
- Fixed DPDK_TARGET detection with devtools/test-meson-builds.sh due to cross file synatx update.
config/arm/arm32_armv8_linux_gcc | 4 ++-- config/arm/arm64_armada_linux_gcc | 4 ++-- config/arm/arm64_armv8_linux_clang_ubuntu | 4 ++-- config/arm/arm64_armv8_linux_gcc | 4 ++-- config/arm/arm64_bluefield_linux_gcc | 4 ++-- config/arm/arm64_centriq2400_linux_gcc | 4 ++-- config/arm/arm64_cn10k_linux_gcc | 4 ++-- config/arm/arm64_cn9k_linux_gcc | 4 ++-- config/arm/arm64_dpaa_linux_gcc | 4 ++-- config/arm/arm64_emag_linux_gcc | 4 ++-- config/arm/arm64_graviton2_linux_gcc | 4 ++-- config/arm/arm64_kunpeng920_linux_gcc | 4 ++-- config/arm/arm64_kunpeng930_linux_gcc | 4 ++-- config/arm/arm64_n1sdp_linux_gcc | 4 ++-- config/arm/arm64_n2_linux_gcc | 4 ++-- config/arm/arm64_stingray_linux_gcc | 4 ++-- config/arm/arm64_thunderx2_linux_gcc | 4 ++-- config/arm/arm64_thunderxt83_linux_gcc | 4 ++-- config/arm/arm64_thunderxt88_linux_gcc | 4 ++-- config/ppc/ppc64le-power8-linux-gcc | 4 ++-- config/ppc/ppc64le-power8-linux-gcc-ubuntu | 4 ++-- config/riscv/riscv64_linux_gcc | 4 ++-- config/riscv/riscv64_sifive_u740_linux_gcc | 4 ++-- config/x86/cross-mingw | 4 ++-- devtools/test-meson-builds.sh | 3 ++- 25 files changed, 50 insertions(+), 49 deletions(-)
config/arm/arm32_armv8_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'arm-linux-gnueabihf-gcc' -cpp = 'arm-linux-gnueabihf-cpp' +c = ['ccache', 'arm-linux-gnueabihf-gcc'] +cpp = ['ccache', 'arm-linux-gnueabihf-cpp'] ar = 'arm-linux-gnueabihf-gcc-ar' strip = 'arm-linux-gnueabihf-strip' pkgconfig = 'arm-linux-gnueabihf-pkg-config'
config/arm/arm64_armada_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-ar' as = 'aarch64-linux-gnu-as' strip = 'aarch64-linux-gnu-strip'
config/arm/arm64_armv8_linux_clang_ubuntu +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'clang' -cpp = 'clang++' +c = ['ccache', 'clang'] +cpp = ['ccache', 'clang++'] ar = 'llvm-ar' strip = 'llvm-strip' llvm-config = 'llvm-config'
config/arm/arm64_armv8_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_bluefield_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_centriq2400_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_cn10k_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_cn9k_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_dpaa_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-ar' as = 'aarch64-linux-gnu-as' strip = 'aarch64-linux-gnu-strip'
config/arm/arm64_emag_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_graviton2_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_kunpeng920_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_kunpeng930_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_n1sdp_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_n2_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_stingray_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_thunderx2_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_thunderxt83_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/arm/arm64_thunderxt88_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-cpp' +c = ['ccache', 'aarch64-linux-gnu-gcc'] +cpp = ['ccache', 'aarch64-linux-gnu-cpp'] ar = 'aarch64-linux-gnu-gcc-ar' strip = 'aarch64-linux-gnu-strip' pkgconfig = 'aarch64-linux-gnu-pkg-config'
config/ppc/ppc64le-power8-linux-gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'powerpc64le-linux-gcc' -cpp = 'powerpc64le-linux-cpp' +c = ['ccache', 'powerpc64le-linux-gcc'] +cpp = ['ccache', 'powerpc64le-linux-cpp'] ar = 'powerpc64le-linux-gcc-ar' strip = 'powerpc64le-linux-strip'
config/ppc/ppc64le-power8-linux-gcc-ubuntu +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'powerpc64le-linux-gnu-gcc' -cpp = 'powerpc64le-linux-gnu-cpp' +c = ['ccache', 'powerpc64le-linux-gnu-gcc'] +cpp = ['ccache', 'powerpc64le-linux-gnu-cpp'] ar = 'powerpc64le-linux-gnu-ar' strip = 'powerpc64le-linux-gnu-strip'
config/riscv/riscv64_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'riscv64-linux-gnu-gcc' -cpp = 'riscv64-linux-gnu-g++' +c = ['ccache', 'riscv64-linux-gnu-gcc'] +cpp = ['ccache', 'riscv64-linux-gnu-g++'] ar = 'riscv64-linux-gnu-ar' strip = 'riscv64-linux-gnu-strip' pcap-config = ''
config/riscv/riscv64_sifive_u740_linux_gcc +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'riscv64-unknown-linux-gnu-gcc' -cpp = 'riscv64-unknown-linux-gnu-g++' +c = ['ccache', 'riscv64-unknown-linux-gnu-gcc'] +cpp = ['ccache', 'riscv64-unknown-linux-gnu-g++'] ar = 'riscv64-unknown-linux-gnu-ar' strip = 'riscv64-unknown-linux-gnu-strip' pcap-config = ''
config/x86/cross-mingw +2 -2
@@ -1,6 +1,6 @@ [binaries] -c = 'x86_64-w64-mingw32-gcc' -cpp = 'x86_64-w64-mingw32-g++' +c = ['ccache', 'x86_64-w64-mingw32-gcc'] +cpp = ['ccache', 'x86_64-w64-mingw32-g++'] ld = 'x86_64-w64-mingw32-ld' ar = 'x86_64-w64-mingw32-ar' strip = 'x86_64-w64-mingw32-strip'
devtools/test-meson-builds.sh +2 -1
@@ -160,7 +160,8 @@ build () # <directory> <target cc | cross file> <ABI check> [meson options] if [ -n "$crossfile" ] ; then cross="--cross-file $crossfile" targetcc=$(sed -n 's,^c[[:space:]]*=[[:space:]]*,,p' \ - $crossfile | tr -d "'" | tr -d '"') + $crossfile | cut -d ',' -f 2 | \ + tr -d "'" | tr -d '"' | tr -d ']' | tr -d ' ') else cross= fi
Signature · 1 line
2.36.1
Test with: arm64_kunpeng920/930 and gcc-7/10, also with ccache or no, all pass
Quoted 34 lines · On 2022/6/9 1:13, [email protected] wrote:
From: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1]. Update all cross files to use ccache if it is available in build machine.
Also, updated
devtools/test-meson-builds.sh
script to find the correctDPDK_TARGETdue to
change in cross file syntax.[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>---
v2:
- Rebased with master, therefore added update riscv64 cross files
- FixedDPDK_TARGETdetection withdevtools/test-meson-builds.shdue to cross file synatx update.config/arm/arm32_armv8_linux_gcc | 4 ++-- config/arm/arm64_armada_linux_gcc | 4 ++-- config/arm/arm64_armv8_linux_clang_ubuntu | 4 ++-- config/arm/arm64_armv8_linux_gcc | 4 ++-- config/arm/arm64_bluefield_linux_gcc | 4 ++-- config/arm/arm64_centriq2400_linux_gcc | 4 ++-- config/arm/arm64_cn10k_linux_gcc | 4 ++-- config/arm/arm64_cn9k_linux_gcc | 4 ++-- config/arm/arm64_dpaa_linux_gcc | 4 ++-- config/arm/arm64_emag_linux_gcc | 4 ++-- config/arm/arm64_graviton2_linux_gcc | 4 ++-- config/arm/arm64_kunpeng920_linux_gcc | 4 ++-- config/arm/arm64_kunpeng930_linux_gcc | 4 ++--
[snip]
Quoted 1 line
Quoted 18 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Thursday, June 9, 2022 1:13 AM
To: [email protected]; Jan Viktorin <[email protected]>; Ruifeng Wang <[email protected]>; Bruce Richardson <[email protected]>; David Christensen <[email protected]>; Stanislaw Kardach <[email protected]>; Konstantin Ananyev <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH v2] build: ccache support for cross buildFrom: Jerin Jacob <[email protected]>
By default, ccache is not used for cross build[1].
Update all cross files to use ccache if it is available in build machine.
Quoted 9 lines
Also, updated
devtools/test-meson-builds.shscript to find the correctDPDK_TARGETdue to change in cross file syntax.[1]
https://mesonbuild.com/Machine-files.htmlSigned-off-by Jerin Jacob <[email protected]>---
Verified that cross-build works fine with/without ccache.
Quoted 9 lines
Quoted 9 lines
By default, ccache is not used for cross build[1].
Update all cross files to use ccache if it is available in build machine.Also, updated
devtools/test-meson-builds.shscript to find the correctDPDK_TARGETdue to change in cross file syntax.
Quoted 6 lines
Quoted 3 lines
Signed-off-by Jerin Jacob <[email protected]>---
Verified that cross-build works fine with/without ccache.
Acked-by Ruifeng Wang <[email protected]>
Applied with minor change, thanks.
08/06/2022 19:13, [email protected]:
devtools/test-meson-builds.sh build () # <directory> <target cc | cross file> <ABI check> [meson options] · line 164
Quoted 9 lines
devtools/test-meson-builds.sh +2
-1@@ -160,7 +160,8 @@ build () # <directory> <target cc | cross file> <ABI check> [meson options] if [ -n "$crossfile" ] ; then cross="--cross-file $crossfile" targetcc=$(sed -n 's,^c[[:space:]]*=[[:space:]]*,,p' \ - $crossfile | tr -d "'" | tr -d '"') + $crossfile | cut -d ',' -f 2 | \ + tr -d "'" | tr -d '"' | tr -d ']' | tr -d ' ')
The last line can be shortened to
tr -d "'"'"] '
I'll change while merging.