Merged in munchausen/haikuports (pull request #116)

Update libelf-0.8.13 and libdwarf for PM
This commit is contained in:
Scott McCreary
2014-01-06 08:26:21 -08:00
3 changed files with 308 additions and 13 deletions

View File

@@ -0,0 +1,91 @@
SUMMARY="libdwarf and dwarfdump - library and utility for working with DWARF Debugging Information Format"
DESCRIPTION="
DWARF is a widely used, standardized debugging data format. DWARF was \
originally designed along with Executable and Linkable Format (ELF), although \
it is independent of object file formats. The name is a medieval fantasy \
complement to ELF that has no official meaning, although the backronym \
'Debugging With Attributed Record Formats' was later proposed.
The DWARF Debugging Information Format is of interest to programmers working on \
compilers and debuggers (and anyone interested in reading or writing DWARF \
information). DWARF uses a data structure called a Debugging Information Entry \
(DIE) to represent each variable, type, procedure, etc. It was developed by a \
committee (known as the PLSIG at the time) starting around 1991. Starting \
around 1991 SGI developed the libdwarf and dwarfdump tools for internal use and \
as part of SGI IRIX developer tools. Since that time dwarfdump and libdwarf \
have been shipped (as an executable and archive respectively, not source) with \
every release of the SGI MIPS/IRIX C compiler. In 1994 (I think the correct \
year) SGI agreed to open-source libdwarf (and in 1999 to open-source dwarfdump) \
so anyone could use them.
libdwarf allows reading, creation and manipulation of dwarf data. dwarfdump \
(written in C) and dwarfdump2 (written in C++) do the same job, they let you \
dump out, in readable form, the DWARF2, DWARF3, or DWARF4 data from an object \
file, but dwarfdump2 does a better job in some respects.
This package includes dwarfdump2 and libdwarf, although the source package has \
been patched to make dwarfdump and dwarfgen haiku compatible as well.
"
HOMEPAGE="http://www.prevanders.net/dwarf.html"
SRC_URI="http://www.prevanders.net/libdwarf-20130729.tar.gz"
CHECKSUM_MD5="4cc5e48693f7b93b7aa0261e63c0e21d"
LICENSE="
GNU GPL v2
GNU LGPL v2.1
"
COPYRIGHT="
2000,2002,2004,2005 Silicon Graphics, Inc. All Rights Reserved.
2007-2010 David Anderson. All Rights Reserved.
2007-2010 Sun Microsystems, Inc. All rights reserved
"
REVISION="1"
ARCHITECTURES="x86 x86_gcc2"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
SOURCE_DIR="dwarf-$portVersion"
PATCHES="libdwarf-20130729.patch"
PROVIDES="
lib:libdwarf$secondaryArchSuffix = $portVersion
cmd:dwarfdump = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
lib:libelf$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
devel:libelf$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
"
BUILD()
{
cd libdwarf
runConfigure ./configure --enable-shared
make
cd ../dwarfdump2
LDFLAGS="-L../libdwarf" ./configure $configureDirArgs
LIBRARY_PATH=$LIBRARY_PATH:%A/../libdwarf make
}
INSTALL()
{
cd libdwarf
make install bindir=$binDir libdir=$libDir incdir=$includeDir
cd ../dwarfdump2
make install mandir=$manDir
packageEntries devel $developDir
}
PROVIDES_devel="
libdwarf${secondaryArchSuffix}_devel = $portVersion
devel:libdwarf$secondaryArchSuffix = $portVersion
"
REQUIRES_devel="
lib:libdwarf$secondaryArchSuffix == $portVersion base
"

View File

@@ -0,0 +1,168 @@
diff -Naur dwarf-20130729/dwarfdump/Makefile.in dwarf-20130729-c89/dwarfdump/Makefile.in
--- dwarf-20130729/dwarfdump/Makefile.in 2013-02-02 19:13:55.031981568 +0000
+++ dwarf-20130729-c89/dwarfdump/Makefile.in 2014-01-06 11:16:30.116916224 +0000
@@ -154,9 +154,11 @@
# 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 -Naur dwarf-20130729/dwarfdump/print_die.c dwarf-20130729-c89/dwarfdump/print_die.c
--- dwarf-20130729/dwarfdump/print_die.c 2013-02-06 20:48:07.024903680 +0000
+++ dwarf-20130729-c89/dwarfdump/print_die.c 2014-01-06 11:16:30.131596288 +0000
@@ -3380,6 +3380,7 @@
we have a serious botch. this FORM
defines the value as a .debug_info
global offset. */
+ int res = 0;
Dwarf_Off cuoff = 0;
Dwarf_Off culen = 0;
Dwarf_Off die_overall_offset = 0;
@@ -3399,7 +3400,7 @@
print_error(dbg,small_buf,DW_DLV_OK,0);
}
- int res = dwarf_die_CU_offset_range(die,&cuoff,
+ res = dwarf_die_CU_offset_range(die,&cuoff,
&culen,&err);
DWARF_CHECK_COUNT(tag_tree_result,1);
if (res != DW_DLV_OK) {
diff -Naur dwarf-20130729/dwarfdump2/dwarfdump.cc dwarf-20130729-c89/dwarfdump2/dwarfdump.cc
--- dwarf-20130729/dwarfdump2/dwarfdump.cc 2013-07-30 16:12:36.033292288 +0000
+++ dwarf-20130729-c89/dwarfdump2/dwarfdump.cc 2014-01-06 11:19:43.419168256 +0000
@@ -47,6 +47,9 @@
#include <vector>
#include <algorithm> // for sort
#include <iomanip>
+#if __GNUC__ == 2
+#include <streambuf.h>
+#endif
/* for 'open' */
#include <sys/types.h>
@@ -2413,7 +2416,11 @@
Compiler *pCompiler, Dwarf_Check_Categories category)
{
Dwarf_Check_Result result = pCompiler->results_[category];
+#if __GNUC__ == 2
+ cerr << std::setw(24) << ios::left << str <<
+#else
cerr << std::setw(24) << std::left << str <<
+#endif
IToDec(result.checks_,10) <<
" " <<
IToDec(result.errors_,10) << endl;
diff -Naur dwarf-20130729/dwarfdump2/Makefile.in dwarf-20130729-c89/dwarfdump2/Makefile.in
--- dwarf-20130729/dwarfdump2/Makefile.in 2013-02-02 19:16:44.038797312 +0000
+++ dwarf-20130729-c89/dwarfdump2/Makefile.in 2014-01-06 12:53:29.018350080 +0000
@@ -133,9 +133,11 @@
# 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.1 $(man1dir)/dwarfdump.1
- $(INSTALL) $(srcdir)/dwarfdump.conf $(libdir)/dwarfdump.conf
+ 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 -Naur dwarf-20130729/dwarfgen/createirepformfrombinary.cc dwarf-20130729-c89/dwarfgen/createirepformfrombinary.cc
--- dwarf-20130729/dwarfgen/createirepformfrombinary.cc 2013-02-01 16:20:06.020971520 +0000
+++ dwarf-20130729-c89/dwarfgen/createirepformfrombinary.cc 2014-01-06 11:16:30.163577856 +0000
@@ -28,7 +28,6 @@
#include <string.h> // For memset etc
#include <sys/stat.h> //open
#include <fcntl.h> //open
-#include "elf.h"
#include "gelf.h"
#include "strtabdata.h"
#include "dwarf.h"
diff -Naur dwarf-20130729/dwarfgen/createirepfrombinary.cc dwarf-20130729-c89/dwarfgen/createirepfrombinary.cc
--- dwarf-20130729/dwarfgen/createirepfrombinary.cc 2013-02-01 16:20:11.022282240 +0000
+++ dwarf-20130729-c89/dwarfgen/createirepfrombinary.cc 2014-01-06 11:16:30.171442176 +0000
@@ -30,7 +30,6 @@
#include <string.h> // For memset etc
#include <sys/stat.h> //open
#include <fcntl.h> //open
-#include "elf.h"
#include "gelf.h"
#include "strtabdata.h"
#include "dwarf.h"
diff -Naur dwarf-20130729/dwarfgen/dwarfgen.cc dwarf-20130729-c89/dwarfgen/dwarfgen.cc
--- dwarf-20130729/dwarfgen/dwarfgen.cc 2013-02-01 16:20:17.023330816 +0000
+++ dwarf-20130729-c89/dwarfgen/dwarfgen.cc 2014-01-06 11:16:30.179830784 +0000
@@ -56,8 +56,8 @@
#include <string.h> // For memset etc
#include <sys/stat.h> //open
#include <fcntl.h> //open
+#include <stdint.h>
#include "general.h"
-#include "elf.h"
#include "gelf.h"
#include "strtabdata.h"
#include "dwarf.h"
diff -Naur dwarf-20130729/dwarfgen/irepattrtodbg.cc dwarf-20130729-c89/dwarfgen/irepattrtodbg.cc
--- dwarf-20130729/dwarfgen/irepattrtodbg.cc 2013-02-01 16:20:21.021495808 +0000
+++ dwarf-20130729-c89/dwarfgen/irepattrtodbg.cc 2014-01-06 11:16:30.192937984 +0000
@@ -30,7 +30,6 @@
#include <sys/stat.h> //open
#include <fcntl.h> //open
#include "general.h"
-#include "elf.h"
#include "gelf.h"
#include "strtabdata.h"
#include "dwarf.h"
diff -Naur dwarf-20130729/dwarfgen/ireptodbg.cc dwarf-20130729-c89/dwarfgen/ireptodbg.cc
--- dwarf-20130729/dwarfgen/ireptodbg.cc 2013-02-01 16:20:26.022544384 +0000
+++ dwarf-20130729-c89/dwarfgen/ireptodbg.cc 2014-01-06 11:16:30.201064448 +0000
@@ -28,7 +28,6 @@
#include <string.h> // For memset etc
#include <sys/stat.h> //open
#include <fcntl.h> //open
-#include "elf.h"
#include "gelf.h"
#include "strtabdata.h"
#include "dwarf.h"
diff -Naur dwarf-20130729/libdwarf/gennames.c dwarf-20130729-c89/libdwarf/gennames.c
--- dwarf-20130729/libdwarf/gennames.c 2013-01-25 19:09:11.056885248 +0000
+++ dwarf-20130729-c89/libdwarf/gennames.c 2014-01-06 11:16:30.209715200 +0000
@@ -486,8 +486,8 @@
/* Process each line from 'dwarf.h' */
while (!feof(f_dwarf_in)) {
- errno = 0;
char *fgbad = fgets(line_in,sizeof(line_in),f_dwarf_in);
+ errno = 0;
if(!fgbad) {
if(feof(f_dwarf_in)) {
break;
diff -Naur dwarf-20130729/libdwarf/Makefile.in dwarf-20130729-c89/libdwarf/Makefile.in
--- dwarf-20130729/libdwarf/Makefile.in 2013-07-28 17:58:54.056885248 +0000
+++ dwarf-20130729-c89/libdwarf/Makefile.in 2014-01-06 11:16:30.217055232 +0000
@@ -213,8 +214,11 @@
rm -f dwarf_names_enum.h dwarf_names_new.h dwarf_names.c dwarf_names.h
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
rm -rf autom4te.cache

View File

@@ -1,24 +1,60 @@
DESCRIPTION="libelf - ELF object file access library"
SUMMARY="libelf - ELF object file access library"
DESCRIPTION="
Libelf lets you read, modify or create ELF files in an architecture-independent \
way. The library takes care of size and endian issues, e.g. you can process a \
file for SPARC processors on an Intel-based system. This library is a \
clean-room rewrite of the System V Release 4 library and is source code \
compatible with it.
"
HOMEPAGE="http://www.mr511.de/software/english.html"
SRC_URI="http://www.mr511.de/software/libelf-0.8.13.tar.gz"
CHECKSUM_MD5="4136d7b4c04df68b686570afa26988ac"
LICENSE="GNU LGPL v2"
COPYRIGHT="1995-2008 Michael Riepe"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
ARCHITECTURES="x86 x86_gcc2"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PATCHES="libelf-0.8.13.patch"
PROVIDES="
lib:libelf$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize
cmd:autoreconf
cmd:make
"
BUILD()
{
cd libelf-0.8.13
libtoolize -fci
autoreconf
./configure --enable-gnu-names --prefix=$(finddir B_COMMON_DIRECTORY)
make
libtoolize -fci
autoreconf
runConfigure ./configure
make
}
INSTALL()
{
cd libelf-0.8.13
make install instroot=$DESTDIR
make install-compat instroot=$DESTDIR
make install
make install-compat
prepareInstalledDevelLib libelf
packageEntries devel $developDir
}
LICENSE="GNU LGPL v2"
COPYRIGHT="1995-2008 Michael Riepe"
PROVIDES_devel="
libelf${secondaryArchSuffix}_devel = $portVersion
devel:libelf$secondaryArchSuffix = $portVersion
"
REQUIRES_devel="
lib:libelf$secondaryArchSuffix == $portVersion base
"