scripts: ext-toolchain: fix wrong prefix in print_config generation
authorChristian Marangi <ansuelsmth@gmail.com>
Sun, 3 Jul 2022 00:20:11 +0000 (02:20 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 3 Oct 2022 15:40:26 +0000 (17:40 +0200)
commit24cf766dfe80721dd033132a90399cb28138a63f
treee584f899585306a91f0bb784cf922d8a2a341b14
parent18a88668b8ede053919e9ec9b71364cab8e94c57
scripts: ext-toolchain: fix wrong prefix in print_config generation

The parsed prefix in print_config is wrong and this produce broken
generated .config that won't work with any external toolchain.

Currently the prefix from a CC of

'arm-openwrt-linux-muslgnueabi-gcc-12.1.0'

produce a prefix

'arm-openwrt-linux-muslgnueabi-gcc-'

This is wrong as the real prefix should be

'arm-openwrt-linux-muslgnueabi-'

This is probably caused by a change in how the toolchain is now handled
that now append also the gcc version. Probably in ancient days the
version wasn't part of the name and the prefix generation stripped the
'-gcc' instead of the gcc version.

Fix this and correctly strip the gcc version and the gcc suffix to
correctly call toolchain bins.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 53c293262fce844c8291ab82e6726a8489d3c57b)
scripts/ext-toolchain.sh