From 38c89e06b5327260eba99f4fcd6c106eeff90ac2 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Sat, 13 Dec 2025 08:16:14 +1100 Subject: [PATCH] Revert "fix(linux): auto-detect and handle .relr.dyn sections for AppImage builds" This reverts commit 3d46f4867db88b7b870cdde09c33f103d6e34504. --- docs/src/content/docs/guides/build/linux.mdx | 13 -------- v3/internal/commands/appimage.go | 32 +------------------- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/docs/src/content/docs/guides/build/linux.mdx b/docs/src/content/docs/guides/build/linux.mdx index 773db73cf..9d8fac890 100644 --- a/docs/src/content/docs/guides/build/linux.mdx +++ b/docs/src/content/docs/guides/build/linux.mdx @@ -145,16 +145,3 @@ sudo pacman -S base-devel ``` Alternatively, run `wails3 task setup:docker` and the build system will use Docker automatically. - -### AppImage strip compatibility {#appimage-strip-compatibility} - -On modern Linux distributions (Arch Linux, Fedora 39+, Ubuntu 24.04+), system libraries are compiled with `.relr.dyn` ELF sections for more efficient relocations. The `linuxdeploy` tool used to create AppImages bundles an older `strip` binary that cannot process these modern sections. - -Wails automatically detects this situation by checking system GTK libraries before building the AppImage. When detected, stripping is disabled (`NO_STRIP=1`) to ensure compatibility. - -**What this means:** -- AppImages will be slightly larger (~20-40%) on affected systems -- The application functionality is not affected -- This is handled automatically—no action required - -If you need smaller AppImages on modern systems, you can install a newer `strip` binary and configure `linuxdeploy` to use it instead of its bundled version. diff --git a/v3/internal/commands/appimage.go b/v3/internal/commands/appimage.go index d204632c2..7c43ba856 100644 --- a/v3/internal/commands/appimage.go +++ b/v3/internal/commands/appimage.go @@ -190,17 +190,9 @@ func generateAppImage(options *GenerateAppImageOptions) error { cmd := fmt.Sprintf("%s --appimage-extract-and-run --appdir %s --output appimage --plugin gtk", linuxdeployAppImage, appDir) s.SETENV("DEPLOY_GTK_VERSION", DeployGtkVersion) - - // Check if system libraries use .relr.dyn sections (modern toolchains) - // If so, disable stripping as linuxdeploy's bundled strip can't handle them - if hasRelrDynSections() { - term.Infof("Detected modern toolchain (.relr.dyn sections), disabling stripping for compatibility. See: https://v3.wails.io/guides/build/linux#appimage-strip-compatibility") - s.SETENV("NO_STRIP", "1") - } - output, err := s.EXEC(cmd) if err != nil { - fmt.Println(string(output)) + println(output) return err } @@ -256,25 +248,3 @@ func findGTKFiles(files []string) ([]string, error) { } return found, nil } - -// hasRelrDynSections checks if system libraries use .relr.dyn sections -// which are incompatible with linuxdeploy's bundled strip binary. -// This is common on modern Linux distributions (Arch, Fedora 39+, Ubuntu 24.04+). -func hasRelrDynSections() bool { - // Check common GTK library that will be bundled - testLibs := []string{ - "/usr/lib/libgtk-3.so.0", - "/usr/lib64/libgtk-3.so.0", - "/usr/lib/x86_64-linux-gnu/libgtk-3.so.0", - } - - for _, lib := range testLibs { - if _, err := os.Stat(lib); err == nil { - output, err := s.EXEC(fmt.Sprintf("readelf -S %s", lib)) - if err == nil && strings.Contains(string(output), ".relr.dyn") { - return true - } - } - } - return false -}