2

QT Version used: 5.12.6

I'm trying to build the example from QTWebEngine (quicknanobrowser) with debug symbols. I kept getting a binary without debug symbols, even when explicitly setting CONFIG+=debug or CONFIG+=debug nostrip.

After many troubleshooting I noticed the generated Makefile to indeed have -g flag to enable symbols, but it also has the -s flag to strip them. However, I can't seem to find why it's adding this -s flag.

.pro file:

requires(qtConfig(accessibility))

TEMPLATE = app
TARGET = quicknanobrowser

HEADERS = utils.h
SOURCES = main.cpp
CONFIG+= debug

OTHER_FILES += ApplicationRoot.qml \
               BrowserDialog.qml \
               BrowserWindow.qml \
               DownloadView.qml \
               FullScreenNotification.qml

RESOURCES += resources.qrc

QT += qml quick webengine

qtHaveModule(widgets) {
    QT += widgets # QApplication is required to get native styling with QtQuickControls
}

target.path = $$[QT_INSTALL_EXAMPLES]/webengine/quicknanobrowser
INSTALLS += target

Piece of generated Makefile:

LFLAGS        = -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$$ORIGIN/../../../../5.12.6/gcc_64/lib -Wl,-rpath,\$$ORIGIN/../../../../5.12.6/gcc_64/lib -Wl,-rpath-link,/home/amol/code/QTJimber/qtwebengine/lib -Wl,-rpath-link,/home/amol/Qt/5.12.6/gcc_64/lib -s

If I manually remove the -s flag from the Makefile I can get a binary with symbols, but that can't seem to be intended..

Edit
Output of adding message(CONFIG: $$CONFIG) message(QMAKE_LFLAGS: $$QMAKE_LFLAGS) message(QMAKE_LFLAGS_DEBUG: $$QMAKE_LFLAGS_DEBUG) message(QMAKE_LFLAGS_RELEASE: $$QMAKE_LFLAGS_RELEASE) message(QMAKESPEC: $$QMAKESPEC) to .pro file:

Project MESSAGE: CONFIG: lex yacc debug exceptions depend_includepath testcase_targets import_plugins import_qpa_plugin qt_build_extra file_copies qmake_use qt warn_on release link_prl incremental shared release linux unix posix gcc sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples enable_new_dtags f16c force_debug_info largefile precompile_header rdrnd shani x86SimdAlways prefix_build force_independent utf8_source create_prl link_prl prepare_docs qt_docs_targets no_private_qt_headers_warning QTDIR_build qt_example_installs exceptions_off testcase_exceptions explicitlib warning_clean debug
Project MESSAGE: QMAKE_LFLAGS:
Project MESSAGE: QMAKE_LFLAGS_DEBUG:
Project MESSAGE: QMAKE_LFLAGS_RELEASE: -Wl,-O1
Project MESSAGE: QMAKESPEC: /home/amol/Qt/5.12.6/gcc_64/mkspecs/linux-g++
Alexander Mol
  • 21
  • 1
  • 4
  • 1
    Hi and welcome to the site! Would you please try to re-phrase the post into an actual question? It would also be helpful to include some error messages you have been getting. – Dávid Tóth Nov 14 '19 at 18:24
  • I do not get error messages, it simply does not do what I would suspect it do to – Alexander Mol Nov 14 '19 at 22:12
  • 1
    Please add following lines to your `.pro` file, run `qmake` and post the output: `message(CONFIG: $$CONFIG) message(QMAKE_LFLAGS: $$QMAKE_LFLAGS) message(QMAKE_LFLAGS_DEBUG: $$QMAKE_LFLAGS_DEBUG) message(QMAKE_LFLAGS_RELEASE: $$QMAKE_LFLAGS_RELEASE) message(QMAKESPEC: $$QMAKESPEC)` Most likely the `-s` flag is set somewhere in `mkspecs` for your build config, but it's hard to say where exactly with the provided info. I've checked my `mkspecs` and it seems that flag is only set for `QMAKE_LFLAGS_RELEASE`. In that case it can be disabled with `QMAKE_LFLAGS_RELEASE -= -s` – VVV Nov 15 '19 at 04:40
  • I tried adding `QMAKE_LFLAGS_RELEASE -= -s`, `QMAKE_LFLAGS_DEBUG -= -s` and `QMAKE_LFLAGS -= -s` but the Makefile still contained the `-s` flag – Alexander Mol Nov 15 '19 at 14:11

1 Answers1

0

https://doc.qt.io/qt-5/qmake-variable-reference.html

nostrip - If set, the typical Unix strip functionality is turned off and the debug information will remain in the binary.