Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtensa: enhanced handling of toolchain environment variables #79573

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dcpleung
Copy link
Member

@dcpleung dcpleung commented Oct 8, 2024

To use Xtensa toolchain, various environment variables must be set so the executables can find necessary files and what core to compile for. This becomes an annoyance when you have to test multiple boards with different cores. You have to use one set of environment variables per core. Twister cannot test them all in one setting, and it is especially annoying doing west builds. So enhance the environment variables handling so that TOOLCHAIN_VER and XTENSA_CORE can be replaced by TOOLCHAIN_VAR_ and XTENSA_CORE_ where is the normalized board target (think .yaml). CMake will then figure out the core ID for the toolchain to use.

Also force xt-as to be identified as GNU Assembler via xt-clang to keep cmake from running it through a bunch of options to determine the assembler ID.

xt-clang uses GNU Assembler (xt-as) based on binutils. However,
CMake doesn't recognize it when invoking through xt-clang. This
results in CMake going through all possible combinations of
command line arguments while invoking xt-clang to determine
assembler vendor. This multiple invocation of xt-clang
unnecessarily lengthens the CMake phase of build, especially
when xt-clang needs to obtain license information from remote
licensing servers. So here forces the assembler ID to be GNU to
speed things up a bit.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
To use Xtensa toolchain, various environment variables must be
set so the executables can find necessary files and what core
to compile for. This becomes an annoyance when you have to
test multiple boards with different cores. You have to use
one set of environment variables per core. Twister cannot test
them all in one setting, and it is especially annoying doing
west builds. So enhance the environment variables handling so
that TOOLCHAIN_VER and XTENSA_CORE can be replaced by
TOOLCHAIN_VAR_<board> and XTENSA_CORE_<board> where <board>
is the normalized board target (think <board>.yaml). CMake
will then figure out the core ID for the toolchain to use.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants