26
name: 'Build (cross-compile)'
62
debian-repository: https://httpredir.debian.org/debian/
63
debian-version: bullseye
64
tolerate-sysroot-errors: false
68
debian-repository: https://httpredir.debian.org/debian/
69
debian-version: bullseye
70
tolerate-sysroot-errors: false
75
debian-repository: https://httpredir.debian.org/debian/
76
debian-version: bullseye
77
tolerate-sysroot-errors: false
81
debian-repository: https://httpredir.debian.org/debian/
82
debian-version: bullseye
83
tolerate-sysroot-errors: false
87
debian-repository: https://httpredir.debian.org/debian/
89
tolerate-sysroot-errors: true
92
- name: 'Checkout the JDK source'
93
uses: actions/checkout@v4
95
- name: 'Get the BootJDK'
97
uses: ./.github/actions/get-bootjdk
103
uses: ./.github/actions/get-gtest
106
- name: 'Install toolchain and dependencies'
108
# Install dependencies using apt-get
110
sudo apt-get install --only-upgrade apt
111
sudo apt-get install \
112
gcc-${{ inputs.gcc-major-version }} \
113
g++-${{ inputs.gcc-major-version }} \
114
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
115
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
116
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
117
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
119
- name: 'Check cache for sysroot'
120
id: get-cached-sysroot
121
uses: actions/cache@v4
124
key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('./.github/workflows/build-cross-compile.yml') }}
126
- name: 'Install sysroot dependencies'
127
run: sudo apt-get install debootstrap qemu-user-static
128
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
130
- name: 'Create sysroot'
134
--arch=${{ matrix.debian-arch }}
136
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
139
${{ matrix.debian-version }}
141
${{ matrix.debian-repository }}
142
continue-on-error: ${{ matrix.tolerate-sysroot-errors }}
143
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
145
- name: 'Prepare sysroot'
147
# Prepare sysroot and remove unused files to minimize cache
148
sudo chroot sysroot symlinks -cr .
149
sudo chown ${USER} -R sysroot
150
rm -rf sysroot/{dev,proc,run,sys,var}
151
rm -rf sysroot/usr/{sbin,bin,share}
152
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
153
rm -rf sysroot/usr/libexec/gcc
154
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
156
- name: 'Remove broken sysroot'
159
if: steps.create-sysroot.outcome != 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
164
--with-conf-name=linux-${{ matrix.target-cpu }}
165
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
166
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
167
--with-gtest=${{ steps.gtest.outputs.path }}
170
--disable-precompiled-headers
171
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
172
--with-sysroot=sysroot
173
--with-jmod-compress=zip-1
174
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
175
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
176
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
177
echo "Dumping config.log:" &&
180
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
184
uses: ./.github/actions/do-build
186
make-target: 'hotspot ${{ inputs.make-arguments }}'
187
platform: linux-${{ matrix.target-cpu }}
188
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'