mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Revert "fix(linux): auto-detect and handle .relr.dyn sections for AppImage builds"
This reverts commit 3d46f4867d.
This commit is contained in:
parent
3d46f4867d
commit
38c89e06b5
2 changed files with 1 additions and 44 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue