Skip to content

Commit

Permalink
scripts/xtensa-build-zephyr.py: Correct XTENSA_SYSTEM path
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
andyross committed Sep 28, 2023
1 parent abd5006 commit 2eb7ff8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/xtensa-build-zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 2eb7ff8

Please sign in to comment.