Skip to content

Commit 46fa6c9

Browse files
psadicodemedicrenovate[bot]
authored
fix: add commit hash as part of the build (#140)
* fix: add commit hash as part of the build closes #138 * fix: strip .sframe from glibc crt objects to unblock Zig linker on GCC 15+ (#143) GCC 15+ compiles glibc crt startup objects (crt1.o, Scrt1.o, rcrt1.o) with .sframe sections that use R_X86_64_PC64 relocations. Zig's self-hosted linker doesn't support this relocation type, causing build-time helpers such as ghostty-build-data to fail with: error: fatal linker error: unhandled relocation type R_X86_64_PC64 note: in /usr/lib/crt1.o:.sframe After pacman installs packages in setup-env.sh, use objcopy to strip .sframe and .rela.sframe from the affected objects. This is version-agnostic and requires no changes to the Zig invocation. Also remove URUNTIME_PRELOAD from bundle-appimage.sh — the aarch64 dwarfs-lite uruntime variant does not support the URUNTIME_MOUNT marker patching it requires, causing AppImage packaging to fail on aarch64. Fixes: #138 See: https://ziggit.dev/t/linker-error-when-building-zig-from-source/14394 Co-authored-by: Dino Korah <691011+codemedic@users.noreply.github.com> * chore(deps): update softprops/action-gh-release action to v3 (#136) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: update debloated args to use common pkgs (nano) --------- Co-authored-by: Dino Korah <codemedic@users.noreply.github.com> Co-authored-by: Dino Korah <691011+codemedic@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent 60e3ce9 commit 46fa6c9

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

bin/build-ghostty.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if [ "${GHOSTTY_VERSION}" = "tip" ]; then
2222
export UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY}" | tr '/' '|')|tip|Ghostty-*$ARCH.AppImage.zsync"
2323
wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz" -O "ghostty-${GHOSTTY_VERSION}.tar.gz"
2424
wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz.minisig" -O "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
25-
GHOSTTY_VERSION="$(tar -tf "ghostty-${GHOSTTY_VERSION}.tar.gz" --wildcards "*zig.zon.txt" | awk -F'[-/]' '{print $2"-"$3}')"
25+
GHOSTTY_VERSION="$(tar -tf "ghostty-${GHOSTTY_VERSION}.tar.gz" --wildcards "*zig.zon.txt" | awk '-F[-/]' '{print $2"-"$3"-"$4}')"
2626
echo "${GHOSTTY_VERSION}" >VERSION
2727
mv ghostty-tip.tar.gz "ghostty-${GHOSTTY_VERSION}.tar.gz"
2828
mv ghostty-tip.tar.gz.minisig "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
@@ -42,10 +42,10 @@ BUILD_ARGS="${BUILD_ARGS} -Dversion-string=${GHOSTTY_VERSION}"
4242

4343
# Configure Zig: https://ziglang.org
4444
ZIG_VERSION="$(cat "ghostty-${GHOSTTY_VERSION}/build.zig.zon" | grep ".minimum_zig_version" | cut -d'"' -f2)"
45+
ZIG_PACKAGE_NAME="zig-${ARCH}-linux-${ZIG_VERSION}"
4546
CURRENT_ZIG_VERSION=$(zig version 2>/dev/null || true)
4647
if [ "$CURRENT_ZIG_VERSION" != "$ZIG_VERSION" ]; then
4748
echo "Installing Zig ${ZIG_VERSION}..."
48-
ZIG_PACKAGE_NAME="zig-${ARCH}-linux-${ZIG_VERSION}"
4949
ZIG_URL="https://ziglang.org/download/${ZIG_VERSION}/${ZIG_PACKAGE_NAME}.tar.xz"
5050
rm -rf /opt/zig*
5151
unlink /usr/local/bin/zig || true

bin/bundle-appimage.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ ARCH="$(uname -m)"
66
GHOSTTY_VERSION="$(cat VERSION)"
77

88
export UPINFO="gh-releases-zsync|$(echo "${GITHUB_REPOSITORY}" | tr '/' '|')|latest|Ghostty-*$ARCH.AppImage.zsync"
9-
export URUNTIME_PRELOAD=1
109
export DEPLOY_OPENGL=1
1110
export EXEC_WRAPPER=1
1211
export OUTNAME="Ghostty-${GHOSTTY_VERSION}-${ARCH}.AppImage"

bin/setup-env.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ ghosttyDeps="gtk4 libadwaita gtk4-layer-shell"
1414
rm -rf "/usr/share/libalpm/hooks/package-cleanup.hook"
1515
pacman -Syuq --needed --noconfirm --noprogressbar ${buildDeps} ${ghosttyDeps}
1616

17+
# GCC 15+ compiles glibc crt startup objects with .sframe sections that use R_X86_64_PC64
18+
# relocations. Zig's self-hosted linker doesn't support this relocation type, causing
19+
# build-time helpers (e.g. ghostty-build-data) to fail. Strip .sframe and its associated
20+
# relocation section from the affected objects so the linker never encounters them.
21+
for _crt in /usr/lib/crt1.o /usr/lib/Scrt1.o /usr/lib/rcrt1.o; do
22+
[ -f "$_crt" ] && objcopy --remove-section .sframe --remove-section .rela.sframe "$_crt"
23+
done
24+
1725
ARCH="$(uname -m)"
1826

1927
MINISIGN_VERSION="$(get_latest_gh_release 'jedisct1/minisign')"
@@ -29,7 +37,7 @@ SHARUN="${GH_USER_CONTENT}/pkgforge-dev/Anylinux-AppImages/refs/heads/main/usefu
2937
# Install Debloated Pkgs
3038
wget "${DEBLOATED_PKGS}" -O /tmp/get-debloated-pkgs.sh
3139
chmod a+x /tmp/get-debloated-pkgs.sh
32-
sh /tmp/get-debloated-pkgs.sh --add-opengl --prefer-nano gtk4-mini libxml2-mini gdk-pixbuf2-mini librsvg-mini
40+
sh /tmp/get-debloated-pkgs.sh --add-common --prefer-nano
3341

3442
# minisign: https://github.com/jedisct1/minisign
3543
rm -rf /usr/local/bin/minisign

0 commit comments

Comments
 (0)