Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new(pkg,docker): added an amazonlinux2 gcc10 builder. #346

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docker/builders/builder-amazonlinux2-x86_64_gcc10.0.0.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM amazonlinux:2.0.20240529.0

LABEL maintainer="[email protected]"

RUN yum -y install gcc10 \
clang \
llvm \
bash-completion \
bc \
ca-certificates \
curl \
gnupg2 \
libc6-dev \
elfutils-libelf-devel \
xz \
cpio \
flex \
bison \
openssl \
openssl-devel \
wget \
binutils \
which \
make \
cmake3 \
tar \
zstd \
git

# Properly create soft links
RUN ln -s /usr/bin/gcc10-cc /usr/bin/gcc-10.0.0
RUN ln -s /usr/bin/cmake3 /usr/bin/cmake
9 changes: 9 additions & 0 deletions pkg/driverbuilder/builder/amazonlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"database/sql"
_ "embed"
"fmt"
"github.com/blang/semver"
"io"
"io/ioutil"
"log"
Expand Down Expand Up @@ -179,6 +180,14 @@ func (a *amazonlinux2) URLs(kr kernelrelease.KernelRelease) ([]string, error) {
return fetchAmazonLinuxPackagesURLs(a, kr)
}

func (a *amazonlinux2) GCCVersion(kr kernelrelease.KernelRelease) semver.Version {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implement GCCVersionRequestor interface to override gcc used for 5.10 kernels (enforcing gcc-10).

// 5.10 amazonlinux2 kernels need gcc 10
if kr.Major == 5 && kr.Minor == 10 {
return semver.Version{Major: 10}
}
return semver.Version{}
}

func (a *amazonlinux2) repos() []string {
return []string{
"core/2.0",
Expand Down
Loading