diff --git a/toolchain/build.sh b/toolchain/build.sh index 77da9a3..2ed9b7d 100644 --- a/toolchain/build.sh +++ b/toolchain/build.sh @@ -1,6 +1,7 @@ #!/bin/bash -e export Github=https://raw.githubusercontent.com/oppen321/ZeroWrt-Action/refs/heads/master/patch + # Clone source code git clone -b openwrt-24.10 --single-branch --filter=blob:none https://github.com/immortalwrt/immortalwrt openwrt @@ -15,13 +16,13 @@ cd openwrt sed -i 's/noinitrd/noinitrd mitigations=off/g' target/linux/x86/image/grub-efi.cfg # gcc15 patches -curl -s $Github/gcc-15/202-toolchain-gcc-add-support-for-GCC-15.patch | patch -p1 +curl -s $Github/patch/gcc-15/202-toolchain-gcc-add-support-for-GCC-15.patch | patch -p1 # GCC Optimization level -O3 if [ "$model" = "OpenWrt_Rockchip_v24.10" ]; then - curl -s $Github/target-modify_for_rockchip.patch | patch -p1 + curl -s $Github/patch/target-modify_for_rockchip.patch | patch -p1 elif [ "$model" = "OpenWrt_X86_64_v24.10" ]; then - curl -s $Github/target-modify_for_x86_64.patch | patch -p1 + curl -s $Github/patch/target-modify_for_x86_64.patch | patch -p1 fi # fix gcc14 @@ -57,26 +58,26 @@ fi # fix gcc-15 if [ "$USE_GCC15" = y ]; then # Mbedtls - curl -s $Github/gcc-15/mbedtls/901-tests-fix-string-initialization-error-on-gcc15.patch > package/libs/mbedtls/patches/901-tests-fix-string-initialization-error-on-gcc15.patch + curl -s $Github/patch/gcc-15/mbedtls/901-tests-fix-string-initialization-error-on-gcc15.patch > package/libs/mbedtls/patches/901-tests-fix-string-initialization-error-on-gcc15.patch sed -i '/TARGET_CFLAGS/ s/$/ -Wno-error=unterminated-string-initialization/' package/libs/mbedtls/Makefile # elfutils - curl -s $Github/gcc-15/elfutils/901-backends-fix-string-initialization-error-on-gcc15.patch > package/libs/elfutils/patches/901-backends-fix-string-initialization-error-on-gcc15.patch + curl -s $Github/patch/gcc-15/elfutils/901-backends-fix-string-initialization-error-on-gcc15.patch > package/libs/elfutils/patches/901-backends-fix-string-initialization-error-on-gcc15.patch # libwebsockets mkdir -p feeds/packages/libs/libwebsockets/patches - curl -s $Github/gcc-15/libwebsockets/901-fix-string-initialization-error-on-gcc15.patch > feeds/packages/libs/libwebsockets/patches/901-fix-string-initialization-error-on-gcc15.patch + curl -s $Github/patch/gcc-15/libwebsockets/901-fix-string-initialization-error-on-gcc15.patch > feeds/packages/libs/libwebsockets/patches/901-fix-string-initialization-error-on-gcc15.patch # libxcrypt mkdir -p feeds/packages/libs/libxcrypt/patches - curl -s $Github/gcc-15/libxcrypt/901-fix-string-initialization-error-on-gcc15.patch > feeds/packages/libs/libxcrypt/patches/901-fix-string-initialization-error-on-gcc15.patch + curl -s $Github/patch/gcc-15/libxcrypt/901-fix-string-initialization-error-on-gcc15.patch > feeds/packages/libs/libxcrypt/patches/901-fix-string-initialization-error-on-gcc15.patch fi # fix gcc-15.0.1 C23 if [ "$USE_GCC15" = y ]; then # gmp mkdir -p package/libs/gmp/patches - curl -s $Github/gcc-15-c23/gmp/001-fix-build-with-gcc-15.patch > package/libs/gmp/patches/001-fix-build-with-gcc-15.patch + curl -s $Github/patch/gcc-15-c23/gmp/001-fix-build-with-gcc-15.patch > package/libs/gmp/patches/001-fix-build-with-gcc-15.patch # htop mkdir -p feeds/packages/admin/htop/patches - curl -s $Github/gcc-15-c23/htop/001-Avoid-compilation-issues-with-ncurses-on-GCC-15.patch > feeds/packages/admin/htop/patches/001-Avoid-compilation-issues-with-ncurses-on-GCC-15.patch + curl -s $Github/patch/gcc-15-c23/htop/001-Avoid-compilation-issues-with-ncurses-on-GCC-15.patch > feeds/packages/admin/htop/patches/001-Avoid-compilation-issues-with-ncurses-on-GCC-15.patch # libtirpc sed -i '/TARGET_CFLAGS/i TARGET_CFLAGS += -std=gnu17\n' feeds/packages/libs/libtirpc/Makefile # libsepol @@ -145,18 +146,18 @@ elif [ "$model" = "OpenWrt_X86_64_v24.10" ]; then fi # bpf -[ "$ENABLE_BPF" = "y" ] && curl -s $mirror/openwrt/generic/config-bpf >> .config +[ "$ENABLE_BPF" = "y" ] && curl -s $Github/generic/config-bpf >> .config # LTO export ENABLE_LTO=$ENABLE_LTO -[ "$ENABLE_LTO" = "y" ] && curl -s $mirror/openwrt/generic/config-lto >> .config +[ "$ENABLE_LTO" = "y" ] && curl -s $Github/generic/config-lto >> .config # mold [ "$ENABLE_MOLD" = "y" ] && echo 'CONFIG_USE_MOLD=y' >> .config # glibc [ "$ENABLE_GLIBC" = "y" ] && { - curl -s $mirror/openwrt/generic/config-glibc >> .config + curl -s $Github/generic/config-glibc >> .config sed -i '/NaiveProxy/d' .config }