< prev index next >

.github/workflows/build-cross-compile.yml

Print this page

 44 jobs:
 45   build-cross-compile:
 46     name: build
 47     runs-on: ubuntu-22.04
 48 
 49     strategy:
 50       fail-fast: false
 51       matrix:
 52         target-cpu:
 53           - aarch64
 54           - arm
 55           - s390x
 56           - ppc64le
 57           - riscv64
 58         include:
 59           - target-cpu: aarch64
 60             gnu-arch: aarch64
 61             debian-arch: arm64
 62             debian-repository: https://httpredir.debian.org/debian/
 63             debian-version: bullseye

 64           - target-cpu: arm
 65             gnu-arch: arm
 66             debian-arch: armhf
 67             debian-repository: https://httpredir.debian.org/debian/
 68             debian-version: bullseye

 69             gnu-abi: eabihf
 70           - target-cpu: s390x
 71             gnu-arch: s390x
 72             debian-arch: s390x
 73             debian-repository: https://httpredir.debian.org/debian/
 74             debian-version: bullseye

 75           - target-cpu: ppc64le
 76             gnu-arch: powerpc64le
 77             debian-arch: ppc64el
 78             debian-repository: https://httpredir.debian.org/debian/
 79             debian-version: bullseye

 80           - target-cpu: riscv64
 81             gnu-arch: riscv64
 82             debian-arch: riscv64
 83             debian-repository: https://httpredir.debian.org/debian/
 84             debian-version: sid

 85 
 86     steps:
 87       - name: 'Checkout the JDK source'
 88         uses: actions/checkout@v4
 89 
 90       - name: 'Get the BootJDK'
 91         id: bootjdk
 92         uses: ./.github/actions/get-bootjdk
 93         with:
 94           platform: linux-x64
 95 
 96         # Use linux-x64 JDK bundle as build JDK
 97       - name: 'Get build JDK'
 98         id: buildjdk
 99         uses: ./.github/actions/get-bundles
100         with:
101           platform: linux-x64
102 
103       - name: 'Get GTest'
104         id: gtest
105         uses: ./.github/actions/get-gtest
106 
107         # Upgrading apt to solve libc6 installation bugs, see JDK-8260460.
108       - name: 'Install toolchain and dependencies'
109         run: |
110           # Install dependencies using apt-get
111           sudo apt-get update
112           sudo apt-get install --only-upgrade apt
113           sudo apt-get install \
114               gcc-${{ inputs.gcc-major-version }} \
115               g++-${{ inputs.gcc-major-version }} \
116               gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
117               g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
118               libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
119           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 }}
120 
121       - name: 'Check cache for sysroot'
122         id: get-cached-sysroot
123         uses: actions/cache@v3
124         with:
125           path: sysroot
126           key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('./.github/workflows/build-cross-compile.yml') }}
127 
128       - name: 'Install sysroot dependencies'
129         run: sudo apt-get install debootstrap qemu-user-static
130         if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
131 
132       - name: 'Create sysroot'

133         run: >
134           sudo debootstrap
135           --arch=${{ matrix.debian-arch }}
136           --verbose
137           --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
138           --resolve-deps
139           --variant=minbase
140           ${{ matrix.debian-version }}
141           sysroot
142           ${{ matrix.debian-repository }}

143         if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
144 
145       - name: 'Prepare sysroot'
146         run: |
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.get-cached-sysroot.outputs.cache-hit != 'true'





155 
156       - name: 'Configure'
157         run: >
158           bash configure
159           --with-conf-name=linux-${{ matrix.target-cpu }}
160           --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
161           --with-boot-jdk=${{ steps.bootjdk.outputs.path }}
162           --with-gtest=${{ steps.gtest.outputs.path }}
163           --with-zlib=system
164           --enable-debug
165           --disable-precompiled-headers
166           --openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
167           --with-sysroot=sysroot
168           --with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
169           --with-jmod-compress=zip-1
170           CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
171           CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
172           ${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
173           echo "Dumping config.log:" &&
174           cat config.log &&
175           exit 1)

176 
177       - name: 'Build'
178         id: build
179         uses: ./.github/actions/do-build
180         with:
181           make-target: 'hotspot ${{ inputs.make-arguments }}'
182           platform: linux-${{ matrix.target-cpu }}


 44 jobs:
 45   build-cross-compile:
 46     name: build
 47     runs-on: ubuntu-22.04
 48 
 49     strategy:
 50       fail-fast: false
 51       matrix:
 52         target-cpu:
 53           - aarch64
 54           - arm
 55           - s390x
 56           - ppc64le
 57           - riscv64
 58         include:
 59           - target-cpu: aarch64
 60             gnu-arch: aarch64
 61             debian-arch: arm64
 62             debian-repository: https://httpredir.debian.org/debian/
 63             debian-version: bullseye
 64             tolerate-sysroot-errors: false
 65           - target-cpu: arm
 66             gnu-arch: arm
 67             debian-arch: armhf
 68             debian-repository: https://httpredir.debian.org/debian/
 69             debian-version: bullseye
 70             tolerate-sysroot-errors: false
 71             gnu-abi: eabihf
 72           - target-cpu: s390x
 73             gnu-arch: s390x
 74             debian-arch: s390x
 75             debian-repository: https://httpredir.debian.org/debian/
 76             debian-version: bullseye
 77             tolerate-sysroot-errors: false
 78           - target-cpu: ppc64le
 79             gnu-arch: powerpc64le
 80             debian-arch: ppc64el
 81             debian-repository: https://httpredir.debian.org/debian/
 82             debian-version: bullseye
 83             tolerate-sysroot-errors: false
 84           - target-cpu: riscv64
 85             gnu-arch: riscv64
 86             debian-arch: riscv64
 87             debian-repository: https://httpredir.debian.org/debian/
 88             debian-version: sid
 89             tolerate-sysroot-errors: true
 90 
 91     steps:
 92       - name: 'Checkout the JDK source'
 93         uses: actions/checkout@v4
 94 
 95       - name: 'Get the BootJDK'
 96         id: bootjdk
 97         uses: ./.github/actions/get-bootjdk
 98         with:
 99           platform: linux-x64
100 







101       - name: 'Get GTest'
102         id: gtest
103         uses: ./.github/actions/get-gtest
104 
105         # Upgrading apt to solve libc6 installation bugs, see JDK-8260460.
106       - name: 'Install toolchain and dependencies'
107         run: |
108           # Install dependencies using apt-get
109           sudo apt-get update
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 }}
118 
119       - name: 'Check cache for sysroot'
120         id: get-cached-sysroot
121         uses: actions/cache@v4
122         with:
123           path: sysroot
124           key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('./.github/workflows/build-cross-compile.yml') }}
125 
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'
129 
130       - name: 'Create sysroot'
131         id: create-sysroot
132         run: >
133           sudo debootstrap
134           --arch=${{ matrix.debian-arch }}
135           --verbose
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
137           --resolve-deps
138           --variant=minbase
139           ${{ matrix.debian-version }}
140           sysroot
141           ${{ matrix.debian-repository }}
142         continue-on-error: ${{ matrix.tolerate-sysroot-errors }}
143         if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
144 
145       - name: 'Prepare sysroot'
146         run: |
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'
155 
156       - name: 'Remove broken sysroot'
157         run: |
158           sudo rm -rf sysroot/
159         if: steps.create-sysroot.outcome != 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
160 
161       - name: 'Configure'
162         run: >
163           bash configure
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 }}
168           --with-zlib=system
169           --enable-debug
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:" &&
178           cat config.log &&
179           exit 1)
180         if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
181 
182       - name: 'Build'
183         id: build
184         uses: ./.github/actions/do-build
185         with:
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'
< prev index next >