Skip to content

Commit f383c0e

Browse files
authored
Merge pull request #17 from ruscher/main
New fix warsaw
2 parents 75de179 + e746c26 commit f383c0e

7 files changed

Lines changed: 110 additions & 2 deletions

File tree

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# makepkg build artifacts
2+
pkgbuild/src/
3+
pkgbuild/pkg/
4+
pkgbuild/*.pkg.tar
5+
pkgbuild/*.pkg.tar.*
6+
pkgbuild/*.tar.zst
7+
pkgbuild/*.tar.xz
8+
pkgbuild/*.tar.gz
9+
pkgbuild/biglinux-improve-compatibility/
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
[Unit]
22
Description=Fix apps broken with this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32653
3+
# Note: This service uses setarch instead of execstack because Warsaw binary has no section headers
4+
# The hook biglinux-improve-compatibility-warsaw creates a systemd override with Type=forking
5+
# This service is kept for compatibility but the hook is the primary fix mechanism
36

47
[Service]
58
Type=oneshot
6-
ExecStart=execstack -s /usr/local/bin/warsaw/core
9+
ExecStart=/bin/true
710

811
[Install]
912
WantedBy=default.target
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Trigger]
2+
Type = Package
3+
Operation = Remove
4+
Target = warsaw
5+
6+
[Action]
7+
Description = Removing Warsaw glibc 2.41 fix
8+
When = PreTransaction
9+
Exec = /usr/share/libalpm/scripts/biglinux-improve-compatibility-warsaw-remove
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Trigger]
2+
Type = Package
3+
Operation = Install
4+
Operation = Upgrade
5+
Target = warsaw
6+
7+
[Action]
8+
Description = Applying glibc 2.41 fix for Warsaw (setarch)
9+
When = PostTransaction
10+
Exec = /usr/share/libalpm/scripts/biglinux-improve-compatibility-warsaw
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
# Fix for Warsaw binary compatibility issues
3+
# - Old versions (1.x) have no section headers - execstack doesn't work, use setarch
4+
# - New versions (2.x) work correctly with proper systemd Type=forking
5+
# - Remove conflicting service files from /etc/systemd/system/
6+
# Bug reference: https://sourceware.org/bugzilla/show_bug.cgi?id=32653
7+
8+
OVERRIDE_DIR="/etc/systemd/system/warsaw.service.d"
9+
OVERRIDE_FILE="${OVERRIDE_DIR}/fix-glibc241.conf"
10+
CONFLICTING_SERVICE="/etc/systemd/system/warsaw.service"
11+
12+
# Find Warsaw binary location (new version uses /usr/local/bin, old uses /usr/bin)
13+
WARSAW_BINARY=""
14+
if [[ -f /usr/local/bin/warsaw/core ]]; then
15+
WARSAW_BINARY="/usr/local/bin/warsaw/core"
16+
elif [[ -f /usr/bin/warsaw/core ]]; then
17+
WARSAW_BINARY="/usr/bin/warsaw/core"
18+
fi
19+
20+
# Exit if no Warsaw binary found
21+
[[ -z "$WARSAW_BINARY" ]] && exit 0
22+
23+
# Remove conflicting service file in /etc/systemd/system if it exists
24+
# This file can override the correct service from the package
25+
if [[ -f "$CONFLICTING_SERVICE" ]]; then
26+
rm -f "$CONFLICTING_SERVICE"
27+
fi
28+
29+
# Check if binary has section headers (old version doesn't)
30+
if ! readelf -S "$WARSAW_BINARY" &>/dev/null; then
31+
# Old version without section headers - needs setarch fix
32+
mkdir -p "$OVERRIDE_DIR"
33+
34+
# Determine correct paths based on installation
35+
WSCERTMGR=""
36+
if [[ -f /usr/bin/warsaw/wscertmgr ]]; then
37+
WSCERTMGR="/usr/bin/warsaw/wscertmgr"
38+
fi
39+
40+
cat > "$OVERRIDE_FILE" << EOF
41+
[Service]
42+
Type=forking
43+
$(if [[ -n "$WSCERTMGR" ]]; then echo "ExecStartPre="; echo "ExecStartPre=/usr/bin/setarch x86_64 --read-implies-exec $WSCERTMGR"; fi)
44+
ExecStart=
45+
ExecStart=/usr/bin/setarch x86_64 --read-implies-exec $WARSAW_BINARY
46+
EOF
47+
else
48+
# New version works correctly - remove any old override
49+
[[ -d "$OVERRIDE_DIR" ]] && rm -rf "$OVERRIDE_DIR"
50+
fi
51+
52+
# Reload systemd configuration
53+
systemctl daemon-reload
54+
55+
# Restart warsaw service if it's active
56+
if systemctl is-active --quiet warsaw; then
57+
systemctl restart warsaw
58+
fi
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# Remove Warsaw glibc 2.41 fix and cleanup
3+
4+
OVERRIDE_DIR="/etc/systemd/system/warsaw.service.d"
5+
CONFLICTING_SERVICE="/etc/systemd/system/warsaw.service"
6+
7+
# Stop warsaw service before removing
8+
if systemctl is-active --quiet warsaw; then
9+
systemctl stop warsaw
10+
fi
11+
12+
# Remove override directory and files
13+
[[ -d "$OVERRIDE_DIR" ]] && rm -rf "$OVERRIDE_DIR"
14+
15+
# Remove conflicting service file if it exists
16+
[[ -f "$CONFLICTING_SERVICE" ]] && rm -f "$CONFLICTING_SERVICE"
17+
18+
# Reload systemd configuration
19+
systemctl daemon-reload

pkgbuild/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pkgver=$(date +%y.%m.%d_1)
55
pkgrel=$(date +%H%M)
66
arch=('any')
77
license=('GPL')
8-
depends=('start-stop-daemon' 'wxgtk3-runtime' 'ld-lsb' 'openssl-1.1' 'kdotool-git' 'linux-firmware' 'execstack')
8+
depends=('start-stop-daemon' 'wxgtk3-runtime' 'ld-lsb' 'openssl-1.1' 'kdotool-git' 'linux-firmware')
99
provides=('wxwidgets3.0=3.0.5-3')
1010
conflicts=('wxwidgets3.0')
1111
replaces=('wxwidgets3.0')

0 commit comments

Comments
 (0)