From 295a6a28837307dfe16d7ce26c70e7c4f36b81e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Wed, 21 Jun 2017 12:05:45 +0200
Subject: LibDWARF: Applying patches


diff --git a/dwarfdump/Makefile.in b/dwarfdump/Makefile.in
index 415a1a6..c110495 100644
--- a/dwarfdump/Makefile.in
+++ b/dwarfdump/Makefile.in
@@ -212,9 +212,11 @@ selftest:
 # will work and leave sensible permissions on the resulting files.
 # Some adjustment might be required, see README.
 install: all
-	$(INSTALL) dwarfdump $(bindir)/dwarfdump
-	$(INSTALL) $(srcdir)/dwarfdump.conf $(libdir)/dwarfdump.conf
-	$(INSTALL) $(srcdir)/dwarfdump.1 $(man1dir)/dwarfdump.1
+	install -m 0755 -d $(bindir)
+	install -m 0755 -d $(man1dir)
+	install -m 0755  dwarfdump $(bindir)
+	install -m 0755  dwarfdump.conf $(libdir)
+	install -m 0755  dwarfdump.1 $(man1dir)
 
 uninstall:
 	-rm -f $(bindir)/dwarfdump
diff --git a/libdwarf/Makefile.in b/libdwarf/Makefile.in
index 355d2df..ce1c445 100644
--- a/libdwarf/Makefile.in
+++ b/libdwarf/Makefile.in
@@ -227,7 +227,11 @@ clean:
 	rm -f *~
 
 install: all
-	echo "No install provided, see comments in the README"
+	install -m 0755 -d $(incdir)
+	install -m 0755 -d $(libdir)
+	install -m 0755 libdwarf.h $(incdir)
+	install -m 0755 dwarf.h $(incdir)
+	install -m 0755 libdwarf.so $(libdir)
 
 distclean:	clean
 	rm -f config.status config.log config.cache config.h
diff --git a/libdwarf/gennames.c b/libdwarf/gennames.c
index a033f60..c12baf9 100644
--- a/libdwarf/gennames.c
+++ b/libdwarf/gennames.c
@@ -547,8 +547,8 @@ ParseDefinitionsAndWriteOutput(void)
         /*  errno is cleared here so printing errno after
             the fgets is showing errno as set by fgets. */
         char *fgbad = 0;
-        errno = 0;
         fgbad = fgets(line_in,sizeof(line_in),f_dwarf_in);
+        errno = 0;
         if(!fgbad) {
             if(feof(f_dwarf_in)) {
                 break;
-- 
2.7.0


From 933601827fb4ac569ebc7538ae46f2d023809042 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Wed, 21 Jun 2017 12:06:12 +0200
Subject: Hardlinks not supported on BFS


diff --git a/libdwarf/Makefile.in b/libdwarf/Makefile.in
index ce1c445..98513b6 100644
--- a/libdwarf/Makefile.in
+++ b/libdwarf/Makefile.in
@@ -137,7 +137,7 @@ libdwarf.a: dwarf_names.h dwarf_names.c  $(OBJS) dwarf_names.o
 
 libdwarf.so: dwarf_names.h dwarf_names.c $(OBJS) dwarf_names.o
 	$(CC) $(CFLAGS) $(LDFLAGS) -shared $(OBJS) -Wl,-soname=$(SONAME)  dwarf_names.o $(dwfzlib) -o $@
-	ln libdwarf.so $(SONAME)
+	ln -s libdwarf.so $(SONAME)
 
 nosharedlibrary:
 	echo "Not building shared library libdwarf.so"
-- 
2.7.0


From fd415eb7aa4df529183f31688b0f12ab757d78a6 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 7 Oct 2017 12:38:02 +0200
Subject: va_copy, gcc2 fix


diff --git a/dwarfdump/esb.c b/dwarfdump/esb.c
index 76e64ff..4991a22 100644
--- a/dwarfdump/esb.c
+++ b/dwarfdump/esb.c
@@ -288,7 +288,9 @@ esb_allocate_more_if_needed(struct esb_s *data,
     va_list ap_copy;
 
     /* Preserve the original argument list, to be used a second time */
-    va_copy(ap_copy,ap);
+    #if __GNUC__ == 2
+    #define va_copy(ap_copy,ap) __va_copy(ap_copy,ap);
+    #endif
 
 #ifdef _WIN32
     netlen = vfprintf(null_device_handle,in_string,ap_copy);
-- 
2.7.0

