You seem to be swinging back and forth between the legacy and the platform-based ways of resolving CC toolchains. I doubt that you are doing this on purpose, but it is very confusing.
Both systems define the actual CC toolchain using the cc_toolchain rule, and this describes what tools are available, what headers and libraries the system provides, etc. The difference is in how Bazel discovers which toolchain to use:
- The legacy system uses the --crosstool_top flag (or --host_crosstool_top for host builds) to find a cc_toolchain_suite target. This target is then used to find the correct cc_toolchain to use, based on the --cpu and --compiler flags (and that is, of course, --host_cpu and --host_compiler in host builds).
The errors you have received saying "in cc_toolchain_suite rule //tools/build/product-build:marvell_suite: cc_toolchain_suite '//tools/build/product-build:my_suite' does not contain a toolchain for cpu 'k8'" are for the legacy system: something is checking the value of --crosstool_top, it's pointing to //tools/build/product-build:marvell_suite, that cc_toolchain_suite doesn't contain anything for the default --cpu value of "k8", and that's your error.
The errors saying "target does not provide the DeclaredToolchainInfo provider" are from the new platforms-and-toolchains system: it means you have called `register_toolchains` in your WORKSPACE file, but the label you gave is not the actual `toolchain` rule, it is something else.
Please note that it would be an error to call `register_toolchains('//tools/build/product-build:marvell_suite')`, because `//tools/build/product-build:marvell_suite` is the `cc_toolchain_suite` rule, not the `toolchain` rule.
If you are comfortable sticking with the legacy CC toolchains, since they are still supported, remove the `register_toolchains` calls from your WORKSPACE.
I suspect the problem with your cc_toolchain_suite is that host builds are trying to build for k8 (since that's the default for --host_cpu), but you're not defining a toolchain for k8 in your cc_toolchain_suite. You can either add the k8 toolchain, like you did, or make sure that --host_crosstool_top is set to `@bazel_tools//tools/cpp:toolchain`.
Hopefully this will help clear up the problems that you are having.
John Cater