Skip to content

Commit dfd20ac

Browse files
committed
build(core) migrate Linux CI to newer GCC versions
- x86_64 binaries are now built on AlmaLinux 8 (GLIBC 2.28) with GCC 15 - Other architectures are still on Ubuntu 22.04 (GLIBC 2.35) with GCC 12 This was a forced moved because projects like OpenAL Soft and bgfx make use of C++20 features and GCC 11 started showing its age. However, there should not be any problems with GLIBC incompatibilities, 2.28 is a good baseline for active LTS versions of most popular distros.
1 parent faa4500 commit dfd20ac

6 files changed

Lines changed: 80 additions & 35 deletions

File tree

.github/workflows/build.yml

Lines changed: 52 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
2626
with:
2727
fetch-depth: 3
2828
- name: Download JDK
@@ -45,7 +45,9 @@ jobs:
4545
linux:
4646
name: Linux
4747
needs: cache-kotlinc
48-
runs-on: ubuntu-22.04
48+
runs-on: ubuntu-latest
49+
container:
50+
image: almalinux:8
4951
strategy:
5052
fail-fast: false
5153
matrix:
@@ -56,21 +58,30 @@ jobs:
5658
run:
5759
shell: bash
5860
steps:
59-
- name: Checkout repository
60-
uses: actions/checkout@v4
61-
with:
62-
fetch-depth: 3
63-
- name: Install dependencies # make is necessary for -flto=auto
61+
- name: Install git
62+
run: dnf -y install git
63+
- name: Clone repository
64+
run: git clone --depth 3 https://github.com/${{ github.repository }}.git .
65+
- name: Install build dependencies # make is necessary for -flto=auto
6466
run: |
65-
git config --global --add safe.directory $(pwd)
66-
DEBIAN_FRONTEND=noninteractive sudo apt-get -yq update
67-
DEBIAN_FRONTEND=noninteractive sudo apt-get -yq install ant awscli curl zstd gcc g++ make
67+
dnf -y install epel-release wget
68+
wget https://pkgs.sysadmins.ws/el8/base/x86_64/raven-release-1.0.1-1.el8.noarch.rpm
69+
rpm -ivh raven-release-1.0.1-1.el8.noarch.rpm
70+
dnf config-manager --set-enabled powertools
71+
dnf config-manager --set-enabled raven-extras
72+
dnf -y update
73+
dnf -y install gcc-toolset-15-gcc gcc-toolset-15-gcc-c++ ant awscli curl zstd make
6874
mkdir jdk8
6975
mkdir jdk25
7076
curl -L https://cdn.azul.com/zulu/bin/zulu8.${ZULU_BUILD}-linux_x64.tar.gz | tar xz -C jdk8 --strip-components 1
7177
curl -L https://cdn.azul.com/zulu/bin/zulu25.${ZULU_BUILD25}-linux_x64.tar.gz | tar xz -C jdk25 --strip-components 1
7278
- name: Install LWJGL dependencies
73-
run: DEBIAN_FRONTEND=noninteractive sudo apt-get -yq -f --allow-unauthenticated install libgtk-3-dev libatk-bridge2.0-dev libgdk-pixbuf2.0-dev libglu-dev libgl1-mesa-glx libx11-dev libxt-dev libdbus-1-dev -o Dpkg::Options::="--force-overwrite"
79+
run: |
80+
dnf -y install \
81+
libX11-devel \
82+
libXt-devel \
83+
gtk3-devel \
84+
dbus-devel
7485
- name: Restore kotlinc output
7586
uses: actions/cache/restore@v3
7687
with:
@@ -85,21 +96,26 @@ jobs:
8596
- name: Build Java
8697
run: ant -emacs compile
8798
- name: Build native
88-
run: ant -emacs compile-native
99+
run: |
100+
source /opt/rh/gcc-toolset-15/enable || true
101+
ant -emacs compile-native -Dgcc.version.print=true
89102
- name: Run tests
90103
run: ant -emacs tests
91104
- name: Print test results
92105
run: cat bin/test/testng-results.xml
93106
if: failure()
94107
- name: Run tests (JDK 25)
95-
run: JAVA_HOME=jdk25 ant -emacs tests -Dcore.java25=true
108+
run: |
109+
source /opt/rh/gcc-toolset-15/enable || true
110+
JAVA_HOME=jdk25 ant -emacs tests -Dcore.java25=true
96111
- name: Print test results
97112
run: cat bin/test/testng-results.xml
98113
if: failure()
99114
- name: Run demo with OpenJDK
100115
run: ant demo -Dclass=org.lwjgl.demo.util.lz4.HelloLZ4
101116
- name: Build GraalVM Native Image
102117
run: |
118+
source /opt/rh/gcc-toolset-15/enable || true
103119
mkdir jdk-graalvm
104120
curl -L https://download.oracle.com/graalvm/25/latest/graalvm-jdk-25_linux-x64_bin.tar.gz | tar xz -C jdk-graalvm --strip-components 1
105121
jdk-graalvm/bin/native-image -cp \
@@ -148,14 +164,17 @@ jobs:
148164
shell: bash
149165
steps:
150166
- name: Checkout repository
151-
uses: actions/checkout@v4
167+
uses: actions/checkout@v6
152168
with:
153169
fetch-depth: 3
154170
- name: Install dependencies # make is necessary for -flto=auto
155171
run: |
156172
git config --global --add safe.directory $(pwd)
157173
DEBIAN_FRONTEND=noninteractive sudo apt-get -yq update
158-
DEBIAN_FRONTEND=noninteractive sudo apt-get -yq install ant awscli curl zstd gcc-${{matrix.TRIPLET}} g++-${{matrix.TRIPLET}} libc6-dev-${{matrix.CROSS_ARCH}}-cross make
174+
DEBIAN_FRONTEND=noninteractive sudo apt-get -yq install ant awscli curl zstd make \
175+
gcc-12-${{matrix.TRIPLET}} \
176+
g++-12-${{matrix.TRIPLET}} \
177+
libc6-dev-${{matrix.CROSS_ARCH}}-cross
159178
mkdir jdk8
160179
curl -L https://cdn.azul.com/zulu/bin/zulu8.${ZULU_BUILD}-linux_x64.tar.gz | tar xz -C jdk8 --strip-components 1
161180
- name: Prepare cross-compilation for ${{matrix.CROSS_ARCH}}
@@ -166,7 +185,16 @@ jobs:
166185
sudo dpkg --add-architecture ${{matrix.CROSS_ARCH}}
167186
sudo apt-get update || true
168187
- name: Install cross-compilation dependencies
169-
run: DEBIAN_FRONTEND=noninteractive sudo apt-get -yq -f --allow-unauthenticated install libgtk-3-dev:${{matrix.CROSS_ARCH}} libatk-bridge2.0-dev:${{matrix.CROSS_ARCH}} libgdk-pixbuf2.0-dev:${{matrix.CROSS_ARCH}} libglu-dev:${{matrix.CROSS_ARCH}} libgl1-mesa-glx:${{matrix.CROSS_ARCH}} libx11-dev:${{matrix.CROSS_ARCH}} libxt-dev:${{matrix.CROSS_ARCH}} libdbus-1-dev:${{matrix.CROSS_ARCH}} -o Dpkg::Options::="--force-overwrite"
188+
run: |
189+
DEBIAN_FRONTEND=noninteractive sudo apt-get -yq install \
190+
libgtk-3-dev:${{matrix.CROSS_ARCH}} \
191+
libatk-bridge2.0-dev:${{matrix.CROSS_ARCH}} \
192+
libgdk-pixbuf2.0-dev:${{matrix.CROSS_ARCH}} \
193+
libglu-dev:${{matrix.CROSS_ARCH}} \
194+
libgl1-mesa-glx:${{matrix.CROSS_ARCH}} \
195+
libx11-dev:${{matrix.CROSS_ARCH}} \
196+
libxt-dev:${{matrix.CROSS_ARCH}} \
197+
libdbus-1-dev:${{matrix.CROSS_ARCH}}
170198
- name: Restore kotlinc output
171199
uses: actions/cache/restore@v3
172200
with:
@@ -181,7 +209,7 @@ jobs:
181209
- name: Build Java
182210
run: ant -emacs compile
183211
- name: Build native
184-
run: ant -emacs compile-native -Dgcc.libpath.opengl=/usr/lib/${{matrix.TRIPLET}}/mesa
212+
run: ant -emacs compile-native -Dgcc.version=12 -Dgcc.version.print=true -Dgcc.libpath.opengl=/usr/lib/${{matrix.TRIPLET}}/mesa
185213

186214
freebsd-cross:
187215
name: FreeBSD Cross
@@ -192,7 +220,7 @@ jobs:
192220
fail-fast: false
193221
steps:
194222
- name: Checkout repository
195-
uses: actions/checkout@v4
223+
uses: actions/checkout@v6
196224
with:
197225
fetch-depth: 3
198226
fetch-tags: true
@@ -214,7 +242,7 @@ jobs:
214242
- name: Build Java
215243
run: ant -emacs compile
216244
- name: Build & Test
217-
uses: cross-platform-actions/action@v0.30.0
245+
uses: cross-platform-actions/action@v0.32.0
218246
with:
219247
operating_system: freebsd
220248
architecture: x86-64
@@ -224,7 +252,7 @@ jobs:
224252
environment_variables: ANT_OPTS LWJGL_BUILD_TYPE
225253
run: |
226254
sudo pkg install -y openjdk8 apache-ant git gtk3 dbus
227-
ant -emacs compile-native
255+
ant -emacs compile-native -Dclang.version.print=true
228256
ant -emacs tests || (cat bin/test/testng-results.xml ; exit 1)
229257
ant demo -Dclass=org.lwjgl.demo.util.lz4.HelloLZ4
230258
@@ -245,7 +273,7 @@ jobs:
245273
LWJGL_BUILD_ARCH: ${{matrix.ARCH}}
246274
steps:
247275
- name: Checkout repository
248-
uses: actions/checkout@v4
276+
uses: actions/checkout@v6
249277
with:
250278
fetch-depth: 3
251279
- name: Install dependencies
@@ -268,7 +296,7 @@ jobs:
268296
- name: Build Java
269297
run: ant -emacs compile
270298
- name: Build native
271-
run: ant -emacs compile-native
299+
run: ant -emacs compile-native -Dclang.version.print=true
272300
- name: Run tests
273301
run: ant -emacs tests
274302
- name: Print test results
@@ -319,7 +347,7 @@ jobs:
319347
shell: cmd
320348
steps:
321349
- name: Checkout repository
322-
uses: actions/checkout@v4
350+
uses: actions/checkout@v6
323351
with:
324352
fetch-depth: 3
325353
- name: Configure MSVC
@@ -363,7 +391,7 @@ jobs:
363391
run: |
364392
set LWJGL_BUILD_ARCH=${{matrix.ARCH}}
365393
set PATH=%PATH:C:\Program Files\LLVM\bin;=%
366-
ant -emacs compile-native
394+
ant -emacs compile-native -Dcl.version.print=true
367395
- name: Run tests
368396
run: ant -emacs tests
369397
if: contains(matrix.ARCH, 'arm') != true

config/freebsd/build.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,10 @@
132132
</macrodef>
133133

134134
<target name="compile-native-platform">
135-
<local name="clang.version.string"/>
136-
<exec executable="sh" outputproperty="clang.version.string" logError="true" failonerror="true">
135+
<exec executable="sh" logError="true" failonerror="false" taskname="Compiler" if:set="clang.version.print">
137136
<arg line="-o pipefail -c"/>
138137
<arg value='clang --version | grep "clang version"'/>
139138
</exec>
140-
<echo message="${clang.version.string}" taskname="Compiler"/>
141139

142140
<parallel threadsPerProcessor="2">
143141

config/linux/build.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,13 @@
158158
</macrodef>
159159

160160
<target name="compile-native-platform">
161-
<local name="gcc.version.string"/>
162-
<exec executable="bash" outputproperty="gcc.version.string" logError="true" failonerror="true">
163-
<arg line="-o pipefail -c"/>
164-
<arg value="${gcc.prefix}gcc${gcc.suffix} --version | grep ^.*gcc"/>
165-
</exec>
166-
<echo message='${gcc.prefix}gcc${gcc.suffix} --version: "${gcc.version.string}"' taskname="Compiler"/>
161+
<sequential if:set="gcc.version.print">
162+
<echo message="GCC executable: ${gcc.prefix}gcc${gcc.suffix}"/>
163+
<exec executable="bash" logError="true" failonerror="false" taskname="Compiler">
164+
<arg line="-o pipefail -c"/>
165+
<arg value="${gcc.prefix}gcc${gcc.suffix} --version | grep ^.*gcc"/>
166+
</exec>
167+
</sequential>
167168

168169
<parallel threadsPerProcessor="2">
169170

config/macos/build.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,13 @@
138138
</macrodef>
139139

140140
<target name="compile-native-platform">
141-
<echo message="${sdkroot}" taskname="SDK Root"/>
141+
<sequential if:set="clang.version.print">
142+
<echo message="${sdkroot}" taskname="SDK Root"/>
143+
<exec executable="sh" logError="true" failonerror="false" taskname="Compiler">
144+
<arg line="-o pipefail -c"/>
145+
<arg value='clang --version | grep "clang version"'/>
146+
</exec>
147+
</sequential>
142148

143149
<parallel threadsPerProcessor="2">
144150

config/windows/build.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ EXPORTS
158158

159159
<target name="compile-native-platform">
160160
<mkdir dir="${bin.native}/build"/>
161+
<sequential if:set="cl.version.print">
162+
<exec executable="cmd" logError="true" failonerror="false">
163+
<arg line="/c cl.exe 2>&amp;1 | findstr Version"/>
164+
</exec>
165+
<exec executable="cmd" logError="true" failonerror="false" >
166+
<arg line='/c clang --version | findstr "clang version"'/>
167+
</exec>
168+
</sequential>
161169

162170
<parallel threadsPerProcessor="1">
163171

doc/notes/3.4.0.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This build includes the following changes:
2525
* Added optional `advance` parameter to `msdf_ft_font_load_glyph*`.
2626
* Replaced `msdf_shape_has_inverse_y_axis` with `msdf_shape_set/get_y_axis_orientation`.
2727
- Nuklear: Updated to 4.13.0 (up from 4.12.3)
28-
- OpenAL Soft: Updated to 1.24.3 (up from 1.24.1)
28+
- OpenAL Soft: Updated to 1.25.0 (up from 1.24.1)
2929
* Added `AL_SOFT_bformat_hoa` extension.
3030
- OpenGL (ES): Added latest extensions.
3131
* `EXT_fragment_shading_rate`
@@ -81,6 +81,10 @@ LWJGL no longer includes the following bindings:
8181
* Buffer to array
8282
* Corresponding unsafe overloads
8383
- FreeBSD: LWJGL now requires FreeBSD 13.5 or later. (up from 13.3)
84+
- Linux: x86_64 shared libraries are now built with GCC 15.1 (up from GCC 11.2)
85+
* The minimum GLIBC version is now 2.28. (up from 2.17)
86+
- Linux: non-x86_64 shared libraries are now built with GCC 12.3 (up from GCC 11.4)
87+
* No change to minimum GLIBC version (2.35).
8488

8589
#### Fixes
8690

0 commit comments

Comments
 (0)