diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2016-08-02 03:00:13 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2016-08-02 14:45:50 +0000 |
commit | a06a8b192fb3a286c25240a52666a8cf029abbe3 (patch) | |
tree | 1b4aaea63dcd45291a6e65520ab5cf888aea6d0c | |
parent | 2972516f681fc390f3472f67902d6ac1860bf04a (diff) |
Removed libdwarf build dependency
Building libbacktrace is actually hard, since (a) there is no pkg-config
available for libdwarf, and (b) there's both libdwarf and libdw providing
dwarf.h.
Since we just need a couple of #defines, it is way easier to define those
ourselves than dealing with this config mess.
Change-Id: Ib1d8e88fe6104827fe3a2bcc5e8c1ff9f52f00df
Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
-rw-r--r-- | 3rdparty/libbacktrace/auxincl/dwarf2.h | 82 | ||||
-rw-r--r-- | application-manager.pro | 11 | ||||
-rw-r--r-- | config.tests/libdwarf/libdwarf.pro | 5 | ||||
-rw-r--r-- | config.tests/libdwarf/main.cpp | 47 | ||||
-rw-r--r-- | doc/installation.qdoc | 3 | ||||
-rw-r--r-- | qmake-features/am-config.prf | 2 |
6 files changed, 74 insertions, 76 deletions
diff --git a/3rdparty/libbacktrace/auxincl/dwarf2.h b/3rdparty/libbacktrace/auxincl/dwarf2.h index 77da76ff..205df8d2 100644 --- a/3rdparty/libbacktrace/auxincl/dwarf2.h +++ b/3rdparty/libbacktrace/auxincl/dwarf2.h @@ -32,26 +32,78 @@ POSSIBILITY OF SUCH DAMAGE. */ #ifndef BACKTRACE_AUX_DWARF2_H #define BACKTRACE_AUX_DWARF2_H -/* Use the system header for the bulk of the definitions. */ -#ifdef HAVE_LIBDWARF_DWARF_H -#include <libdwarf/dwarf.h> -#else -#include <dwarf.h> -#endif - /* Provide stub enum tags. */ enum dwarf_attribute {_dummy_dwarf_attribute}; enum dwarf_form {_dummy_dwarf_form}; enum dwarf_tag {_dummy_dwarf_tag}; -/* Define potentially missing enum values. */ +#define DW_AT_abstract_origin 0x31 +#define DW_AT_call_file 0x58 +#define DW_AT_call_line 0x59 +#define DW_AT_comp_dir 0x1b +#define DW_AT_high_pc 0x12 +#define DW_AT_linkage_name 0x6e +#define DW_AT_low_pc 0x11 +#define DW_AT_MIPS_linkage_name 0x2007 +#define DW_AT_name 0x03 +#define DW_AT_namelist_item 0x44 +#define DW_AT_ranges 0x55 +#define DW_AT_ranges_base 0x74 +#define DW_AT_specification 0x47 +#define DW_AT_stmt_list 0x10 +#define DW_FORM_addr 0x01 +#define DW_FORM_addrx 0x1b +#define DW_FORM_block 0x09 +#define DW_FORM_block1 0x0a +#define DW_FORM_block2 0x03 +#define DW_FORM_block4 0x04 +#define DW_FORM_data1 0x0b +#define DW_FORM_data16 0x1e +#define DW_FORM_data2 0x05 +#define DW_FORM_data4 0x06 +#define DW_FORM_data8 0x07 +#define DW_FORM_exprloc 0x18 +#define DW_FORM_flag 0x0c +#define DW_FORM_flag_present 0x19 #define DW_FORM_GNU_addr_index 0x1f01 -#define DW_FORM_GNU_str_index 0x1f02 - -#define DW_FORM_GNU_ref_alt 0x1f20 -#define DW_FORM_GNU_strp_alt 0x1f21 - -#define DW_LNS_extended_op 0 +#define DW_FORM_GNU_ref_alt 0x1f20 +#define DW_FORM_GNU_str_index 0x1f02 +#define DW_FORM_GNU_strp_alt 0x1f21 +#define DW_FORM_indirect 0x16 +#define DW_FORM_ref1 0x11 +#define DW_FORM_ref2 0x12 +#define DW_FORM_ref4 0x13 +#define DW_FORM_ref8 0x14 +#define DW_FORM_ref_addr 0x10 +#define DW_FORM_ref_sig8 0x20 +#define DW_FORM_ref_udata 0x15 +#define DW_FORM_sdata 0x0d +#define DW_FORM_sec_offset 0x17 +#define DW_FORM_string 0x08 +#define DW_FORM_strp 0x0e +#define DW_FORM_strp_sup 0x1d +#define DW_FORM_udata 0x0f +#define DW_LNE_define_file 0x03 +#define DW_LNE_define_file_MD5 0x05 +#define DW_LNE_end_sequence 0x01 +#define DW_LNE_set_address 0x02 +#define DW_LNE_set_discriminator 0x04 +#define DW_LNS_advance_line 0x03 +#define DW_LNS_advance_pc 0x02 +#define DW_LNS_const_add_pc 0x08 +#define DW_LNS_copy 0x01 +#define DW_LNS_extended_op 0x00 +#define DW_LNS_fixed_advance_pc 0x09 +#define DW_LNS_negate_stmt 0x06 +#define DW_LNS_set_basic_block 0x07 +#define DW_LNS_set_column 0x05 +#define DW_LNS_set_epilogue_begin 0x0b +#define DW_LNS_set_file 0x04 +#define DW_LNS_set_isa 0x0c +#define DW_LNS_set_prologue_end 0x0a +#define DW_TAG_compile_unit 0x11 +#define DW_TAG_entry_point 0x03 +#define DW_TAG_inlined_subroutine 0x1d +#define DW_TAG_subprogram 0x2e #endif - diff --git a/application-manager.pro b/application-manager.pro index d77acf8a..028e2037 100644 --- a/application-manager.pro +++ b/application-manager.pro @@ -5,7 +5,6 @@ qtCompileTest(libarchive) qtCompileTest(libyaml) qtCompileTest(libdbus) qtCompileTest(libcrypto) -qtCompileTest(libdwarf) force-single-process:force-multi-process:error("You cannot both specify force-single-process and force-multi-process") force-multi-process:!headless:!qtHaveModule(compositor):!qtHaveModule(waylandcompositor):error("You forced multi-process mode, but the QtCompositor module is not available") @@ -27,11 +26,11 @@ load(am-config) !config_libyaml:SUBDIRS += 3rdparty/libyaml/libyaml.pro enable-libbacktrace|CONFIG(debug, debug|release) { - config_libdwarf { - check_libbacktrace = "yes" - SUBDIRS += 3rdparty/libbacktrace/libbacktrace.pro - } else:check_libbacktrace = "no (libdwarf headers not found)" -} else:check_libbacktrace = "no" + check_libbacktrace = "yes" + SUBDIRS += 3rdparty/libbacktrace/libbacktrace.pro +} else { + check_libbacktrace = "no" +} if(linux|force-libcrypto):check_crypto = "libcrypto / OpenSSL" else:win32:check_crypto = "WinCrypt" diff --git a/config.tests/libdwarf/libdwarf.pro b/config.tests/libdwarf/libdwarf.pro deleted file mode 100644 index c404c538..00000000 --- a/config.tests/libdwarf/libdwarf.pro +++ /dev/null @@ -1,5 +0,0 @@ -TARGET = libdwarf -CONFIG -= qt -CONFIG += console - -SOURCES += main.cpp diff --git a/config.tests/libdwarf/main.cpp b/config.tests/libdwarf/main.cpp deleted file mode 100644 index d1bd6617..00000000 --- a/config.tests/libdwarf/main.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Pelagicore Application Manager. -** -** $QT_BEGIN_LICENSE:LGPL-QTAS$ -** Commercial License Usage -** Licensees holding valid commercial Qt Automotive Suite licenses may use -** this file in accordance with the commercial license agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and The Qt Company. For -** licensing terms and conditions see https://www.qt.io/terms-conditions. -** For further information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -** SPDX-License-Identifier: LGPL-3.0 -** -****************************************************************************/ - -#include <libdwarf/dwarf.h> - -int main() -{ - return 0; -} diff --git a/doc/installation.qdoc b/doc/installation.qdoc index 8bd00266..69e8ecbc 100644 --- a/doc/installation.qdoc +++ b/doc/installation.qdoc @@ -41,7 +41,6 @@ components: \li \b openssl 1.0 or higher \e{- Linux only}. At compile time only the headers need to be available. The needed libraries will be dynamically loaded at runtime. \li \b libarchive 3.0 or higher \e{- only if you need the installer functionality}. - \li \b libdwarf \e{- Linux only}. This is a compile-time only dependency for libbacktrace. \endlist On a Debian based systems, this command should install all the required packages: @@ -107,7 +106,7 @@ There are various options that can be given to \c qmake to tailor the build to y \row \li \c{-config enable-libbacktrace} \li Enables building and linking against \c libbacktrace in the 3rdparty folder. This will give - you readable backtraces on crash. You need the \c libdwarf header files during compilation. + you readable backtraces on crash, but will also increase the binary size slightly. \endtable \section2 The hardware-id diff --git a/qmake-features/am-config.prf b/qmake-features/am-config.prf index 61817bbf..53ce18c7 100644 --- a/qmake-features/am-config.prf +++ b/qmake-features/am-config.prf @@ -11,7 +11,7 @@ win32-msvc*:QMAKE_CXXFLAGS += /FS /wd4290 /DNOMINMAX /D_CRT_SECURE_NO_WARNINGS disable-installer:DEFINES *= AM_DISABLE_INSTALLER systemd-workaround:DEFINES *= AM_SYSTEMD_WORKAROUND headless:DEFINES *= AM_HEADLESS -if(enable-libbacktrace|CONFIG(debug, debug|release)):config_libdwarf:DEFINES *= AM_USE_LIBBACKTRACE +if(enable-libbacktrace|CONFIG(debug, debug|release)):DEFINES *= AM_USE_LIBBACKTRACE !force-single-process { linux:if(qtHaveModule(compositor)|qtHaveModule(waylandcompositor)|headless):config_libdbus:CONFIG *= auto-multi-process |