[SOLVED] Creating a debug build on Linux

Discussion of third-party/unofficial Firefox/Thunderbird/SeaMonkey builds.
Post Reply
Tonttu
Posts: 12
Joined: April 5th, 2011, 12:03 pm

[SOLVED] Creating a debug build on Linux

Post by Tonttu »

I'm trying to Make The World a Better Place™ by getting a backtrace of a crash. The crash only occurs on Arch Linux with the KDE integration stuff.

I can do a regular build just fine and now I am trying to include debug symbols. I have edited the mozconfig to include things I found on this Mozilla wiki page: https://developer.mozilla.org/en-US/doc ... ug_Symbols

Below is my mozconfig, which does not produce a build with symbols. I know this because I have tried to get a backtrace with coredumpctl gdb. What might be missing?

Code: Select all

. $topsrcdir/browser/config/mozconfig
ac_add_options --prefix=/usr
ac_add_options --enable-gold
ac_add_options --enable-rust
ac_add_options --enable-pie
ac_add_options --enable-release
ac_add_options --enable-official-branding
ac_add_options --enable-update-channel=release
# System libraries
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-png
ac_add_options --with-system-libevent
ac_add_options --with-system-libvpx
ac_add_options --with-system-icu
ac_add_options --enable-system-hunspell
ac_add_options --enable-system-sqlite
ac_add_options --enable-system-ffi
#ac_add_options --enable-system-cairo
ac_add_options --enable-system-pixman
ac_add_options --disable-libproxy
#ac_add_options --enable-shared-js
# Features
ac_add_options --enable-startup-notification
ac_add_options --enable-pulseaudio
ac_add_options --disable-gio
ac_add_options --disable-gconf
ac_add_options --disable-crashreporter
ac_add_options --disable-tests
ac_add_options --disable-updater
#ac_add_options --disable-debug-symbols
ac_add_options --disable-crashreporter
ac_add_options --disable-install-strip
#STRIP_FLAGS="--strip-debug"

# Optimization
ac_add_options --enable-optimize
ac_add_options --enable-debug-symbols="-gdwarf-2"
# PGO
mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export MOZ_DEBUG_SYMBOLS=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options MOZ_DEBUG_SYMBOLS=1
Last edited by Tonttu on March 13th, 2017, 9:26 am, edited 1 time in total.
barbaz
Posts: 1504
Joined: October 1st, 2014, 3:25 pm

Re: Creating a debug build on Linux

Post by barbaz »

Sometimes including the mozconfig files in the source tree can produce weird results. Try taking only the lines you want from "$topsrcdir/browser/config/mozconfig".
Tonttu
Posts: 12
Joined: April 5th, 2011, 12:03 pm

Re: Creating a debug build on Linux

Post by Tonttu »

barbaz wrote:Sometimes including the mozconfig files in the source tree can produce weird results. Try taking only the lines you want from "$topsrcdir/browser/config/mozconfig".
Thanks for the tip. However, the file only contains
ac_add_options --enable-application=browser

..which just means "I want to build Firefox".
barbaz
Posts: 1504
Joined: October 1st, 2014, 3:25 pm

Re: Creating a debug build on Linux

Post by barbaz »

Next is, why do you have these lines? -

Code: Select all

ac_add_options --enable-release
ac_add_options --enable-update-channel=release
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
Last I checked, those had all sorts of effects undesirable in any private build. Can you try building without them?
Tonttu
Posts: 12
Joined: April 5th, 2011, 12:03 pm

Re: Creating a debug build on Linux

Post by Tonttu »

barbaz wrote:Next is, why do you have these lines? -

Code: Select all

ac_add_options --enable-release
ac_add_options --enable-update-channel=release
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
Last I checked, those had all sorts of effects undesirable in any private build. Can you try building without them?
Thanks. I commented those out and did a new full build. I reproduced the crash and ran coredumpctl gdb. gdb is still not finding the debug symbols in /usr/lib/firefox/firefox :cry:
Tonttu
Posts: 12
Joined: April 5th, 2011, 12:03 pm

Re: Creating a debug build on Linux

Post by Tonttu »

I got some more tips. I disabled optimization and PGO. Still no symbols, though.

Here is the current iteration:

Code: Select all

ac_add_options --enable-application=browser
ac_add_options --prefix=/usr
ac_add_options --enable-gold
ac_add_options --enable-rust
ac_add_options --enable-pie
#ac_add_options --enable-release
ac_add_options --enable-official-branding
#ac_add_options --enable-update-channel=release
# System libraries
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-png
ac_add_options --with-system-libevent
ac_add_options --with-system-libvpx
ac_add_options --with-system-icu
ac_add_options --enable-system-hunspell
ac_add_options --enable-system-sqlite
ac_add_options --enable-system-ffi
#ac_add_options --enable-system-cairo
ac_add_options --enable-system-pixman
ac_add_options --disable-libproxy
#ac_add_options --enable-shared-js
# Features
ac_add_options --enable-startup-notification
ac_add_options --enable-pulseaudio
ac_add_options --disable-gio
ac_add_options --disable-gconf
ac_add_options --disable-crashreporter
ac_add_options --disable-tests
ac_add_options --disable-updater
#ac_add_options --disable-debug-symbols
ac_add_options --disable-install-strip
#STRIP_FLAGS="--strip-debug"

# Optimization
#ac_add_options --enable-optimize
ac_add_options --disable-optimize 
ac_add_options --enable-debug-symbols="-gdwarf-2"
# PGO
#mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
#export BUILD_OFFICIAL=1
#export MOZILLA_OFFICIAL=1
export MOZ_DEBUG_SYMBOLS=1
#mk_add_options BUILD_OFFICIAL=1
#mk_add_options MOZILLA_OFFICIAL=1
mk_add_options MOZ_DEBUG_SYMBOLS=1
Tonttu
Posts: 12
Joined: April 5th, 2011, 12:03 pm

Re: Creating a debug build on Linux

Post by Tonttu »

I got help elsewhere. The mozconfig was fine and I needed to change a line in the PKGBUILD like so:
options=('!emptydirs' '!strip' )

Thanks to barbaz for the support in any case :)
Post Reply