fix(flatpak): disable libbfd in the flatpak build (#13) - #19
Merged
Conversation
The GNOME 49 SDK ships libbfd (in /usr/lib + bfd.h in /usr/include),
so cmake/bfd.cmake auto-detects it and links aMule against
libbfd-2.46.so. The GNOME 49 *Runtime* (the tree shipped to end
users alongside the bundle) does NOT ship libbfd — it's a
development library, not a runtime one — so installed flatpaks
abort at startup:
amule: error while loading shared libraries: libbfd-2.46.so:
cannot open shared object file
Every Linux user installing the 3.0.0 flatpak bundle hits this today
(amule-org#13).
Add an ENABLE_BFD option to amule's CMake (default ON, so distro
packagers, the AppImage build, native local builds and CI keep
using libbfd exactly as before) and gate the cmake/bfd.cmake
include on it. Pass -DENABLE_BFD=NO from the flatpak manifest to
disable libbfd linkage there.
MuleDebug.cpp's existing !HAVE_BFD fallback already handles this:
backtrace() + backtrace_symbols() still emit the stack with
function names, and the code shells out to addr2line for source
line info when available. The post-amule-project#677 PIE-base translation keeps
addresses meaningful on modern PIE binaries. Net effect on flatpak
crash reports: slightly less detailed (no in-process file:line
resolution) but still actionable.
Only the flatpak channel is affected. AppImage and native packages
keep symbol-resolved backtraces via libbfd.
got3nks
force-pushed
the
fix/flatpak-bundle-libbfd
branch
from
June 8, 2026 16:01
1af762c to
dea65f1
Compare
got3nks
added a commit
that referenced
this pull request
Jun 8, 2026
Stages the Flathub-strict version of the aMule Flatpak manifest in `packaging/flathub/` — the file that will be submitted to flathub/flathub once domain attestation for the app-id is resolved. Differences from the internal `packaging/linux/flatpak/org.amule.aMule.yaml.in`:
- All `${...}` template variables resolved to concrete values (Flathub forbids envsubst).
- The amule source: `branch:` swapped for `tag: + commit:` (Flathub forbids mutable refs).
- The cryptopp source: existing tag augmented with a pinned commit.
Pinned at master tip post-#15 (icon refresh), #17 (metainfo / desktop polish), and #19 (ENABLE_BFD option). Carries -DENABLE_BFD=NO so the Flathub-built bundle inherits the libbfd-runtime-missing fix.
Companion file `packaging/flathub/README.md` documents the two-manifest layout, the submission flow against flathub/flathub:new-pr, and how to refresh the pin on each new aMule release tag.
This was referenced Jun 8, 2026
got3nks
added a commit
that referenced
this pull request
Jun 14, 2026
…atforms
The macOS-only `std::_Exit(0)` block in OnExit() was added to dodge a
wxWebSessionURLSession dtor bug under wx 3.3.2. Turns out the
Linux backend (wxWebSessionCURL, wx 3.2.6) hits the same class of
shutdown crash: its dtor calls curl_multi_cleanup, libcurl invokes the
registered socket callback (wxWebSessionCURL::SocketCallback) to drop
tracked sockets, and that callback dereferences session state the
dtor's earlier steps have already torn down. wxASSERT fires,
wxFatalSignalHandler raise(SIGABRT)s.
Verified with a debug-symbol Flatpak + gdb on a user-supplied core,
fully symbolicated:
#19 main amule-gui.cpp:98
#18 wxEntry wx/init.cpp:500
#17 wxEntryCleanup wx/init.cpp:205
#16 wxModule::CleanUpModules wx/module.cpp:191
#15 wxModule::DoCleanUpModules wx/module.cpp:200
#14 wxRefCounterMT::DecRef
wxWebSession::Close wx/webrequest.cpp:1074
#13 wxWebSessionCURL::~wxWebSessionCURL wx/webrequest_curl.cpp:932
#12 wxWebSessionCURL::~wxWebSessionCURL wx/webrequest_curl.cpp:929
#11-#6 libcurl curl_multi_cleanup
#5 wxWebSessionCURL::SocketCallback wx/webrequest_curl.cpp:1047
#4 raise()
#3 wxFatalSignalHandler wx/unix/utilsunx.cpp:1523
#0 abort
Same justification used for the macOS guard applies on every
platform: by this point in OnExit we have saved state, joined
threads, and flushed logs -- nothing aMule-owned remains to clean up.
_Exit bypasses atexit and static destructors uniformly, so the buggy
wx dtor never runs and the process terminates cleanly.
Remove this once the upstream wx fix lands in a release we depend on.
Reported in #18.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13.
aMule's
cmake/bfd.cmakeauto-detects libbfd at configure time and links against it for backtrace symbol resolution. The GNOME 49 SDK (build-time) shipslibbfd-2.46.so+bfd.h, so the detection fires. The GNOME 49 runtime (the tree shipped to end users alongside the bundle) does not ship libbfd — it's a development library — so installed flatpaks abort at startup:Every Linux user installing the 3.0.0 flatpak bundle is hitting this today.
Fix
option(ENABLE_BFD "..." ON)tocmake/options.cmake, mirroring the adjacentENABLE_NLSpattern. Default ON, so distro packagers, the AppImage build, native local builds, and CI all behave exactly as before.include(cmake/bfd.cmake)inCMakeLists.txtonENABLE_BFD. When OFF,HAVE_BFDstays unset and the downstreamif(HAVE_BFD)guards insrc/CMakeLists.txtandsrc/libs/common/CMakeLists.txtskip the libbfd linkage.-DENABLE_BFD=NOfrom the flatpak manifest template, with a comment block explaining why this channel specifically needs it.Backtrace impact for flatpak users
MuleDebug.cpp:368-521already implements a full!HAVE_BFDfallback:backtrace()+backtrace_symbols()still emit the stack with function names, and the code shells out toaddr2line -C -f -s -e /proc/$$/exeviapopen()for source line info when available. The post-#677 PIE-base translation keeps addresses meaningful on modern PIE binaries. Net: slightly less detailed in-process resolution, but crash reports remain actionable.Verified
Full clean rebuild on Linux ARM64, installed, ran.
readelf -dconfirms libbfd is no longer in DT_NEEDED.flatpak run org.amule.aMule --versionreturns the banner cleanly:Follow-up
The Flathub-strict manifest staged in #16 will need the same
-DENABLE_BFD=NOconfig-opt addition; queued as a one-line follow-up once #16 lands.