From 2eb7ff8917b344e08aae74f184ca654556367a4d Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Thu, 28 Sep 2023 08:20:44 -0700 Subject: [PATCH] scripts/xtensa-build-zephyr.py: Correct XTENSA_SYSTEM path The current build fails if building with XTENSA_TOOLS_ROOT set to a non-default Cadence tool directly. The proximate failure is that "xt-clang --version" produces an error at zephyr configure time (which is hidden by default, sigh) that it can't find the core in the specified XTENSA_SYSTEM registry. When you run "xt-clang" without arguments and without XTENSA_CORE set, it will helpfully point to the list of installed cores, but they're at a different spot than this script is using. Basically the core registry is installed with the "tools", not the "builds", and isn't specific to a given core. Whch makes sense, I guess. The directories don't otherwise seem compatible, I don't think this ever worked? Maybe I'm the only one using a XTENSA_TOOLS_ROOT setting? Signed-off-by: Andy Ross --- scripts/xtensa-build-zephyr.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index 5f8cdd5ce361..92bf0850b9b9 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -689,9 +689,12 @@ def build_platforms(): # Set variables expected by xcc toolchain. CMake cannot set (evil) build-time # environment variables at configure time: # https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#how-can-i-get-or-set-environment-variables - XTENSA_BUILDS_DIR=str(pathlib.Path(xtensa_tools_root_dir, "install", "builds", - TOOLCHAIN_VER).absolute()) - XTENSA_SYSTEM = str(pathlib.Path(XTENSA_BUILDS_DIR, XTENSA_CORE, "config").absolute()) + XTENSA_SYSTEM = str(pathlib.Path(xtensa_tools_root_dir, + "install", + "tools", + TOOLCHAIN_VER, + "XtensaTools", + "config").absolute()) platf_build_environ["XTENSA_SYSTEM"] = XTENSA_SYSTEM platform_build_dir_name = f"build-{platform}"