public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Fix build on debian 7
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20190709090453.GA30780@delia> (raw)

Hi,

On debian 7, we run into:
...
dwz.c: In function ‘read_dwarf’:
dwz.c:10211:34: error: ‘SHF_COMPRESSED’ undeclared
...

Glibc defines SHF_COMPRESSED starting v2.22, and libelf has a fallback
definition starting v0.166, which are both not present here.

Fix this by adding a fallback definition in dwz.c.

Committed to trunk.

Thanks,
- Tom

Fix build on debian 7

2019-07-09  Tom de Vries  <tdevries@suse.de>

	* dwz.c (SHF_COMPRESSED): Define if not defined.

---
 dwz.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dwz.c b/dwz.c
index 98f6f53..13f67f2 100644
--- a/dwz.c
+++ b/dwz.c
@@ -40,6 +40,13 @@
 #include "hashtab.h"
 #include "sha1.h"
 
+#ifndef SHF_COMPRESSED
+ /* Glibc elf.h contains SHF_COMPRESSED starting v2.22.  Libelf libelf.h has
+    a fallback definition starting v0.166.  Define a fallback definition here
+    for the case of both pre-v2.22 glibc and pre-v0.166 libelf.  */
+# define SHF_COMPRESSED (1 << 11)  /* Section with compressed data.  */
+#endif
+
 /* Theory of operation:
    The DWZ tool can either optimize debug sections of a single
    executable or shared library at a time, or, when -m option

                 reply	other threads:[~2019-07-09  9:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190709090453.GA30780@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).