Skip to content

Commit 9defea8

Browse files
committed
Update all to new toolchains, add Linux arm64 and arm32 builds
Backport of #89 and #90, in sync with godotengine/build-containers#135. In the 3.x branch, the situation with `arch` and `bits` is very brittle, so we only add the explicit `arch` argument for the arm32/arm64 builds. x86_32 still relies on `bits=32`. This would all be worth refactoring upstream like we did for 4.0, but it's a major undertaking and breaking change, which I'd prefer to avoid in 3.6. For Linux builds, we move the `strip` calls to the link stage, as this needs to be done with the arch-appropriate `strip` binary, so it's easier done there. In `master`, we now let the compiler strip automatically during the build if no debug symbols are requested, but this change wasn't backported to 3.x.
1 parent 682393f commit 9defea8

File tree

5 files changed

+61
-27
lines changed

5 files changed

+61
-27
lines changed

build-ios/build.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export OPTIONS="production=yes lto=none"
1111
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes"
1212
export TERM=xterm
1313

14-
export IOS_SDK="15.4"
14+
export IOS_SDK="17.0"
1515
export IOS_LIPO="/root/ioscross/arm64/bin/arm-apple-darwin11-lipo"
1616

1717
rm -rf godot
@@ -34,15 +34,15 @@ if [ "${CLASSICAL}" == "1" ]; then
3434
# Disabled for now as it doesn't work with cctools-port and current LLVM.
3535
# See https://github.com/godotengine/build-containers/pull/85.
3636
#$SCONS platform=iphone $OPTIONS arch=arm64 tools=no ios_simulator=yes target=release_debug \
37-
# IPHONESDK="/root/ioscross/arm64_sim/SDK/iPhoneOS${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/arm64_sim/" ios_triple="arm-apple-darwin11-"
37+
# IPHONESDK="/root/ioscross/arm64_sim/SDK/iPhoneSimulator${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/arm64_sim/" ios_triple="arm-apple-darwin11-"
3838
#$SCONS platform=iphone $OPTIONS arch=arm64 tools=no ios_simulator=no target=release \
39-
# IPHONESDK="/root/ioscross/arm64_sim/SDK/iPhoneOS${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/arm64_sim/" ios_triple="arm-apple-darwin11-"
39+
# IPHONESDK="/root/ioscross/arm64_sim/SDK/iPhoneSimulator${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/arm64_sim/" ios_triple="arm-apple-darwin11-"
4040

4141
# x86_64 simulator
4242
$SCONS platform=iphone $OPTIONS arch=x86_64 tools=no ios_simulator=yes target=release_debug \
43-
IPHONESDK="/root/ioscross/x86_64_sim/SDK/iPhoneOS${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/x86_64_sim/" ios_triple="x86_64-apple-darwin11-"
43+
IPHONESDK="/root/ioscross/x86_64_sim/SDK/iPhoneSimulator${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/x86_64_sim/" ios_triple="x86_64-apple-darwin11-"
4444
$SCONS platform=iphone $OPTIONS arch=x86_64 tools=no ios_simulator=yes target=release \
45-
IPHONESDK="/root/ioscross/x86_64_sim/SDK/iPhoneOS${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/x86_64_sim/" ios_triple="x86_64-apple-darwin11-"
45+
IPHONESDK="/root/ioscross/x86_64_sim/SDK/iPhoneSimulator${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/x86_64_sim/" ios_triple="x86_64-apple-darwin11-"
4646

4747
mkdir -p /root/out/templates
4848
cp bin/libgodot.iphone.opt.arm64.a /root/out/templates/libgodot.iphone.a
@@ -72,15 +72,15 @@ if [ "${MONO}" == "1" ]; then
7272
# Disabled for now as it doesn't work with cctools-port and current LLVM.
7373
# See https://github.com/godotengine/build-containers/pull/85.
7474
#$SCONS platform=iphone $OPTIONS $OPTIONS_MONO arch=arm64 ios_simulator=yes mono_prefix=/root/mono-installs/ios-arm64-sim-release tools=no target=release_debug \
75-
# IPHONESDK="/root/ioscross/arm64_sim/SDK/iPhoneOS${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/arm64_sim/" ios_triple="arm-apple-darwin11-"
75+
# IPHONESDK="/root/ioscross/arm64_sim/SDK/iPhoneSimulator${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/arm64_sim/" ios_triple="arm-apple-darwin11-"
7676
#$SCONS platform=iphone $OPTIONS $OPTIONS_MONO arch=arm64 ios_simulator=yes mono_prefix=/root/mono-installs/ios-arm64-sim-release tools=no target=release \
77-
# IPHONESDK="/root/ioscross/arm64_sim/SDK/iPhoneOS${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/arm64_sim/" ios_triple="arm-apple-darwin11-"
77+
# IPHONESDK="/root/ioscross/arm64_sim/SDK/iPhoneSimulator${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/arm64_sim/" ios_triple="arm-apple-darwin11-"
7878

7979
# x86_64 simulator
8080
$SCONS platform=iphone $OPTIONS $OPTIONS_MONO arch=x86_64 ios_simulator=yes mono_prefix=/root/mono-installs/ios-x86_64-release tools=no target=release_debug \
81-
IPHONESDK="/root/ioscross/x86_64_sim/SDK/iPhoneOS${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/x86_64_sim/" ios_triple="x86_64-apple-darwin11-"
81+
IPHONESDK="/root/ioscross/x86_64_sim/SDK/iPhoneSimulator${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/x86_64_sim/" ios_triple="x86_64-apple-darwin11-"
8282
$SCONS platform=iphone $OPTIONS $OPTIONS_MONO arch=x86_64 ios_simulator=yes mono_prefix=/root/mono-installs/ios-x86_64-release tools=no target=release \
83-
IPHONESDK="/root/ioscross/x86_64_sim/SDK/iPhoneOS${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/x86_64_sim/" ios_triple="x86_64-apple-darwin11-"
83+
IPHONESDK="/root/ioscross/x86_64_sim/SDK/iPhoneSimulator${IOS_SDK}.sdk" IPHONEPATH="/root/ioscross/x86_64_sim/" ios_triple="x86_64-apple-darwin11-"
8484

8585
mkdir -p /root/out/templates-mono
8686

build-linux/build.sh

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
# Config
66

77
export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no"
8-
export OPTIONS="production=yes"
8+
export OPTIONS="production=yes LINKFLAGS=-s"
99
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes"
1010
export MONO_PREFIX_X86_64="/root/mono-installs/desktop-linux-x86_64-release"
1111
export MONO_PREFIX_X86="/root/mono-installs/desktop-linux-x86-release"
@@ -34,18 +34,44 @@ if [ "${CLASSICAL}" == "1" ]; then
3434
cp -rvp bin/* /root/out/x64/templates
3535
rm -rf bin
3636

37-
export PATH="${GODOT_SDK_LINUX_X86}/bin:${BASE_PATH}"
37+
export PATH="${GODOT_SDK_LINUX_X86_32}/bin:${BASE_PATH}"
3838

39-
$SCONS platform=x11 $OPTIONS tools=yes target=release_debug bits=32
39+
$SCONS platform=x11 bits=32 $OPTIONS tools=yes target=release_debug
4040
mkdir -p /root/out/x86/tools
4141
cp -rvp bin/* /root/out/x86/tools
4242
rm -rf bin
4343

44-
$SCONS platform=x11 $OPTIONS tools=no target=release_debug bits=32
45-
$SCONS platform=x11 $OPTIONS tools=no target=release bits=32
44+
$SCONS platform=x11 bits=32 $OPTIONS tools=no target=release_debug
45+
$SCONS platform=x11 bits=32 $OPTIONS tools=no target=release
4646
mkdir -p /root/out/x86/templates
4747
cp -rvp bin/* /root/out/x86/templates
4848
rm -rf bin
49+
50+
export PATH="${GODOT_SDK_LINUX_ARM64}/bin:${BASE_PATH}"
51+
52+
$SCONS platform=x11 arch=arm64 $OPTIONS tools=yes target=release_debug
53+
mkdir -p /root/out/arm64/tools
54+
cp -rvp bin/* /root/out/arm64/tools
55+
rm -rf bin
56+
57+
$SCONS platform=x11 arch=arm64 $OPTIONS tools=no target=release_debug
58+
$SCONS platform=x11 arch=arm64 $OPTIONS tools=no target=release
59+
mkdir -p /root/out/arm64/templates
60+
cp -rvp bin/* /root/out/arm64/templates
61+
rm -rf bin
62+
63+
export PATH="${GODOT_SDK_LINUX_ARM32}/bin:${BASE_PATH}"
64+
65+
$SCONS platform=x11 arch=arm $OPTIONS tools=yes target=release_debug
66+
mkdir -p /root/out/arm32/tools
67+
cp -rvp bin/* /root/out/arm32/tools
68+
rm -rf bin
69+
70+
$SCONS platform=x11 arch=arm $OPTIONS tools=no target=release_debug
71+
$SCONS platform=x11 arch=arm $OPTIONS tools=no target=release
72+
mkdir -p /root/out/arm32/templates
73+
cp -rvp bin/* /root/out/arm32/templates
74+
rm -rf bin
4975
fi
5076

5177
# Mono
@@ -71,16 +97,16 @@ if [ "${MONO}" == "1" ]; then
7197
cp -rvp bin/* /root/out/x64/templates-mono
7298
rm -rf bin
7399

74-
export PATH="${GODOT_SDK_LINUX_X86}/bin:${BASE_PATH}"
100+
export PATH="${GODOT_SDK_LINUX_X86_32}/bin:${BASE_PATH}"
75101
export OPTIONS_MONO_PREFIX="${OPTIONS} ${OPTIONS_MONO} mono_prefix=${MONO_PREFIX_X86}"
76102

77-
$SCONS platform=x11 $OPTIONS_MONO_PREFIX tools=yes target=release_debug copy_mono_root=yes bits=32
103+
$SCONS platform=x11 bits=32 $OPTIONS_MONO_PREFIX tools=yes target=release_debug copy_mono_root=yes
78104
mkdir -p /root/out/x86/tools-mono
79105
cp -rvp bin/* /root/out/x86/tools-mono
80106
rm -rf bin
81107

82-
$SCONS platform=x11 $OPTIONS_MONO_PREFIX tools=no target=release_debug bits=32
83-
$SCONS platform=x11 $OPTIONS_MONO_PREFIX tools=no target=release bits=32
108+
$SCONS platform=x11 bits=32 $OPTIONS_MONO_PREFIX tools=no target=release_debug
109+
$SCONS platform=x11 bits=32 $OPTIONS_MONO_PREFIX tools=no target=release
84110
mkdir -p /root/out/x86/templates-mono
85111
cp -rvp bin/* /root/out/x86/templates-mono
86112
rm -rf bin

build-macosx/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ set -e
55
# Config
66

77
export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no"
8-
export OPTIONS="osxcross_sdk=darwin21.4 production=yes"
8+
export OPTIONS="osxcross_sdk=darwin23 production=yes"
99
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes"
1010
export MONO_PREFIX_X86_64="/root/mono-installs/desktop-osx-x86_64-release"
1111
export MONO_PREFIX_ARM64="/root/mono-installs/desktop-osx-arm64-release"
12-
export STRIP="x86_64-apple-darwin21.4-strip -u -r"
12+
export STRIP="x86_64-apple-darwin23-strip -u -r"
1313
export TERM=xterm
1414

1515
rm -rf godot

build-mono-glue/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if [ "${MONO}" == "1" ]; then
2222
mono --version
2323
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig/
2424

25-
${SCONS} platform=x11 bits=64 ${OPTIONS} target=release_debug tools=yes module_mono_enabled=yes mono_glue=no
25+
${SCONS} platform=x11 ${OPTIONS} target=release_debug tools=yes module_mono_enabled=yes mono_glue=no
2626

2727
rm -rf /root/mono-glue/*
2828
xvfb-run bin/godot.x11.opt.tools.64.mono --audio-driver Dummy --generate-mono-glue /root/mono-glue || /bin/true

build-release.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,21 @@ if [ "${build_classical}" == "1" ]; then
170170
# Editor
171171
binname="${godot_basename}_x11.64"
172172
cp out/linux/x64/tools/godot.x11.opt.tools.64 ${binname}
173-
strip ${binname}
174173
zip -q -9 "${reldir}/${binname}.zip" ${binname}
175174
rm ${binname}
176175

177176
binname="${godot_basename}_x11.32"
178177
cp out/linux/x86/tools/godot.x11.opt.tools.32 ${binname}
179-
strip ${binname}
178+
zip -q -9 "${reldir}/${binname}.zip" ${binname}
179+
rm ${binname}
180+
181+
binname="${godot_basename}_linux.arm64"
182+
cp out/linux/arm64/tools/godot.x11.opt.tools.arm64 ${binname}
183+
zip -q -9 "${reldir}/${binname}.zip" ${binname}
184+
rm ${binname}
185+
186+
binname="${godot_basename}_linux.arm32"
187+
cp out/linux/arm/tools/godot.x11.opt.tools.arm ${binname}
180188
zip -q -9 "${reldir}/${binname}.zip" ${binname}
181189
rm ${binname}
182190

@@ -185,7 +193,10 @@ if [ "${build_classical}" == "1" ]; then
185193
cp out/linux/x64/templates/godot.x11.opt.debug.64 ${templatesdir}/linux_x11_64_debug
186194
cp out/linux/x86/templates/godot.x11.opt.32 ${templatesdir}/linux_x11_32_release
187195
cp out/linux/x86/templates/godot.x11.opt.debug.32 ${templatesdir}/linux_x11_32_debug
188-
strip ${templatesdir}/linux_x11_*
196+
cp out/linux/x86/templates/godot.x11.opt.arm64 ${templatesdir}/linux_x11_arm64_release
197+
cp out/linux/x86/templates/godot.x11.opt.debug.arm64 ${templatesdir}/linux_x11_arm64_debug
198+
cp out/linux/x86/templates/godot.x11.opt.arm ${templatesdir}/linux_x11_arm32_release
199+
cp out/linux/x86/templates/godot.x11.opt.debug.arm ${templatesdir}/linux_x11_arm32_debug
189200

190201
## Windows (Classical) ##
191202

@@ -370,7 +381,6 @@ if [ "${build_mono}" == "1" ]; then
370381
binbasename="${godot_basename}_mono_x11"
371382
mkdir -p ${binbasename}_64
372383
cp out/linux/x64/tools-mono/godot.x11.opt.tools.64.mono ${binbasename}_64/${binbasename}.64
373-
strip ${binbasename}_64/${binbasename}.64
374384
cp -rp out/linux/x64/tools-mono/GodotSharp ${binbasename}_64/
375385
cp -rp out/aot-compilers ${binbasename}_64/GodotSharp/Tools/
376386
zip -r -q -9 "${reldir_mono}/${binbasename}_64.zip" ${binbasename}_64
@@ -379,7 +389,6 @@ if [ "${build_mono}" == "1" ]; then
379389
binbasename="${godot_basename}_mono_x11"
380390
mkdir -p ${binbasename}_32
381391
cp out/linux/x86/tools-mono/godot.x11.opt.tools.32.mono ${binbasename}_32/${binbasename}.32
382-
strip ${binbasename}_32/${binbasename}.32
383392
cp -rp out/linux/x86/tools-mono/GodotSharp/ ${binbasename}_32/
384393
cp -rp out/aot-compilers ${binbasename}_32/GodotSharp/Tools/
385394
zip -r -q -9 "${reldir_mono}/${binbasename}_32.zip" ${binbasename}_32
@@ -392,7 +401,6 @@ if [ "${build_mono}" == "1" ]; then
392401
cp -rp out/linux/x86/templates-mono/data.mono.x11.32.* ${templatesdir_mono}/
393402
cp out/linux/x86/templates-mono/godot.x11.opt.debug.32.mono ${templatesdir_mono}/linux_x11_32_debug
394403
cp out/linux/x86/templates-mono/godot.x11.opt.32.mono ${templatesdir_mono}/linux_x11_32_release
395-
strip ${templatesdir_mono}/linux_x11*
396404

397405
mkdir -p ${templatesdir_mono}/bcl
398406
cp -r out/linux/x64/tools-mono/GodotSharp/Mono/lib/mono/4.5/ ${templatesdir_mono}/bcl/net_4_x

0 commit comments

Comments
 (0)