Skip to content

Fix cannot find arc-elf cross tool #398

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kbuild/kbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ setup_cross_vars()
# for earlier gcc version, will failed to find arceb-elf for
# big endian arceb-elf tool chain
if is_config_enabled CONFIG_CPU_BIG_ENDIAN; then
crosstool=arceb-elf
crosstool=arceb-linux
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, the entry of gcc-14 is different than old ones. Looks can do mapping based on the compiler as well.

./gcc-9.3.0-nolibc/arceb-elf
./gcc-9.3.0-nolibc/arc-elf
./gcc-10.5.0-nolibc/arc-linux
./gcc-11.5.0-nolibc/arc-linux
./gcc-13.3.0-nolibc/arc-linux
./gcc-14.2.0-nolibc/arc-linux

Is it possible to check whether the compiler version is >= 10, then to use arc-linux? BTW: there's no arceb-linux, in higher version of gcc, it only has arc-linux

else
crosstool=arc-elf
crosstool=arc-linux
fi
;;
c6x)
Expand Down
5 changes: 3 additions & 2 deletions kbuild/make.cross
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ install_crosstool_gcc()
if [[ $gcc_version ]]; then
# for arch has more than 1 cross tool available, like x86_64-gcc-9.3.0-nolibc_arm-linux-gnueabi.tar.xz
# and x86_64-gcc-9.3.0-nolibc_arm-linux-gnueabihf.tar.xz for arm, match "arm-linux-gnueabi." instead of
# "arm-linux-gnueabi" to get single tool package which match exactly.
file=$(grep "${gcc_arch_pattern}\..*tar\.xz$" $list | grep "${gcc_version}" | tail -1)
# "arm-linux-gnueabi" to get single tool package which match exactly. Also, avoid wrong matching of cross
# tool for an other architecture like arc-linux.tar.xz and sparc-linux.tar.xz
file=$(grep "\-${gcc_arch_pattern}\.tar\.xz$" $list | grep "${gcc_version}" | tail -1)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, can the pattern be "-${gcc_arch_pattern}..*tar.xz$, so it can be compatible to old compiler like gcc-9 to distinguish x86_64-gcc-9.3.0-nolibc_arm-linux-gnueabi.tar.xz and x86_64-gcc-9.3.0-nolibc_arm-linux-gnueabihf.tar.xz?

else
file=$(grep "${gcc_arch_pattern}\..*tar\.xz$" $list | tail -1)
fi
Expand Down