From f91b1330a9f1048b8012168cdf855e590435804c Mon Sep 17 00:00:00 2001 From: zhao Date: Sat, 22 Mar 2025 22:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20toolchain/build.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhao --- toolchain/build.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/toolchain/build.sh b/toolchain/build.sh index e6596a0..c0a6bc6 100644 --- a/toolchain/build.sh +++ b/toolchain/build.sh @@ -14,6 +14,29 @@ cd openwrt # gcc15 patches curl -s $Github/gcc-15/202-toolchain-gcc-add-support-for-GCC-15.patch | patch -p1 +# fix gcc14 and gcc15 +if [ "$USE_GCC14" = y ] || [ "$USE_GCC15" = y ]; then + # 如果是 GCC 14 或 GCC 15,则替换并克隆修复后的 linux-atm + echo "Detected GCC 14 or 15. Replacing linux-atm with a fixed version..." + + # 移除原有的 linux-atm 软件包 + rm -rf package/network/utils/linux-atm + + # 从 GitHub 克隆修复后的 linux-atm 软件包 + git clone https://github.com/sbwml/package_network_utils_linux-atm package/network/utils/linux-atm + + # 检查是否克隆成功 + if [ -d "package/network/utils/linux-atm" ]; then + echo "linux-atm has been successfully replaced for GCC 14/15 compatibility." + else + echo "Failed to clone the fixed linux-atm package. Please check your network or the repository URL." + exit 1 + fi +else + # 如果不是 GCC 14 或 GCC 15,则什么都不做 + echo "GCC 14 or 15 not enabled. Skipping linux-atm replacement." +fi + # fix gcc-15 if [ "$USE_GCC15" = y ]; then # Mbedtls