File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,12 +59,18 @@ BUILD_PATH=${BUILD_PATH:-$ROOT_PATH/build-$TOOLCHAIN_NAME}
5959CCACHE_DIR_PATH=${CCACHE_DIR_PATH:- $ROOT_PATH / ccache}
6060ARTIFACT_PATH=${ARTIFACT_PATH:- $ROOT_PATH / artifact}
6161BUILD_MAKE_OPTIONS=${BUILD_MAKE_OPTIONS:- V=1 -j$(nproc)}
62+ CHECK_MAKE_OPTIONS=${CHECK_MAKE_OPTIONS:- V=1 -j$(nproc)}
6263TOOLCHAIN_PATH=${TOOLCHAIN_PATH:- ~/ cross-$TOOLCHAIN_NAME }
6364TOOLCHAIN_FILE=${TOOLCHAIN_FILE:- $ROOT_PATH / .github/ cmake/ $TARGET .cmake}
6465TOOLCHAIN_PACKAGE_NAME=${TOOLCHAIN_PACKAGE_NAME:- $TOOLCHAIN_NAME -toolchain.tar.gz}
6566RUNTIME_PACKAGE_NAME=${RUNTIME_PACKAGE_NAME:- $TOOLCHAIN_NAME -runtime.tar.gz}
6667DEJAGNU_FILE=${DEJAGNU_FILE:- $ROOT_PATH / .github/ scripts/ toolchain/ site.exp}
6768
69+ GMP_REPO=${GMP_REPO:- https:// gmplib.org/ download/ gmp/ gmp-6.3.0.tar.bz2}
70+ GMP_BRANCH=${GMP_BRANCH:- }
71+ GMP_PATH=${GMP_PATH:- ~/ gmp-$TARGET }
72+ GMP_TESTS_PATH=${GMP_TESTS_PATH:- ~/ gmp-tests-$TARGET }
73+
6874OPENBLAS_REPO=${OPENBLAS_REPO:- OpenMathLib/ OpenBLAS}
6975OPENBLAS_BRANCH=${OPENBLAS_BRANCH:- develop}
7076
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ source ` dirname ${BASH_SOURCE[0]} ` /../config.sh
4+
5+ SHARED=${1:- 1}
6+
7+ GMP_SOURCE_PATH=$SOURCE_PATH /gmp
8+ GMP_BUILD_PATH=$BUILD_PATH /gmp
9+
10+ mkdir -p $GMP_BUILD_PATH
11+
12+ if [[ " $RUN_CONFIG " = 1 ]] || [[ ! -f " $GMP_BUILD_PATH /Makefile" ]]; then
13+ if [[ " $DEBUG " = 1 ]]; then
14+ CFLAGS=" $CFLAGS -O0 -ggdb"
15+ else
16+ CFLAGS=" $CFLAGS -O2"
17+ fi
18+
19+ if [[ " $SHARED " = 1 ]]; then
20+ TARGET_OPTIONS=" $TARGET_OPTIONS \
21+ --enable-shared \
22+ --disable-static"
23+ else
24+ TARGET_OPTIONS=" $TARGET_OPTIONS \
25+ --disable-shared \
26+ --enable-static"
27+ fi
28+
29+ # ADDED: -std=gnu11
30+ CC=" $TARGET -gcc"
31+ CXX=" $TARGET -g++"
32+ CFLAGS=" $CFLAGS \
33+ -march=armv8-a \
34+ -mtune=generic \
35+ -pipe \
36+ -fstack-protector-strong \
37+ -Wp,-D_FORTIFY_SOURCE=2 \
38+ -Wp,-D__USE_MINGW_ANSI_STDIO=1 \
39+ -Wno-attributes \
40+ -Wno-ignored-attributes \
41+ -std=gnu11"
42+
43+ echo " ::group::Configure gmp"
44+ pushd $GMP_SOURCE_PATH
45+ autoreconf -fiv
46+ popd
47+
48+ rm -rf $GMP_BUILD_PATH /*
49+ pushd $GMP_BUILD_PATH
50+ $GMP_SOURCE_PATH /configure \
51+ --prefix=$GMP_PATH \
52+ --build=$BUILD \
53+ --host=$TARGET \
54+ --enable-cxx \
55+ --disable-assembly \
56+ $TARGET_OPTIONS \
57+ CC=" $CC " \
58+ CXX=" $CXX " \
59+ CFLAGS=" $CFLAGS "
60+ popd
61+ echo " ::endgroup::"
62+ fi
63+
64+ echo " ::group::Build gmp"
65+ pushd $GMP_BUILD_PATH
66+ make $BUILD_MAKE_OPTIONS
67+ popd
68+ echo " ::endgroup::"
69+
70+ if [[ " $RUN_INSTALL " = 1 ]]; then
71+ echo " ::group::Install gmp"
72+ pushd $GMP_BUILD_PATH
73+ make install
74+ popd
75+ echo " ::endgroup::"
76+ fi
77+
78+ echo ' Success!'
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ source ` dirname ${BASH_SOURCE[0]} ` /../config.sh
4+
5+ GMP_SOURCE_PATH=$SOURCE_PATH /gmp
6+ GMP_BUILD_PATH=$BUILD_PATH /gmp
7+
8+ echo " ::group::Test gmp"
9+ pushd $GMP_BUILD_PATH
10+ make $CHECK_MAKE_OPTIONS check
11+ popd
12+ echo " ::endgroup::"
13+
14+ echo " Success!"
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ if [[ "$RUN_CONFIG" = 1 ]] || [[ ! -f "$MINGW_BUILD_PATH/Makefile" ]]; then
1414 if [[ " $DEBUG " = 1 ]]; then
1515 CFLAGS=" $CFLAGS -O0 -ggdb"
1616 CXXFLAGS=" $CXXFLAGS -O0 -ggdb"
17+ else
18+ CFLAGS=" $CFLAGS -O2"
19+ CXXFLAGS=" $CXXFLAGS -O2"
1720 fi
1821
1922 case " $ARCH " in
@@ -64,7 +67,8 @@ if [[ "$RUN_CONFIG" = 1 ]] || [[ ! -f "$MINGW_BUILD_PATH/Makefile" ]]; then
6467 --enable-shared \
6568 $HOST_OPTIONS \
6669 $TARGET_OPTIONS \
67- CFLAGS=" $CFLAGS "
70+ CFLAGS=" $CFLAGS " \
71+ CXXFLAGS=" $CXXFLAGS "
6872 echo " ::endgroup::"
6973fi
7074
Original file line number Diff line number Diff line change @@ -9,6 +9,19 @@ function update_repository() {
99 BRANCH=$3
1010 BASE_BRANCH=$4
1111
12+ if [[ $REPOSITORY =~ (\. tar\. gz| \. tar\. bz2| \. tar| \. tar\. lz| \. tar\. xz| \. tar\. zst)$ ]]; then
13+ FILE=$( basename $REPOSITORY )
14+ wget $REPOSITORY -O $FILE
15+
16+ mkdir -p $DIRECTORY
17+ rm -rf $DIRECTORY /*
18+ tar -xf $FILE -C $DIRECTORY --strip-components=1
19+
20+ rm -f $FILE
21+
22+ return 0
23+ fi
24+
1225 if [[ ! $REPOSITORY =~ ^(http://| https://| git://) ]]; then
1326 REPOSITORY=" https://github.com/$REPOSITORY .git"
1427 fi
@@ -84,6 +97,8 @@ echo "::group::Update source code repositories"
8497 fi
8598
8699 if [[ " $UPDATE_LIBRARIES " = 1 ]]; then
100+ update_repository gmp $GMP_REPO $GMP_BRANCH
101+ update_repository mpfr $MPFR_REPO $MPFR_BRANCH
87102 update_repository openblas $OPENBLAS_REPO $OPENBLAS_BRANCH
88103 update_repository zlib $ZLIB_REPO $ZLIB_BRANCH
89104 update_repository libxml2 $LIBXML2_REPO $LIBXML2_BRANCH
You can’t perform that action at this time.
0 commit comments