-
Notifications
You must be signed in to change notification settings - Fork 159
gnu: Add legacy Zephyr compatibility #989
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
base: main
Are you sure you want to change the base?
Conversation
In setup.sh, add option to create symlinks from gnu/ so that paths match previous SDK versions. In Zephyr-sdkConfig.cmake, set ZEPHYR_TOOLCHAIN_VARIANT to zephyr/gnu only when Zephyr sets ZEPHYR_TOOLCHAIN_VARIANT_COMPILER_SUPPORT before finding the SDK module. This will require a change to Zephyr, which is unfortunate. Ideally, we'd use some existing mechanism to detect when to make this switch. Signed-off-by: Keith Packard <[email protected]>
@@ -117,6 +118,8 @@ user_prompt() | |||
# Environment Configurations | |||
ask_yn "Register Zephyr SDK CMake package" && do_cmake_pkg="y" | |||
|
|||
ask_yn "Old zephyr version compatibility" && do_old_zephyr="y" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ask_yn "Old zephyr version compatibility" && do_old_zephyr="y" | |
ask_yn "Create symbolic links for old Zephyr compatibility" && do_old_zephyr="y" |
@@ -69,6 +69,7 @@ usage() | |||
echo " all Install all GNU toolchains" | |||
echo " -l Install LLVM toolchain" | |||
echo " -h Install host tools" | |||
echo " -o Old zephyr version compatibility" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo " -o Old zephyr version compatibility" | |
echo " -o Create symbolic links matching the old SDK layout for old Zephyr (<= 4.2) compatibility" |
ln -sr gnu/* . || assert_rc "ERROR: Creating toolchain links" 50 | ||
ln -sr cmake/zephyr/gnu/* cmake/zephyr || assert_rc "ERROR: Creating cmake links" 50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to symlink hosttools/*
to .
for host tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, "compatibility" is probably not the best choice of word here since SDK 1.0.0 is not meant to be "compatible" with Zephyr <= 4.2.
Maybe, s/compatibility/bisectability/ ?
set(ZEPHYR_TOOLCHAIN_VARIANT "zephyr/gnu") | ||
if(DEFINED ZEPHYR_TOOLCHAIN_VARIANT_COMPILER_SUPPORT) | ||
set(ZEPHYR_TOOLCHAIN_VARIANT "zephyr/gnu") | ||
else() | ||
set(ZEPHYR_TOOLCHAIN_VARIANT "zephyr") | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Zephyr-sdkConfig.cmake, set ZEPHYR_TOOLCHAIN_VARIANT to zephyr/gnu only when Zephyr sets ZEPHYR_TOOLCHAIN_VARIANT_COMPILER_SUPPORT before finding the SDK module. This will require a change to Zephyr, which is unfortunate. Ideally, we'd use some existing mechanism to detect when to make this switch.
What about using Zephyr version?
SDK 1.0.0 support will be available from Zephyr 4.3.0 (well, 4.2.99/main at this time), so we can set the default ZEPHYR_TOOLCHAIN_VARIANT=zephyr
when Zephyr_VERSION VERSION_LESS 4.2.99
In setup.sh, add option to create symlinks from gnu/ so that paths match previous SDK versions.
In Zephyr-sdkConfig.cmake, set ZEPHYR_TOOLCHAIN_VARIANT to zephyr/gnu only when Zephyr sets ZEPHYR_TOOLCHAIN_VARIANT_COMPILER_SUPPORT before finding the SDK module. This will require a change to Zephyr, which is unfortunate. Ideally, we'd use some existing mechanism to detect when to make this switch.
Fixes #851