-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change installs GCC 10.4.0 on the following build images: - deb-arm - deb-x64 - rpm-arm64 - rpm-x64 - suse-x64 We chose to provide our own GCC version, because the GCC versions available as part of CentOS 6, openSUSE 42.1 and Ubuntu 14.04 weren't recent enough to build OpenSCAP and some of its dependencies. We chose GCC 10.4.0, because it was the most recent version that could be built using the GCC versions available on our distributions. GCC 11 and upper include libcody, which is written in C++11 and requires a more recent GCC version to be built. This change is the result of a collaborative work between Sylvain Baubeau, Pierre Guilleminot and David du Colombier. Co-authored-by: Sylvain Baubeau <[email protected]> Co-authored-by: Pierre Guilleminot <[email protected]>
- Loading branch information
1 parent
8c1c831
commit 7429a6a
Showing
6 changed files
with
90 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ -z "$GCC_VERSION" ] || [ -z "$GCC_SHA256" ]; then | ||
echo "The GCC_VERSION and GCC_SHA256 environment variables should be defined to run this script" >&2 | ||
exit 1 | ||
fi | ||
|
||
PREFIX=/opt/gcc-${GCC_VERSION} | ||
|
||
compile_with_autoconf() { | ||
LIB=lib | ||
if [[ "$DD_TARGET_ARCH" == *64* ]]; then | ||
LIB=lib64 | ||
fi | ||
[ -e /etc/redhat-release ] && configure_args="--libdir=$PREFIX/$LIB" || true | ||
./configure --prefix=$PREFIX $configure_args $* | ||
cpu_count=$(grep process /proc/cpuinfo | wc -l) | ||
make -j $cpu_count --silent | ||
make install | ||
} | ||
|
||
url="https://mirrors.kernel.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz" | ||
archive=$(basename $url) | ||
[ ! -e "$archive" ] && curl -LO $url || true | ||
echo "${GCC_SHA256} ${archive}" | sha256sum --check | ||
|
||
tar xzf $(basename $url) | ||
cd "gcc-${GCC_VERSION}" | ||
|
||
contrib/download_prerequisites | ||
|
||
compile_with_autoconf \ | ||
--disable-nls \ | ||
--enable-languages=c,c++ \ | ||
--disable-multilib | ||
|
||
cd - | ||
|
||
rm -rf "gcc-${GCC_VERSION}" "gcc-${GCC_VERSION}.tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters