3 SRC_DIR
="${SRC_DIR:-/src/gcc-releases-gcc-4.8.5}"
4 PATCH_DIR
="${PATCH_DIR:-/src/patches}"
5 TARGET
="${TARGET:-aarch64-linux-gnu}"
6 HOST
="${HOST:-x86_64-linux-gnu}"
7 CONFIGURE_ARGS
=(${CONFIGURE_ARGS:-})
8 MAKE_ARGS
=(${MAKE_ARGS:-})
9 MAKE_INSTALL_ARGS
=(${MAKE_INSTALL_ARGS:-})
13 cd "${SRC_DIR}" ||
exit 1
14 while read -r line
; do
15 EXT
=$
(echo "$line" |
rev | cut
-d.
-f1 |
rev)
17 if [[ "${EXT}" =~
[0-9]+ ]] ; then
20 patch -p"${PATCH_LEVEL}" < "${line}"
21 done < <(find "${PATCH_DIR}" -type f
)
26 CXXFLAGS
=(-std=gnu
++98)
27 # apt-get install -y gcc-"${TARGET}"
31 --enable-fix-cortex-a64-84319
48 powerpc64le-linux-gnu
)
49 # Disable multilib so that ppc64el kernel can be built, since
50 # legacy Makefiles compile vdso in 32bits unconditionally.
51 # @see https://bugzilla.redhat.com/show_bug.cgi?id=1237363
52 # @see https://bugzilla.redhat.com/show_bug.cgi?id=1205236
53 # @see https://bugs.launchpad.net/ubuntu/trusty/+source/linux/+bug/1433809/
56 --enable-targets=powerpcle-linux
58 --with-long-double-128
65 --enable-targets=powerpc-linux
,powerpc64-linux
67 --with-long-double-128
71 echo "Not supported in gcc-4.8"
77 --with-long-double-128
81 echo "Unrecognized target: ${TARGET}"
87 "${SRC_DIR}/configure" --build="${HOST}" --host="${HOST}" --enable-languages=c
,c
++ \
88 --program-prefix="${TARGET}-" --target="${TARGET}" --program-suffix=-4.8 \
89 --prefix=/usr
/ --with-system-zlib \
90 --libexecdir=/usr
/lib
/ --libdir=/usr
/lib
/ \
91 --disable-nls --disable-shared --enable-host-shared \
92 --disable-bootstrap --enable-threads=posix
--enable-default-pie \
93 --with-sysroot=/ --includedir=/usr
/"${TARGET}"/include \
94 --without-target-system-zlib --enable-multiarch \
95 "${TARGET_ARGS[@]}" "${CONFIGURE_ARGS[@]}" \
96 CFLAGS
="${CFLAGS[*]}" CXXFLAGS
="${CXXFLAGS[*]}"
98 NPROC
="${NPROC:=$(nproc)}"
99 make -j"${NPROC}" "${MAKE_ARGS[@]}" CFLAGS="${CFLAGS[*]}" CXXFLAGS="${CXXFLAGS[*]}"
100 # Do not use -jN with make install, it often breaks.
101 make install "${MAKE_INSTALL_ARGS[@]}"
103 mkdir
-p "/output/usr/lib/gcc-cross/${TARGET}" /output
/usr
/bin
/
105 if [ -n "${DEBUG}" ] ; then
106 echo $
(($
(date +%s
) - START
)) > "/output/${TARGET}.time"
109 cp -r /usr
/lib
/gcc-cross
/"${TARGET}"/4* "/output/usr/lib/gcc-cross/${TARGET}/"
110 cp /usr
/bin
/*-4.8
/output
/usr
/bin
/
This page took 0.031857 seconds and 4 git commands to generate.