From ede52017398fdc7985ca26c86398f90ab9fba395 Mon Sep 17 00:00:00 2001 From: dingguangya Date: Mon, 28 Nov 2022 20:47:26 +0800 Subject: [PATCH 1/2] [gcc-cross] Fix the hard coding problem in the software package building process --- build.sh | 2 +- gcc-cross.spec | 20 ++++++++++++------- .../build.sh | 14 ++++++------- .../gcc_arm_linux_release.sh | 4 ++-- .../gcc_update_sourcecode.sh | 0 .../pre_construction.sh | 2 +- .../build.sh | 14 ++++++------- .../gcc_aarch64_linux_release.sh | 4 ++-- .../gcc_update_sourcecode.sh | 0 .../pre_construction.sh | 2 +- 10 files changed, 34 insertions(+), 28 deletions(-) rename {openeuler_gcc_arm32le => gcc_arm32le}/build.sh (41%) rename openeuler_gcc_arm32le/openeuler_gcc_arm_linux_release.sh => gcc_arm32le/gcc_arm_linux_release.sh (99%) rename openeuler_gcc_arm32le/openeuler_gcc_update_sourcecode.sh => gcc_arm32le/gcc_update_sourcecode.sh (100%) rename {openeuler_gcc_arm32le => gcc_arm32le}/pre_construction.sh (87%) rename {openeuler_gcc_arm64le => gcc_arm64le}/build.sh (38%) rename openeuler_gcc_arm64le/openeuler_gcc_aarch64_linux_release.sh => gcc_arm64le/gcc_aarch64_linux_release.sh (99%) rename openeuler_gcc_arm64le/openeuler_gcc_update_sourcecode.sh => gcc_arm64le/gcc_update_sourcecode.sh (100%) rename {openeuler_gcc_arm64le => gcc_arm64le}/pre_construction.sh (87%) diff --git a/build.sh b/build.sh index 6661e15..0881a05 100755 --- a/build.sh +++ b/build.sh @@ -48,7 +48,7 @@ miss_tool_error bison --version miss_tool_error flex --version miss_tool_error makeinfo --version -if [ "$1"x = "openeuler_gcc_arm64le"x ] || [ "$1"x = "openeuler_gcc_arm32le"x ]; then +if [ "$1"x = "gcc_arm64le"x ] || [ "$1"x = "gcc_arm32le"x ]; then cd $1 elif [ "$1"x = "clean"x ] ; then clean diff --git a/gcc-cross.spec b/gcc-cross.spec index 1c6dded..9dd6bd4 100644 --- a/gcc-cross.spec +++ b/gcc-cross.spec @@ -1,7 +1,7 @@ Summary: C/C++ Cross Compiler Toolchain Name: gcc-cross Version: 1.0 -Release: 2 +Release: 3 # libgcc, libgfortran, libmudflap, libgomp, libstdc++ and crtstuff have # GCC Runtime Exception. License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD @@ -28,20 +28,26 @@ if [ "$files" != 0 ]; then ls *.tar | xargs -n1 tar xvf fi bash download.sh -bash build.sh openeuler_gcc_arm64le & -bash build.sh openeuler_gcc_arm32le +bash build.sh gcc_arm64le & +bash build.sh gcc_arm32le wait %install mkdir -p %{buildroot}/tmp -cp %{_builddir}/output/openeuler_gcc_arm64le/openeuler_gcc_arm64le.tar.gz %{buildroot}/tmp -cp %{_builddir}/output/openeuler_gcc_arm32le/openeuler_gcc_arm32le.tar.gz %{buildroot}/tmp +cp %{_builddir}/output/gcc_arm64le/gcc_arm64le.tar.gz %{buildroot}/tmp +cp %{_builddir}/output/gcc_arm32le/gcc_arm32le.tar.gz %{buildroot}/tmp %files -%attr(755, root, root) /tmp/openeuler_gcc_arm64le.tar.gz -%attr(755, root, root) /tmp/openeuler_gcc_arm32le.tar.gz +%attr(755, root, root) /tmp/gcc_arm64le.tar.gz +%attr(755, root, root) /tmp/gcc_arm32le.tar.gz %changelog +* Mon Nov 28 2022 dingguangya - 1.0-3 +-Type:Fix +-ID:NA +-SUG:NA +-DESC: Fix the hard coding problem in the software package building process + * Thu Nov 17 2022 dingguangya - 1.0-2 -Type:Fix -ID:NA diff --git a/openeuler_gcc_arm32le/build.sh b/gcc_arm32le/build.sh similarity index 41% rename from openeuler_gcc_arm32le/build.sh rename to gcc_arm32le/build.sh index 00bdc0e..f3fccdb 100755 --- a/openeuler_gcc_arm32le/build.sh +++ b/gcc_arm32le/build.sh @@ -9,15 +9,15 @@ if [[ -z "$COMPILER_INFO" ]];then source $PWD/../config.xml fi -[ -e "$LOG_PATH/openeuler_gcc_arm32le_patch.log" ] && rm $LOG_PATH/openeuler_gcc_arm32le_patch.log -[ -e "$LOG_PATH/openeuler_gcc_arm32le_build.log" ] && rm $LOG_PATH/openeuler_gcc_arm32le_build.log +[ -e "$LOG_PATH/gcc_arm32le_patch.log" ] && rm $LOG_PATH/gcc_arm32le_patch.log +[ -e "$LOG_PATH/gcc_arm32le_build.log" ] && rm $LOG_PATH/gcc_arm32le_build.log mkdir -p $LOG_PATH -source pre_construction.sh &>> $LOG_PATH/openeuler_gcc_arm32le_patch.log +source pre_construction.sh &>> $LOG_PATH/gcc_arm32le_patch.log echo "------------------------------------------" -echo "Now building the "openeuler_gcc_arm32le" toolchain ..." +echo "Now building the "gcc_arm32le" toolchain ..." echo "The entire build process takes about 45 minutes (build time is related to machine preformance), you can view the detailed build log in the ${LOG_PATH} file" -source openeuler_gcc_update_sourcecode.sh -source openeuler_gcc_arm_linux_release.sh &>> $LOG_PATH/openeuler_gcc_arm32le_build.log -echo "Build openeuler_gcc_arm32le toolchain completed!" +source gcc_update_sourcecode.sh +source gcc_arm_linux_release.sh &>> $LOG_PATH/gcc_arm32le_build.log +echo "Build gcc_arm32le toolchain completed!" diff --git a/openeuler_gcc_arm32le/openeuler_gcc_arm_linux_release.sh b/gcc_arm32le/gcc_arm_linux_release.sh similarity index 99% rename from openeuler_gcc_arm32le/openeuler_gcc_arm_linux_release.sh rename to gcc_arm32le/gcc_arm_linux_release.sh index e357a35..bec4da3 100755 --- a/openeuler_gcc_arm32le/openeuler_gcc_arm_linux_release.sh +++ b/gcc_arm32le/gcc_arm_linux_release.sh @@ -5,7 +5,7 @@ set -e # Target root directory,should be adapted according to your environment readonly ROOT_TAR_DIR="$PWD/arm32le_build_dir" readonly ROOT_TAR_SRC="$PWD/../../open_source" -readonly INSTALL="openeuler_gcc_arm32le" +readonly INSTALL="gcc_arm32le" readonly PREFIX="$PWD/arm32le_build_dir/$INSTALL" readonly OUTPUT="$PWD/../../output/$INSTALL" @@ -15,7 +15,7 @@ readonly SECURE_CXXFLAGS="-O2 -Wall -fstack-protector-strong -D_FORTIFY_SOURCE=2 readonly SECURE_CFLAGS_FOR_TARGET="-O2 -Wall -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -Wno-stringop-overflow -march=armv7-a -mfloat-abi=soft -mfpu=vfp" readonly SECURE_CXXFLAGS_FOR_TARGET="-O2 -Wall -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -Wno-stringop-overflow -march=armv7-a -mfloat-abi=soft -mfpu=vfp" -readonly TARGET="arm-openeuler-linux-gnueabi" +readonly TARGET="arm-linux-gnueabi" readonly HOST="$(gcc -dumpmachine)" readonly BUILD="$(gcc -dumpmachine)" diff --git a/openeuler_gcc_arm32le/openeuler_gcc_update_sourcecode.sh b/gcc_arm32le/gcc_update_sourcecode.sh similarity index 100% rename from openeuler_gcc_arm32le/openeuler_gcc_update_sourcecode.sh rename to gcc_arm32le/gcc_update_sourcecode.sh diff --git a/openeuler_gcc_arm32le/pre_construction.sh b/gcc_arm32le/pre_construction.sh similarity index 87% rename from openeuler_gcc_arm32le/pre_construction.sh rename to gcc_arm32le/pre_construction.sh index c3d534b..919b2c3 100755 --- a/openeuler_gcc_arm32le/pre_construction.sh +++ b/gcc_arm32le/pre_construction.sh @@ -4,7 +4,7 @@ set -e set -x readonly ROOT_BUILD_SRC="$PWD/../../open_source" -readonly OUTPUT_INSTALL="$PWD/../../output/openeuler_gcc_arm32le" +readonly OUTPUT_INSTALL="$PWD/../../output/gcc_arm32le" if [[ -z "$COMPILER_INFO" ]];then source $PWD/../config.xml diff --git a/openeuler_gcc_arm64le/build.sh b/gcc_arm64le/build.sh similarity index 38% rename from openeuler_gcc_arm64le/build.sh rename to gcc_arm64le/build.sh index 07b5673..433ec01 100755 --- a/openeuler_gcc_arm64le/build.sh +++ b/gcc_arm64le/build.sh @@ -7,15 +7,15 @@ readonly LOG_PATH="$PWD/../logs" source $PWD/../config.xml -[ -e "$LOG_PATH/openeuler_gcc_arm64le_patch.log" ] && rm $LOG_PATH/openeuler_gcc_arm64le_patch.log -[ -e "$LOG_PATH/openeuler_gcc_arm64le_build.log" ] && rm $LOG_PATH/openeuler_gcc_arm64le_build.log +[ -e "$LOG_PATH/gcc_arm64le_patch.log" ] && rm $LOG_PATH/gcc_arm64le_patch.log +[ -e "$LOG_PATH/gcc_arm64le_build.log" ] && rm $LOG_PATH/gcc_arm64le_build.log mkdir -p $LOG_PATH -source pre_construction.sh &>> $LOG_PATH/openeuler_gcc_arm64le_patch.log +source pre_construction.sh &>> $LOG_PATH/gcc_arm64le_patch.log echo "------------------------------------------" -echo "Now building the "openeuler_gcc_arm64le" toolchain ..." +echo "Now building the "gcc_arm64le" toolchain ..." echo "The entire build process takes about 45 minutes (build time is related to machine preformance), you can view the detailed build log in the ${LOG_PATH} file" -source openeuler_gcc_update_sourcecode.sh -source openeuler_gcc_aarch64_linux_release.sh &>> $LOG_PATH/openeuler_gcc_arm64le_build.log -echo "Build openeuler_gcc_arm64le toolchain completed!" +source gcc_update_sourcecode.sh +source gcc_aarch64_linux_release.sh &>> $LOG_PATH/gcc_arm64le_build.log +echo "Build gcc_arm64le toolchain completed!" diff --git a/openeuler_gcc_arm64le/openeuler_gcc_aarch64_linux_release.sh b/gcc_arm64le/gcc_aarch64_linux_release.sh similarity index 99% rename from openeuler_gcc_arm64le/openeuler_gcc_aarch64_linux_release.sh rename to gcc_arm64le/gcc_aarch64_linux_release.sh index 9d78fa2..3a0f9e3 100755 --- a/openeuler_gcc_arm64le/openeuler_gcc_aarch64_linux_release.sh +++ b/gcc_arm64le/gcc_aarch64_linux_release.sh @@ -5,7 +5,7 @@ set -e # Target root directory,should be adapted according to your environment readonly ROOT_TAR_DIR="$PWD/arm64le_build_dir" readonly ROOT_TAR_SRC="$PWD/../../open_source" -readonly INSTALL="openeuler_gcc_arm64le" +readonly INSTALL="gcc_arm64le" readonly PREFIX="$PWD/arm64le_build_dir/$INSTALL" readonly OUTPUT="$PWD/../../output/$INSTALL" @@ -22,7 +22,7 @@ readonly SYSROOT="$PREFIX/sysroot" #OTHER CONFIG readonly ARCH="armv8-a" -readonly TARGET="aarch64-openeuler-linux-gnu" +readonly TARGET="aarch64-linux-gnueabi" source $PWD/../config.xml diff --git a/openeuler_gcc_arm64le/openeuler_gcc_update_sourcecode.sh b/gcc_arm64le/gcc_update_sourcecode.sh similarity index 100% rename from openeuler_gcc_arm64le/openeuler_gcc_update_sourcecode.sh rename to gcc_arm64le/gcc_update_sourcecode.sh diff --git a/openeuler_gcc_arm64le/pre_construction.sh b/gcc_arm64le/pre_construction.sh similarity index 87% rename from openeuler_gcc_arm64le/pre_construction.sh rename to gcc_arm64le/pre_construction.sh index a960766..70639d7 100755 --- a/openeuler_gcc_arm64le/pre_construction.sh +++ b/gcc_arm64le/pre_construction.sh @@ -4,7 +4,7 @@ set -e set -x readonly ROOT_BUILD_SRC="$PWD/../../open_source" -readonly OUTPUT_INSTALL="$PWD/../../output/openeuler_gcc_arm64le" +readonly OUTPUT_INSTALL="$PWD/../../output/gcc_arm64le" source $PWD/../config.xml -- Gitee From f94c935160e3672b2b6e6e68323606d28d09a030 Mon Sep 17 00:00:00 2001 From: dingguangya Date: Wed, 1 Feb 2023 15:19:12 +0800 Subject: [PATCH 2/2] [gcc-cross] Fix master branch download --- download.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/download.sh b/download.sh index b492ff4..540f154 100755 --- a/download.sh +++ b/download.sh @@ -35,25 +35,25 @@ function do_patch() { fi popd } -echo "Download $GCC" && git clone -b openEuler-22.03-LTS https://gitee.com/src-openeuler/gcc.git +echo "Download $GCC" && git clone -b master https://gitee.com/src-openeuler/gcc.git do_patch $GCC -echo "Download $GLIBC" && git clone -b openEuler-22.03-LTS https://gitee.com/src-openeuler/glibc.git +echo "Download $GLIBC" && git clone -b master https://gitee.com/src-openeuler/glibc.git do_patch $GLIBC -echo "Download $BINUTILS" && git clone -b openEuler-22.03-LTS https://gitee.com/src-openeuler/binutils.git +echo "Download $BINUTILS" && git clone -b master https://gitee.com/src-openeuler/binutils.git do_patch $BINUTILS -echo "Download $GMP" && git clone -b openEuler-22.03-LTS https://gitee.com/src-openeuler/gmp.git +echo "Download $GMP" && git clone -b master https://gitee.com/src-openeuler/gmp.git do_patch $GMP -echo "Download $MPFR" && git clone -b openEuler-22.03-LTS https://gitee.com/src-openeuler/mpfr.git +echo "Download $MPFR" && git clone -b master https://gitee.com/src-openeuler/mpfr.git do_patch $MPFR -echo "Download $MPC" && git clone -b openEuler-22.03-LTS https://gitee.com/src-openeuler/libmpc.git +echo "Download $MPC" && git clone -b master https://gitee.com/src-openeuler/libmpc.git do_patch $MPC -echo "Download $ISL" && git clone -b openEuler-22.03-LTS https://gitee.com/src-openeuler/isl.git +echo "Download $ISL" && git clone -b master https://gitee.com/src-openeuler/isl.git do_patch $ISL echo "Download $LINUX_KERNEL" && git clone -b 5.10.0-60.16.0 https://gitee.com/openeuler/kernel.git --depth 1 -- Gitee