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++