diff --git a/dwarf-compilation.base/contrib/libcxxfileno/.gitignore b/dwarf-compilation.base/contrib/libcxxfileno/.gitignore new file mode 100644 index 0000000..e753181 --- /dev/null +++ b/dwarf-compilation.base/contrib/libcxxfileno/.gitignore @@ -0,0 +1,77 @@ +/Makefile + +__pycache__/ +*.py[cod] + +.deps/ +.libs/ + + +# http://www.gnu.org/software/automake + +Makefile.in + +# http://www.gnu.org/software/autoconf + +/autom4te.cache +/aclocal.m4 +/compile +/configure +/depcomp +/install-sh +/missing +/stamp-h1 +/m4/ +/config.guess +/config.sub +/config.status +/config.log +/ltmain.sh +/libtool + + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +*.pc + +# Dependencies +.*.d + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + + +# Backup files +*~ +\#*\# +.\#* + +# WTF Dropbox + +.fuse_hidden* +.nfs* +.dropbox* diff --git a/dwarf-compilation.base/contrib/libcxxfileno/INSTALL b/dwarf-compilation.base/contrib/libcxxfileno/INSTALL new file mode 100644 index 0000000..658198b --- /dev/null +++ b/dwarf-compilation.base/contrib/libcxxfileno/INSTALL @@ -0,0 +1,2 @@ +libtoolize && autoreconf -i && ./configure --prefix=(somewhere) && make && [sudo] make install + diff --git a/dwarf-compilation.base/contrib/libcxxfileno/Makefile.am b/dwarf-compilation.base/contrib/libcxxfileno/Makefile.am new file mode 100755 index 0000000..cab41a6 --- /dev/null +++ b/dwarf-compilation.base/contrib/libcxxfileno/Makefile.am @@ -0,0 +1,16 @@ +pkgincludedir=$(includedir) +ACLOCAL_AMFLAGS = -I m4 +lib_LTLIBRARIES = libc++fileno.la +libc__fileno_la_SOURCES = fileno.cpp +pkginclude_HEADERS = fileno.hpp +extra_DIST = libc++fileno.pc.in +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libc++fileno.pc + +lib/libc++fileno.so: $(lib_LTLIBRARIES) + mkdir -p lib && cd lib && ln -sf ../.libs/libc++fileno.so . + +lib/libc++fileno.so.0: $(lib_LTLIBRARIES) + mkdir -p lib && cd lib && ln -sf ../.libs/libc++fileno.so.0 . + +all: lib/libc++fileno.so lib/libc++fileno.so.0 diff --git a/dwarf-compilation.base/contrib/libcxxfileno/configure.ac b/dwarf-compilation.base/contrib/libcxxfileno/configure.ac new file mode 100755 index 0000000..3d58eb6 --- /dev/null +++ b/dwarf-compilation.base/contrib/libcxxfileno/configure.ac @@ -0,0 +1,15 @@ +AC_CONFIG_MACRO_DIR([m4]) +AC_PREREQ([2.69]) +AC_INIT([libc++fileno], [0.1], [srk31@cl.cam.ac.uk]) +LT_INIT +AC_CONFIG_SRCDIR([fileno.cpp]) +AC_LANG([C++]) +AM_INIT_AUTOMAKE([foreign subdir-objects]) +AM_MAINTAINER_MODE +AC_PROG_CXX +AX_CXX_COMPILE_STDCXX_11 +AC_PROG_LN_S +AC_PROG_INSTALL +PKG_PROG_PKG_CONFIG +AC_CHECK_HEADERS([cstdio fstream cerrno iosfwd ext/stdio_filebuf.h ext/stdio_sync_filebuf.h], [], [AC_MSG_FAILURE([required standard headers: cstdio fstream cerrno iosfwd ext/stdio_filebuf.h ext/stdio_sync_filebuf.h])]) +AC_OUTPUT([Makefile libc++fileno.pc]) diff --git a/dwarf-compilation.base/contrib/libcxxfileno/fileno.cpp b/dwarf-compilation.base/contrib/libcxxfileno/fileno.cpp new file mode 100644 index 0000000..97b755e --- /dev/null +++ b/dwarf-compilation.base/contrib/libcxxfileno/fileno.cpp @@ -0,0 +1,191 @@ +#include "fileno.hpp" +#include // just for __LIBCPP_VERSION + +#include // declaration of ::fileno +#include + +// for basic_filebuf template +#ifdef _LIBCPP_VERSION +#ifdef private +# error "why on earth is private #defined to something already?!" +#endif +// this is a very bad idea, never do this +# define private public +// no, seriously. +# include +# undef private +# undef class +#else +# include +#endif + + +#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0 +# include +#endif +#if defined(__GLIBCXX__) // GCC >= 3.4.0 +# include +#endif + +int cfileno(FILE *f) { + return ::fileno(f); +} + + +//! Similar to fileno(3), but taking a C++ stream as argument instead of a +//! FILE*. Note that there is no way for the library to track what you do with +//! the descriptor, so be careful. +//! \return The integer file descriptor associated with the stream, or -1 if +//! that stream is invalid. In the latter case, for the sake of keeping the +//! code as similar to fileno(3), errno is set to EBADF. +//! \see The upstream page at +//! http://www.ginac.de/~kreckel/fileno/ of this code provides more +//! detailed information. +template +inline int +fileno_hack(const std::basic_ios& stream) +{ + // Some C++ runtime libraries shipped with ancient GCC, Sun Pro, + // Sun WS/Forte 5/6, Compaq C++ supported non-standard file descriptor + // access basic_filebuf<>::fd(). Alas, starting from GCC 3.1, the GNU C++ + // runtime removes all non-standard std::filebuf methods and provides an + // extension template class __gnu_cxx::stdio_filebuf on all systems where + // that appears to make sense (i.e. at least all Unix systems). Starting + // from GCC 3.4, there is an __gnu_cxx::stdio_sync_filebuf, in addition. + // Sorry, darling, I must get brutal to fetch the darn file descriptor! + // Please complain to your compiler/libstdc++ vendor... +#if defined(__GLIBCXX__) || defined(__GLIBCPP__) + // OK, stop reading here, because it's getting obscene. Cross fingers! +# if defined(__GLIBCXX__) // >= GCC 3.4.0 + // This applies to cin, cout and cerr when not synced with stdio: + typedef __gnu_cxx::stdio_filebuf unix_filebuf_t; + unix_filebuf_t* fbuf = dynamic_cast(stream.rdbuf()); + if (fbuf != NULL) { + return fbuf->fd(); + } + + // This applies to filestreams: + typedef std::basic_filebuf filebuf_t; + filebuf_t* bbuf = dynamic_cast(stream.rdbuf()); + if (bbuf != NULL) { + // This subclass is only there for accessing the FILE*. Ouuwww, sucks! + struct my_filebuf : public std::basic_filebuf { + int fd() { return this->_M_file.fd(); } + }; + return static_cast(bbuf)->fd(); + } + + // This applies to cin, cout and cerr when synced with stdio: + typedef __gnu_cxx::stdio_sync_filebuf sync_filebuf_t; + sync_filebuf_t* sbuf = dynamic_cast(stream.rdbuf()); + if (sbuf != NULL) { +# if (__GLIBCXX__<20040906) // GCC < 3.4.2 + // This subclass is only there for accessing the FILE*. + // See GCC PR#14600 and PR#16411. + struct my_filebuf : public sync_filebuf_t { + my_filebuf(); // Dummy ctor keeps the compiler happy. + // Note: stdio_sync_filebuf has a FILE* as its first (but private) + // member variable. However, it is derived from basic_streambuf<> + // and the FILE* is the first non-inherited member variable. + FILE* c_file() { + return *(FILE**)((char*)this + sizeof(std::basic_streambuf)); + } + }; + return ::fileno(static_cast(sbuf)->c_file()); +# else + return ::fileno(sbuf->file()); +# endif + } +# else // GCC < 3.4.0 used __GLIBCPP__ +# if (__GLIBCPP__>=20020514) // GCC >= 3.1.0 + // This applies to cin, cout and cerr: + typedef __gnu_cxx::stdio_filebuf unix_filebuf_t; + unix_filebuf_t* buf = dynamic_cast(stream.rdbuf()); + if (buf != NULL) { + return buf->fd(); + } + + // This applies to filestreams: + typedef std::basic_filebuf filebuf_t; + filebuf_t* bbuf = dynamic_cast(stream.rdbuf()); + if (bbuf != NULL) { + // This subclass is only there for accessing the FILE*. Ouuwww, sucks! + struct my_filebuf : public std::basic_filebuf { + // Note: _M_file is of type __basic_file which has a + // FILE* as its first (but private) member variable. + FILE* c_file() { return *(FILE**)(&this->_M_file); } + }; + FILE* c_file = static_cast(bbuf)->c_file(); + if (c_file != NULL) { // Could be NULL for failed ifstreams. + return ::fileno(c_file); + } + } +# else // GCC 3.0.x + typedef std::basic_filebuf filebuf_t; + filebuf_t* fbuf = dynamic_cast(stream.rdbuf()); + if (fbuf != NULL) { + struct my_filebuf : public filebuf_t { + // Note: basic_filebuf has a __basic_file* as + // its first (but private) member variable. Since it is derived + // from basic_streambuf we can guess its offset. + // __basic_file in turn has a FILE* as its first (but + // private) member variable. Get it by brute force. Oh, geez! + FILE* c_file() { + std::__basic_file* ptr_M_file = *(std::__basic_file**)((char*)this + sizeof(std::basic_streambuf)); +# if _GLIBCPP_BASIC_FILE_INHERITANCE + // __basic_file inherits from __basic_file_base + return *(FILE**)((char*)ptr_M_file + sizeof(std::__basic_file_base)); +# else + // __basic_file is base class, but with vptr. + return *(FILE**)((char*)ptr_M_file + sizeof(void*)); +# endif + } + }; + return ::fileno(static_cast(fbuf)->c_file()); + } +# endif +# endif +#else +#ifdef _LIBCPP_VERSION // llvm libc++ + typedef std::basic_filebuf filebuf_t; + filebuf_t* fbuf = stream.rdbuf(); + template + struct my_filebuf : public filebuf_t { + FILE *c_file() { + return this->__file_; + } + }; + my_filebuf *my_fbuf = static_cast*>(fbuf); + if (my_fbuf != NULL && my_fbuf->c_file() != NULL) { + return cfileno(my_fbuf->c_file()); + } else { + errno = EBADF; + return -1; + } +#else +# error "Does anybody know how to fetch the bloody file descriptor?" + return stream.rdbuf()->fd(); // Maybe a good start? +#endif +#endif + errno = EBADF; + return -1; +} + + +//! 8-Bit character instantiation: fileno(ios). +template <> +int +fileno(const std::ios& stream) +{ + return fileno_hack(stream); +} + +#if !(defined(__GLIBCXX__) || defined(__GLIBCPP__)) || (defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCXX_USE_WCHAR_T)) +//! Wide character instantiation: fileno(wios). +template <> +int +fileno(const std::wios& stream) +{ + return fileno_hack(stream); +} +#endif diff --git a/dwarf-compilation.base/contrib/libcxxfileno/fileno.hpp b/dwarf-compilation.base/contrib/libcxxfileno/fileno.hpp new file mode 100644 index 0000000..032bd97 --- /dev/null +++ b/dwarf-compilation.base/contrib/libcxxfileno/fileno.hpp @@ -0,0 +1,4 @@ +#include + +template +int fileno(const std::basic_ios& stream); diff --git a/dwarf-compilation.base/contrib/libcxxfileno/include b/dwarf-compilation.base/contrib/libcxxfileno/include new file mode 120000 index 0000000..945c9b4 --- /dev/null +++ b/dwarf-compilation.base/contrib/libcxxfileno/include @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/dwarf-compilation.base/contrib/libcxxfileno/libc++fileno.pc.in b/dwarf-compilation.base/contrib/libcxxfileno/libc++fileno.pc.in new file mode 100644 index 0000000..f6a62da --- /dev/null +++ b/dwarf-compilation.base/contrib/libcxxfileno/libc++fileno.pc.in @@ -0,0 +1,14 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +pkgincludedir=${includedir}/@PACKAGE@ +pkglibdir=@pkglibdir@ +datarootdir=@datarootdir@ +datadir=@datadir@ + +Name: libc++fileno +Description: Stephen Kell's distribution of Richard Kreckel's fileno() function for popular implementations of the C++ standard library +Version: 0.1 +Cflags: -I${pkgincludedir} +Libs: -L${libdir} -lc++fileno diff --git a/dwarf-compilation.base/contrib/libdwarf/.gitignore b/dwarf-compilation.base/contrib/libdwarf/.gitignore new file mode 100644 index 0000000..2be1f91 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/.gitignore @@ -0,0 +1,3 @@ +*.[oa] +junk* +*~ diff --git a/dwarf-compilation.base/contrib/libdwarf/BLDLIBDWARF b/dwarf-compilation.base/contrib/libdwarf/BLDLIBDWARF new file mode 100755 index 0000000..c30ec0b --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/BLDLIBDWARF @@ -0,0 +1,29 @@ +#!/bin/sh +# +bldone () { + t=$1 + cd $t + # The following distclean will fail on a clean directory + # Ignore the failure + make distclean + ./configure + if [ $? != 0 ] + then + echo build failed + exit + fi + make + if [ $? != 0 ] + then + echo build failed + exit + fi + cd .. +} + +bldone libdwarf +bldone dwarfdump + + + + diff --git a/dwarf-compilation.base/contrib/libdwarf/BLDLIBDWARFTAR b/dwarf-compilation.base/contrib/libdwarf/BLDLIBDWARFTAR new file mode 100755 index 0000000..51f2105 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/BLDLIBDWARFTAR @@ -0,0 +1,44 @@ +#!/bin/sh +# +#newpref sets directory name with date, more +#like normal linux packages. +if [ $# != 1 ] +then + echo Usage: BLDLIBDWARFTAR yyyymmdd + echo Example: BLDLIBDWARFTAR 20040108 + exit 1 +fi +echo "This does not do UPDATEDWARFDUMPVERSION.sh" +echo "Make sure there are no unwanted files" +echo "in the code directories as all the files get" +echo "copied to the release tar file." +dat=$1 + +tmpf=dwarf +tmpdir=/var/tmp +# cptopublic knows /var/tmp/dwarf is the target +sh CPTOPUBLIC nouv +newpref=dwarf-${dat} +newf=libdwarf-${dat}.tar +echo src is $tmpdir/$tmpf tmp is $newpref target is $newf +echo ============ $newpref $newf ========== + +echo First create $tmpdir/$newpref with the latest source. +cd $tmpdir +if [ ! -d $tmpf ] +then + echo No $tmpdir/dwarf present! Do nothing. + exit 0 +fi +rm -rf $newpref + +cp -rp $tmpf $newpref +# Alter date below before using.e +rm -f ${newf} ${newf}.gz +tar cf /var/tmp/$newf $newpref +gzip ${newf} +hm=/home/davea/web4/gweb/pagedata +cp ${newf}.gz $hm +ls -l $tmpdir/${newf}.gz +ls -l $hm/${newf}.gz +exit 0 diff --git a/dwarf-compilation.base/contrib/libdwarf/BLDTESTDIR b/dwarf-compilation.base/contrib/libdwarf/BLDTESTDIR new file mode 100644 index 0000000..3eb52e5 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/BLDTESTDIR @@ -0,0 +1,210 @@ +#!/bin/sh +# +#newpref sets directory name with date, more +#like normal linux packages. +if [ $# != 1 ] +then + echo Usage: BLDTESTDIR yyyymmdd + echo Example: BLDTESTDIR 20100501 + exit 1 +fi +dat=$1 +tmpdir=/var/tmp +cd dwarftest +basenewpref=dwarftest-${dat} +newpref=$tmpdir/dwarftest-${dat} +newf=dwarftest-${dat}.tar +echo ============ $newpref $newf ========== +echo First create /var/tmp/$newpref with the latest source. +rm -rf $newpref +mkdir $newpref +for i in zero/Makefile \ +allen1/README \ +allen1/todd-allen-gcc-4.4.4-bin.exe \ +zero/TEST \ +zero/zero.cc \ +sandnes2/cu_dir_added_to_complete_path.c \ +sandnes2/README \ +sandnes2/RUNTEST.sh \ +sandnes2/cu_dir_added_to_complete_path.elf \ +dwarf4/dd2g4.5dwarf-4 \ +dwarf4/ddg4.5dwarf-4 \ +dwarf4/README \ +moshe/a.out.t \ +moshe/hello \ +moshe/hello.c \ +moshe/README \ +moshe/t.c \ +lloyd/arange.elf \ +lloyd/README \ +cell/c_malloc.o \ +cell/README \ +test-eh/Makefile \ +test-eh/eh-frame.cc \ +test-eh/test-eh.386 \ +test-eh/test-eh.c \ +test-eh/eh-frame.386 \ +CLEANUP \ +ChangeLog2010 \ +ChangeLog2009 \ +test-alex2/test.c \ +test-alex2/README \ +test-alex2/RUNTEST \ +test-alex2/bugemail \ +test-alex2/orig.a.out \ +sun/sunelf1 \ +sun/sparc1-a.out \ +linkonce/linkonce.txt \ +linkonce/test.cpp \ +linkonce/comdattest.o \ +libdwarf.a \ +louzon/README \ +louzon/ppcobj.o \ +cristi3/foo.cpp \ +cristi3/cristibadobj \ +cristi3/README \ +arm/README \ +arm/armcc-test-dwarf3 \ +arm/armcc-test-dwarf2 \ +ia64/hxdump.c \ +ia64/mytry.ia64 \ +ia64/mytry.cpp \ +ia64/README \ +ia64/hxdump.ia64 \ +PICKUPBIN \ +test_harmless \ +findcu/cutest.c \ +findcu/README \ +findcu/cutestobj.save \ +findcu/RUNTEST \ +TEST \ +macinfo/test.c \ +macinfo/a.out3.4 \ +macinfo/a.out4.3 \ +macinfo/README \ +RUNALL.sh \ +testcase/testcase.c \ +testcase/Makefile \ +testcase/README \ +testcase/testcase \ +testcase/BLD \ +testcase/verify \ +dwarfextract/test2.c \ +dwarfextract/Makefile \ +dwarfextract/test1.base \ +dwarfextract/test1.c \ +dwarfextract/runtests.sh \ +dwarfextract/test1.h \ +dwarfextract/dwarfextract.c \ +val_expr/libpthread-2.5.so \ +ChangeLog \ +frame1/frame1.orig \ +frame1/frame1.c \ +frame1/README \ +frame1/frame1.exe.save \ +frame1/frame1.base \ +frame1/runtest.sh \ +cristi2/libpthread-2.4.so \ +cristi2/README \ +cristi2/libc-2.5.so \ +x86/README \ +x86/dwarfdumpv4.3 \ +kartashev2/Makefile \ +kartashev2/bar.cc \ +kartashev2/foo.cc \ +kartashev2/combined.o \ +test_harmless.c \ +libdwoldframecol.a \ +atefail/README \ +atefail/ig_server \ +modula2/README \ +modula2/write-fixed \ +shihhuangti/t1.o \ +shihhuangti/tcombined.o \ +shihhuangti/README.txt \ +shihhuangti/t2.o \ +dwarfdump.conferr1 \ +DWARFTEST.sh \ +moore/README \ +moore/simplec.o \ +moore/RUNTEST.sh \ +moore/simplec.c \ +moore/djpeg.v850 \ +README.txt \ +ppc2/README \ +ppc2/powerpc-750-linux-gnu-hello-static.txt \ +ppc2/powerpc-750-linux-gnu-hello-static \ +sparc/README \ +sparc/tcombined.o \ +sandnes/Test1.elf \ +sandnes/README \ +wynn/unoptimised.axf \ +wynn/README.txt \ +COPYING \ +SINGLE \ +mutatee/test1.mutatee_gcc.exe \ +mucci/main.gcc \ +mucci/a.out.mucci \ +mucci/main.o \ +mucci/README \ +mucci/main.c \ +mucci/main.pathcc \ +mucci/stream.o \ +mucci/main.o.pathcc \ +mucci/main.o.gcc \ +test_dwarfnames.c \ +legendre/frame_test.c \ +legendre/libmpich.so.1.0 \ +legendre/README \ +legendre/RUNTEST.sh \ +ref_addr/README \ +ref_addr/ELF3.elf \ +test-array/Makefile \ +test-array/array.c \ +test-array/test-array \ +BLD \ +irix64/libc.so \ +test-alex1/test.c \ +test-alex1/bug \ +test-alex1/RUNTEST \ +test-alex1/bugemail \ +test-alex1/BLD \ +test-alex1/RUNIT \ +test-alex1/orig.a.out \ +BLDTAR \ +kartashev/README \ +kartashev/combined.o \ +irixn32/dwarfdump \ +irixn32/libc.so \ +RUN \ +verifyall.cc \ +dwarfdump.O \ +dwarfdump.conf \ +ia32/libc.so.6 \ +ia32/preloadable_libintl.so \ +ia32/mytry.ia32 \ +ia32/libpfm.so.3 \ +ia32/libpt_linux_x86_r.so.1 \ +enciso2/README \ +enciso2/test_templates.cpp \ +enciso2/template.elf \ +enciso2/test_templates.o +do + d=`dirname $i` + if ! [ -d $newpref/$d ] + then + mkdir $newpref/$d + fi + cp -p $i $newpref/$i +done + +cd $tmpdir +# Alter date below before using.e +rm -f ${newf} ${newf}.gz +tar cf /var/tmp/$newf $basenewpref +gzip ${newf} +hm=/home/davea/sgiweb3/pagedata +cp ${newf}.gz $hm +ls -l $tmpdir/${newf}.gz +ls -l $hm/${newf}.gz +exit 0 diff --git a/dwarf-compilation.base/contrib/libdwarf/CLEANUP b/dwarf-compilation.base/contrib/libdwarf/CLEANUP new file mode 100644 index 0000000..59a1b4f --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/CLEANUP @@ -0,0 +1,18 @@ + + +( cd dwarfexample ; make clean ; make distclean ) +( cd dwarfgen ; make clean ; make distclean ) +( cd libdwarf ; make clean ; make distclean ) +( cd dwarfdump ; make clean ; make distclean ) +( cd bugxml ; rm -f bugrecord.pyc ) +( cd bugxml ; rm -f dwarfbug.xml ) +( cd bugxml ; rm -f dwarfbugtail ) +( cd bugxml ; rm -f junk* ) +( cd bugxml ; rm -rf __pycache__ ) + +rm -f libdwarf/BLD +rm -f dwarfdump/BLD + +rm -f dwarfgen/configure.lineno +rm -f ALLd* +rm -f junk* */junk* diff --git a/dwarf-compilation.base/contrib/libdwarf/CMakeLists.txt b/dwarf-compilation.base/contrib/libdwarf/CMakeLists.txt new file mode 100644 index 0000000..8a50191 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.2) + +project(libdwarf) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + +include(LibdwarfMacros) + +# view folders on supported IDEs +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +# used when finding libelf +set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE) + +# this project has tests +enable_testing() + +# always include project's folder to includes +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) + +find_package(LibElf REQUIRED) + +list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBELF_INCLUDE_DIRS}) + +include(configure.cmake) + +if(nonshared) + set(DWARF_TARGETS dwarf-static) + set(DWARF_TYPES STATIC) + set(dwarf-target dwarf-static) +endif() +if(shared) + list(APPEND DWARF_TARGETS dwarf-shared) + list(APPEND DWARF_TYPES SHARED) + set(dwarf-target dwarf-shared) +endif() + +add_subdirectory(libdwarf) +add_subdirectory(dwarfexample) +add_subdirectory(dwarfdump) +add_subdirectory(dwarfgen) + +add_custom_target(dd + DEPENDS ${DWARF_TARGETS} dwarfdump) \ No newline at end of file diff --git a/dwarf-compilation.base/contrib/libdwarf/CPTOPUBLIC b/dwarf-compilation.base/contrib/libdwarf/CPTOPUBLIC new file mode 100755 index 0000000..47f1ad7 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/CPTOPUBLIC @@ -0,0 +1,35 @@ +#!/bin/sh +# CPTOPUBLIC [uv] [nouv] + +usemsg() +{ + echo "CPTOPUBLIC [uv] [nouv]" + echo "where uv means update version strings " + echo "where nouv means do not update version strings " + echo "One of uv or nouv is required..." +} + +if [ $# -ne 1 ] +then + usemsg + exit 1 +fi +uver="n" +case $1 in + uv) uver="y" ;; + nouv) uver="n" ;; + *) usemsg ; exit 1 ;; +esac + +s=/home/davea/dwarf/code +cd $s +pwd +t=/var/tmp/dwarf +echo target is $t +if [ $uver = "y" ] +then + sh UPDATEDWARFDUMPVERSION.sh +fi +rm -rf $t +mkdir $t +cp -rp * $t diff --git a/dwarf-compilation.base/contrib/libdwarf/CREATINGARELEASE b/dwarf-compilation.base/contrib/libdwarf/CREATINGARELEASE new file mode 100644 index 0000000..826eea1 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/CREATINGARELEASE @@ -0,0 +1,93 @@ + +This is an checlist of the steps in creating a new release. +In hopes this will prevent omissions. + +DavidA. 30 November 2012 + +Source here means libdwarf/dwarfdump/dwarfgen source (in Git). +Tests here means the regression tests (in another Git repository). + +In the Source: + +Update the source and build with your changes. +Update the appropriate ChangeLog file so every +file in Git which changes (except ChangeLog and NEWS) +are in ChangeLog. + (at year end, move ChangeLog to ChangeLogyyyy + where yyyy is the year ending and create a new + empty ChangeLog) + +Use dicheck (also in sourceforge) to verify indentation of +all .h .cc and .c files is consistent. + +Ensure all interfaces in libdwarf that are call able by users +are in libdwarf.h and are documented in libdwarf2.1.mm or +libdwarf2p.1.mm and that any changes in the .mm also +mean you inserted a version and date change +in the date lines near the front of that .mm. +Then regenerate the pdf if any changes. + +Run any small preliminary tests that seem applicable. + +In the Tests: + +Create any new tests that seem applicable. +Add the appropriate lines to DWARFTEST.sh which +actually does the test running. + +RUNALL.sh + Runs one test of the new dwarfdump/libdwarf executable + against the previously saved dwarfdump/libdwarf executable. + +The notion of keeping baseline test output and simply +comparing output of a previous release vs the new +candiate release would involve saving some really large files. +So the present test suite instead runs each test with +two dwarfdump* versions and compares the output. + +To run all the tests, most of which +compare the (committed in tests) dwarfdump +against your new source: + sh PICKUPBIN # This picks up latest source and compiles + # (for some files multiple times) + # It is essential before each test run. + sh RUNALL.sh # This runs the tests 3 times with different + # dwarfdump[2] and different comparisons + +To check for failure: + grep FAIL ALL* + If there are any FAILS decide if they are real failures + (in which case fix the Source and retest) or are in fact + the output change that is expected given the Source changes. + +In case all tests pass: + cp dwarfdump dwarfdump.O + commit the updated .O executables as the new baseline good + dwarfdump for the next test run. + +In the Source: + sh UPDATEDWARFDUMPVERSION.sh #updates the version string in 4 places + update dwarfdump[2]/ChangeLog files to reflect the new version. + commit the new version string. If this has been done recently + enough that users won't see the current version string + it need not be done at this time. + + sh BLD #to verify it still builds + git push origin master # Push to sourceforge. + # We use 20121130 as an example below, use the current date. + sh CPTOPUBLIC # To copy relevant Source to a temp directory + sh BLDLIBDWARFTAR 20121130 # (use current date) to create a tar.gz + # like libdwarf-20121130.tar.gz + md5sum libdwarf-20121130.tar.gz + sha512sum libdwarf-20121130.tar.gz + # To get unforgeable checksums for the tar.gz file + git tag -a 20121130 -m 'Release 20121130' + git push origin 20121130 # push the tag + +In the Tests: + git push origin master + git tag -a 20121130 -m 'Release 20121130' + git push origin 20121130 # push the tag + +Update web pages so that the new release is visble to users +and copy the tar.gz to the appropriate web site. diff --git a/dwarf-compilation.base/contrib/libdwarf/Makefile.in b/dwarf-compilation.base/contrib/libdwarf/Makefile.in new file mode 100644 index 0000000..2432327 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/Makefile.in @@ -0,0 +1,118 @@ +# +# +# Copyright (C) 2000,2003,2004,2006 Silicon Graphics, Inc. All Rights Reserved. +# Portions Copyright (C) 2010-2013 David B Anderson. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2.1 of the GNU Lesser General Public License +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301, +# USA. + +# +# Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/NoticeExplan +# +# + +# +# Makefile for libdwarf +# This is made very simple so it should work with +# any 'make'. +# + +srcdir = @srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = $(exec_prefix)/bin +libdir = $(exec_prefix)/lib + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +SHELL = /bin/sh +CC = @CC@ +AR = @AR@ +# For use with BSD ar (MacOSX ar) edit the ARFLAGS to be -s +#ARFLAGS = @ARFLAGS@ +RM = rm +RANLIB = @RANLIB@ +DEFS = @DEFS@ +LIBS = @LIBS@ +INCLUDES = -I. -I$(srcdir) +dwfpic = @dwfpic@ +CFLAGS = $(PREINCS) @CPPFLAGS@ @CFLAGS@ $(INCLUDES) $(dwfpic) $(POSTINCS) +LDFLAGS = $(PRELIBS) @LDFLAGS@ $(POSTLIBS) + +basic: + cd libdwarf && make + cd dwarfdump && make + +# The dd target takes the least space and time +# to build. +dd: + cd libdwarf && make + cd dwarfdump && make +all: basic + cd dwarfgen && make + cd dwarfexample && make + +clean: + sh ./CLEANUP + +install: all + echo "No install provided, see comments in the README" + +distclean: clean + rm -f dwarfgen/config.status + rm -f dwarfgen/config.log + rm -f dwarfgen/config.cache + rm -f dwarfgen/config.h + rm -f dwarfgen/configure.lineno + rm -rf dwarfgen/autom4te.cache + rm -f dwarfgen/Makefile + rm -f dwarfdump/config.status + rm -f dwarfdump/config.log + rm -f dwarfdump/config.cache + rm -f dwarfdump/config.h + rm -rf dwarfdump/autom4te.cache + rm -f dwarfdump/Makefile + rm -f libdwarf/config.status + rm -f libdwarf/config.log + rm -f libdwarf/config.cache + rm -f libdwarf/config.h + rm -rf libdwarf/autom4te.cache + rm -f libdwarf/Makefile + rm -f config.status + rm -f config.log + rm -f config.cache + rm -f config.h + rm -rf autom4te.cache + rm -f Makefile + +shar: + @echo "shar not set up" +dist: + @echo "dist not set up" diff --git a/dwarf-compilation.base/contrib/libdwarf/NEWS b/dwarf-compilation.base/contrib/libdwarf/NEWS new file mode 100644 index 0000000..f369e3c --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/NEWS @@ -0,0 +1,35 @@ +2016-11-30: + An alternative build mechanism using cmake is now in the source tree. + The builds for product testing continue to be done using configure && make. +2016-09-20: + --enable-sanitize option added to configure. This builds + with -fsanitize=address to check for out of bounds + memory access. +2016-09-05: + dwarfexample/simpleexample.c now has a simple option letting one + extract all .debug_info, .debug_types strings into a file by + themselves in case one wanted to examine string frequencies, + for example. +2016-06-01: Now we use DW_VERSION_DATE_STR for + dates everywhere instead of __DATE__ __TIME__ + so a repeated build gets identical object output. + DW_VERSION_DATE_STR is updated by UPDATEDWARFDUMPVERSION.sh + wherever that string is needed. + +2015-11-26: If DWARF section data you intend to read + with libdwarf is compressed by zlib (a section name + like .zdebug_info indicates such compression) libdwarf etc + will need zlib's headers and archive or shared-library + at build and link time. If you do not have zlib + everything will compile fine and will work + on ordinary DWARF sections but libdwarf will not be + able to read .zdebug_ compressed sections. + zlib.h is the main zlib header and libz.a is the + most likely zlib library you will encounter. + +2015-11-15: It is now possible to build + outside of the source tree. See README. + So configure.in changed a little. +2015-01-13: Removed dwarfdump2 and references to it. + dwarfdump has the (tsearch) features needed so the C++ + version no longer a benefit. diff --git a/dwarf-compilation.base/contrib/libdwarf/README b/dwarf-compilation.base/contrib/libdwarf/README new file mode 100644 index 0000000..c7cbab7 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/README @@ -0,0 +1,79 @@ + +A build can be done via cmake, which is +new as of November 2016. + mkdir /tmp/builddir + cd /tmp/builddir + # Assuming the source tree in /a/b/code + cmake /a/b/code + make + +Standard builds are done by configure/make as +described below. + +BUILDING IN SOURCE TREE +To just build libdwarf and dwarfdump +if the source tree is in /a/b/libdwarf-1 +one might do: + cd /a/b/libdwarf-1 + ./configure + make dd + #You may need to be root to do the following copy commands + cp dwarfdump/dwarfdump /usr/local/bin + cp dwarfdump/dwarfdump.conf /usr/local/lib + #The following is optional, not needed to run dwarfdump + #when doing the default build. + cp libdwarf/libdwarf.a /usr/local/lib + +BUILDING OUT OF SOURCE TREE +Or one could create a new directory, for example, + mkdir /var/tmp/dwarfex + cd /var/tmp/dwarfex + /a/b/libdwarf-1/configure + make dd +In this case the source directory is not touched and +all objects and files created are under /var/tmp/dwarfex + +NOTE: When building out of source tree the source tree +must be cleaned of any files created by a build +in the source tree. This is due to the way GNU Make +VPATH works. + +For a simple build of libdwarf, and dwarfdump +and the other tools: + ./configure + make + #Optionally: cp libdwarf/libdwarf.a + +To build all the tools (including dwarfgen and +dwarfexample) use 'make all'. There are known +small compile-time issues with building dwarfgen on +MaxOSX and most don't need to build dwarfgen. + ./configure + make all + +By default configure compiles and uses libdwarf.a. + +With + ./configure --enabled-shared +both libdwarf.a and libdwarf.so +are built. The runtimes built will reference libdwarf.so. + +With + ./configure --enabled-shared --disable-nonshared +libdwarf.so is built and used; libdwarf.a is not built. + +When ready to create a new source distribution do + ./CPTOPUBLIC + ./BLDLIBDWARF yyyymmdd +where that could be + ./BLDLIBDWARF 20140131 +as an example. + +Sanity checking: +Recent gcc has some checks that can be done at runtime. + -fsanitize=address + -fsanitize=leak + -fsanitize=undefined +which are turned on here by --enable-sanitize at build time. + +David Anderson. Updated November 30, 2016 diff --git a/dwarf-compilation.base/contrib/libdwarf/README.md b/dwarf-compilation.base/contrib/libdwarf/README.md new file mode 100644 index 0000000..1665772 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/README.md @@ -0,0 +1,19 @@ +[![Travis Build Status](https://travis-ci.org/dvirtz/libdwarf.svg?branch=cmake)](https://travis-ci.org/dvirtz/libdwarf) +[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/oxh8pg7hsuav2jrl?svg=true)](https://ci.appveyor.com/project/dvirtz/libdwarf) + +# This is README.md +## BUILDING + +To just build libdwarf and dwarfdump, if the source tree is in `/a/b/libdwarf-1` + +### Using CMake + +To build using CMake one might do +* `cd /a/b/libdwarf-1` +* configure: `cmake . -B_Release -DCMAKE_BUILD_TYPE=Release` +* build: `cmake --build _Release --target dd` +* (optionally install): `sudo cmake --build _Release --target install` + +# for autotools builds, see README + + diff --git a/dwarf-compilation.base/contrib/libdwarf/REBLDLIBDWARF b/dwarf-compilation.base/contrib/libdwarf/REBLDLIBDWARF new file mode 100755 index 0000000..0e4d703 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/REBLDLIBDWARF @@ -0,0 +1,31 @@ +#!/bin/sh +# Assume configure done recently. + +cd libdwarf +if [ $? != 0 ] +then + echo build failed + exit +fi +make +if [ $? != 0 ] +then + echo build failed + exit +fi +cd .. +cd dwarfdump +if [ $? != 0 ] +then + echo build failed + exit +fi +# rm in case we changed libdwarf. +rm dwarfdump +make +if [ $? != 0 ] +then + echo build failed + exit +fi +cd .. diff --git a/dwarf-compilation.base/contrib/libdwarf/SETUP_MASTER_TREE b/dwarf-compilation.base/contrib/libdwarf/SETUP_MASTER_TREE new file mode 100644 index 0000000..b599ce8 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/SETUP_MASTER_TREE @@ -0,0 +1,154 @@ +#!/bin/sh +exit 0; #modify this before running. +cat > tarlist.tmp < tarlist.tmp < UPD.awk <<\EOF +BEGIN { +if (ARGC <= 2) { + print "Bogus use of awk file, requires arg" + exit 1 +} else { + v=ARGV[1] + ARGV[1]="" +} +} +$0 ~ /#define DW_VERSION_DATE_STR/ { print $1, $2, "\"",v,"\"" } +$0 !~ /^#define DW_VERSION_DATE_STR/ { print $0 } +EOF +awk -f UPD.awk "$x" dwarfdump/dwarfdump.c >t +mv t dwarfdump/dwarfdump.c +awk -f UPD.awk "$x" dwarfdump/common.c >t +mv t dwarfdump/common.c +awk -f UPD.awk "$x" dwarfdump/tag_attr.c >t +mv t dwarfdump/tag_attr.c +awk -f UPD.awk "$x" dwarfdump/tag_tree.c >t +mv t dwarfdump/tag_tree.c +awk -f UPD.awk "$x" libdwarf/gennames.c >t +mv t libdwarf/gennames.c diff --git a/dwarf-compilation.base/contrib/libdwarf/appveyor.yml b/dwarf-compilation.base/contrib/libdwarf/appveyor.yml new file mode 100644 index 0000000..2a269ea --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/appveyor.yml @@ -0,0 +1,41 @@ +environment: + global: + LIBELF_INSTALL_PREFIX: "C:/libelf" + matrix: + - platform: Win32 + CMAKE_GENERATOR_NAME: "Visual Studio 14 2015" + CMAKE_OPTIONS: "" + - platform: Win32 + CMAKE_GENERATOR_NAME: "Visual Studio 14 2015" + CMAKE_OPTIONS: "-Dshared=ON" + - platform: Win32 + CMAKE_GENERATOR_NAME: "Visual Studio 14 2015" + CMAKE_OPTIONS: "-Dshared=ON nonshared=OFF" + - platform: x64 + CMAKE_GENERATOR_NAME: "Visual Studio 14 2015 Win64" + CMAKE_OPTIONS: "" + - platform: x64 + CMAKE_GENERATOR_NAME: "Visual Studio 14 2015 Win64" + CMAKE_OPTIONS: "-Dshared=ON" + - platform: x64 + CMAKE_GENERATOR_NAME: "Visual Studio 14 2015 Win64" + CMAKE_OPTIONS: "-Dshared=ON nonshared=OFF" + +configuration: Release + +install: + - git clone https://github.com/dvirtz/libelf.git + - cd libelf + - git checkout cmake + - cmake . -B_build -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_INSTALL_PREFIX=%LIBELF_INSTALL_PREFIX% + - cmake --build _build --config %CONFIGURATION% + - cmake --build _build --config %CONFIGURATION% --target INSTALL + - cd .. + +build_script: + - cmake . -B_build -G "%CMAKE_GENERATOR_NAME%" -DLIBELF_ROOT=%LIBELF_INSTALL_PREFIX% %OPTIONS% + - cmake --build _build --config %CONFIGURATION% + +test_script: + - cmake --build _build --config %CONFIGURATION% --target RUN_TESTS + \ No newline at end of file diff --git a/dwarf-compilation.base/contrib/libdwarf/bugxml/README b/dwarf-compilation.base/contrib/libdwarf/bugxml/README new file mode 100644 index 0000000..2bc661f --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/bugxml/README @@ -0,0 +1,18 @@ + +The files here are for maintaining a list of bugs +fixed so html and xml can be posted to prevanders.net +and CVE (see cert.org) issues can reference a public +database. + +This is intended mainly for bugs that can result in +application crashes as such can represent a vulnerability +that can be exploited. +Bugs that result simply in errors in output (but no crash) +will typically not be mentioned. + +Bugs in dwarfdump are not vulnerabilities in the same way +and at present these do not get CVE identifiers. + +David Anderson +Created: 2016-05-03. +Updated: 2017-07-06. diff --git a/dwarf-compilation.base/contrib/libdwarf/bugxml/bugrecord.py b/dwarf-compilation.base/contrib/libdwarf/bugxml/bugrecord.py new file mode 100755 index 0000000..e49c9ec --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/bugxml/bugrecord.py @@ -0,0 +1,328 @@ +#!/usr/bin/python3 +# Copyright (c) 2016-2016 David Anderson. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the example nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY David Anderson ''AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL David Anderson BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. + + +import sys + +# Use only
 or 
all by itself in data.xml. +# No other data on either of such lines. +# All the lines between these two markers should be +# shown in individual lines. +def xmlize(linea,inhtml,inpre): + outi = [] + l = linea + if l.find("
") != -1:
+     if inhtml == 'y':
+       s2 = '

' +l + '\n' + else: + s2 = l + '\n' + inpre = 'y' + return s2,inpre + if l.find("
") != -1: + if inhtml == 'y': + s2 = l + '\n' + "

" + else: + s2 = l + '\n' + inpre = 'n' + return s2, inpre + if inpre == 'y' and inhtml == 'n': + outi += [""] + for c in l: + if c == '<': + outi += ["<"] + elif c == '>': + outi += [">"] + elif c == "&": + outi += ["&"] + #elif c == "'": + # outi += ["'"] + elif c == '"': + outi += ["""] + else: + outi += [c] + if inpre == 'y' and inhtml == 'n': + outi += [""] + outi += ["\n"] + s2 = ''.join(outi) + return s2,inpre + +def paraline(name,linea): + inpre = 'n' + out = '' + if len(linea) <1: + out = "

" + name + ":"+ "

" + return out + out = "

" + name + ": " + out +=linea + out += "

" + return out; + +def paralines(name,lines): + inpre = 'n' + if len(lines) <1: + out = "

" + name + ":"+ "

" + return out + out = "

" + name + ": " + for lin in lines: + f,inpre = xmlize(lin,'y',inpre) + out += f + out += "

" + return out; + +def para(name,str): + if str == None: + out = "

" + name + ":"+ "

" + elif len(str) > 0: + out = "

" + name + ": " + str + "

" + else: + out = "

" + name + ":"+ "

" + return out + + +class bugrecord: + + def __init__(self,dwid): + self._id= dwid.strip() + self._cve = '' + self._datereported = '' + self._reportedby = '' + self._vulnerability = [] + self._product = '' + self._description = [] + self._datefixed = '' + self._references = [] + self._gitfixid = '' + self._tarrelease = '' + + def setcve(self,pubid): + if self._cve != '': + print("Duplicate cve ",self._cve,pubid) + sys.exit(1) + self._cve = pubid.strip() + def setdatereported(self,rep): + if self._datereported != '': + print("Duplicate datereported ",self._datereported,rep) + sys.exit(1) + self._datereported = rep.strip() + def setreportedby(self,rep): + if self._reportedby != '': + print("Duplicate reportedby ",self._reportedby,rep) + sys.exit(1) + self._reportedby = rep.strip() + def setvulnerability(self,vuln): + if len(self._vulnerability) != 0: + print("Duplicate vulnerability ",self._vulnerability,vuln) + sys.exit(1) + self._vulnerability = vuln + def setproduct(self,p): + if len(self._product) != 0: + print("Duplicate product ",self._product,p) + sys.exit(1) + self._product = p.strip() + def setdescription(self,d): + if len(self._description) != 0: + print("Duplicate description ",self._description,d) + sys.exit(1) + self._description = d + def setdatefixed(self,d): + if len(self._datefixed) != 0: + print("Duplicate datefixed ",self._datefixed,d) + sys.exit(1) + self._datefixed = d.strip() + def setreferences(self,r): + if len(self._references) != 0: + print("Duplicate references ",self._references,r) + sys.exit(1) + self._references = r + def setgitfixid(self,g): + if len(self._gitfixid) != 0: + print("Duplicate gitfixid ",self._gitfixid,g) + sys.exit(1) + self._gitfixid = g.strip() + def settarrelease(self,g): + if len(self._tarrelease) != 0: + print("Duplicate tarrelease ",self._tarrelease,g) + sys.exit(1) + self._tarrelease = g.strip() + def plist(self,title,lines): + if lines == None: + print(title) + return + if len(lines) == 1: + print(title,lines[0]) + return + print(title) + for l in lines: + print(l) + + def printbug(self): + print("") + print("id:",self._id) + print("cve:",self._cve) + print("datereported:",self._datereported) + print("reportedby:",self._reportedby) + self.plist("vulnerability:",self._vulnerability) + print("product:",self._product) + self.plist("description:",self._description) + print("datefixed:",self._datefixed) + self.plist("references:",self._references) + print("gitfixid:",self._gitfixid) + print("tarrelease:",self._tarrelease) + + def generate_html(self): + s5= ''.join(self._id) + t = ''.join(['

',self._id,'

']) + txt = [t] + + inpre = 'n' + s,inp= xmlize(self._id,'y',inpre) + t = paraline("id",s) + txt += [t] + s,inp= xmlize(self._cve,'y',inpre) + t = paraline("cve",s) + txt += [t] + + s,inp= xmlize(self._datereported,'y',inpre) + t = paraline("datereported",s) + txt += [t] + + s,inp= xmlize(self._reportedby,'y',inpre) + t = paraline("reportedby",s) + txt += [t] + + #MULTI + t = paralines("vulnerability",self._vulnerability) + txt += [t] + + + s,inp= xmlize(self._product,'y',inpre) + t = paraline("product",s) + txt += [t] + + #MULTI + t = paralines("description",self._description) + txt += [t] + + s,inp= xmlize(self._datefixed,'y',inpre) + t = paraline("datefixed",s) + txt += [t] + + #MULTI + t = paralines("references",self._references) + txt += [t] + + s,inp= xmlize(self._gitfixid,'y',inpre) + t = paraline("gitfixid",s) + txt += [t] + + s,inp= xmlize(self._tarrelease,'y',inpre) + t = paraline("tarrelease",s) + txt += [t] + + t = '

[top]

' + txt += [t] + return txt + + def paraxml(self,start,main,term): + # For single line xml remove the newline from the main text line. + out = start + l=main.strip() + if len(l) > 0: + out += l + out += term + "\n" + return out + def paraxmlN(self,start,main,term): + # For multi line xml leave newlines present. + out = start + inpre = 'n' + for x in main: + l=x.rstrip() + t,inpre = xmlize(l,'n',inpre); + if len(t) > 0: + out += t + out += term + "\n" + return out + + + def generate_xml(self): + txt=[] + t = '' + txt += [t] + + inpre = 'n' + s,inpre= xmlize(self._id,'n',inpre) + s = self.paraxml('',s,'') + + s,inpre= xmlize(self._cve,'n',inpre) + t = self.paraxml('',s,'') + txt += [t] + + s,inpre= xmlize(self._datereported,'n',inpre) + t = self.paraxml('',s,'') + txt += [t]; + + s,inpre= xmlize(self._reportedby,'n',inpre) + t = self.paraxml('',s,'') + txt += [t]; + + s,inpre= xmlize(self._product,'n',inpre) + t = self.paraxml('',s,'') + txt += [t]; + + + #MULTI + p = self._vulnerability + t = self.paraxmlN("",p,"") + txt += [t] + + + #MULTI + p = self._description + t = self.paraxmlN("",p,"") + txt += [t] + + + s,inpre= xmlize(self._datefixed,'n',inpre) + t = self.paraxml('',s,'') + txt += [t]; + + #MULTI + p = self._references + t = self.paraxmlN("",p,"") + txt += [t] + + s,inpre= xmlize(self._gitfixid,'n',inpre) + t = self.paraxml('',s,'') + txt += [t]; + + s,inpre= xmlize(self._tarrelease,'n',inpre) + t = self.paraxml('',s,'') + txt += [t]; + + t = '' + txt += [t]; + return txt diff --git a/dwarf-compilation.base/contrib/libdwarf/bugxml/data.template b/dwarf-compilation.base/contrib/libdwarf/bugxml/data.template new file mode 100644 index 0000000..c45f3e0 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/bugxml/data.template @@ -0,0 +1,14 @@ +id: +cve: +datereported: +reportedby: +vulnerability: +product: +description: +datefixed: +references: +gitfixid: +endrec: + + + diff --git a/dwarf-compilation.base/contrib/libdwarf/bugxml/data.txt b/dwarf-compilation.base/contrib/libdwarf/bugxml/data.txt new file mode 100644 index 0000000..0cc1a0e --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/bugxml/data.txt @@ -0,0 +1,1232 @@ + +id: DW201711-002 +cve: +datereported: 2017-11-08 +reportedby: Agostino Sarubbo +vulnerability: Incorrect line table section could crash caller +product: libdwarf +description: An carefully crafted object with a + invalid line table section crafted to + end early at a particular point resulted in + dereferencing outside the line table from + libdwarf/dwarf_line_table_reader_common.c . + A segmentation-fault/core-dump is possible. +datefixed: 2017-11-08 +references: regressiontests/sarubbo-9/3.crashes.bin +gitfixid: a1644f4dde7dd5990537ff7ad22a9e94b8723186 +tarrelease: +endrec: DW201711-002 + +id: DW201711-001 +cve: +datereported: 2017-11-01 +reportedby: Agostino Sarubbo +vulnerability: Incorrect frame section could crash caller +product: libdwarf +description: A carefully crafted object with a + resulting invalid frame section + with DW_CFA_advance_loc1 implying + data off-the-end-of-section + will dereference an invalid pointer. + A segmentation fault and core dump is possible. + Corrected code checks now. +datefixed: 2017-11-02 +references: regressiontests/sarubbo-8/1.crashes.bin +gitfixid: 44349d7991e44dd3751794f76537cabcf65ee28d +tarrelease: +endrec: DW201711-001 + + + + +id: DW201709-001 +cve: +datereported: 2017-09-19 +reportedby: Agostino Sarubbo +vulnerability: Incorrect abbrev section could crash caller. +product: libdwarf +description: A fuzzed object with a + resulting invalid abbrev section where + the end of section follows an abbrev tag + would dereference a non-existent has-child byte. + +datefixed: 2017-09-26 +references: regressiontests/sarubbo-3/1.crashes.bin +gitfixid: bcc2e33908e669bacd397e3c941ffd1db3005d17 +tarrelease: +endrec: DW201709-001 + + +id: DW201706-001 +cve: CVE-2017-9998 +datereported: 2017-06-28 +reportedby: team OWL337 +vulnerability: Addition overflow in libdwarf leads to segmentation violation +product: libdwarf +description: A fuzzed object with a + resulting invalid value can overflow + when added to a valid pointer + (depending on how the runtime memory is laid out) + and thereafter a dereference results in a + segmentation violation). + +
 see
+  https://bugzilla.redhat.com/show_bug.cgi?id=1465756
+  for contact information of those finding the bug.
+  Fabian Wolff sent email and provided
+  the link to the web page.
+ 
+ +datefixed: 2017-07-06 +references: regressiontests/wolff/POC1 +gitfixid: e91681e8841291f57386f26a90897fd1dcf92a6e +tarrelease: +endrec: DW201706-001 + + + +id: DW201703-007 +cve: +datereported: 2017-03-21 +reportedby: Marcel Bohme and Van-Thuan Pham +vulnerability: Heap overflow in strncmp (libelf bug) +product: libdwarf (libelf) +description: 7/7. A heap overflow in + strncmp() is due to libelf failing to check arguments + to elf_ strptr. + This is not a bug in libdwarf, it is a libelf bug. + A pointer for being in bounds (in a few places in this + function) and a failure in a check in dwarf_attr_list(). + The test object is intentionally corrupted (fuzzed). + +
+ A portion of sanitizer output with Ubuntu 14.04:
+ ==180133==ERROR: AddressSanitizer: heap-buffer-overflow 
+   on address 0x60d00000cff1 at pc 0x0000004476f4 
+   bp 0x7fff87dd7dd0 sp 0x7fff87dd7590
+ READ of size 8 at 0x60d00000cff1 thread T0
+    #0 0x4476f3 in __interceptor_strncmp (/home/ubuntu/subjects/
+       build-asan/libdwarf/dwarfdump/dwarfdump+0x4476f3)
+    #1 0x7992ae in this_section_dwarf_relevant /home/ubuntu/subjects/
+       build-asan/libdwarf/libdwarf/dwarf_init_finish.c:608:13
+    #2 0x781064 in _dwarf_setup /home/ubuntu/subjects/
+       build-asan/libdwarf/libdwarf/dwarf_init_finish.c:722:14
+    #3 0x77d59c in dwarf_object_init /home/ubuntu/subjects/
+       build-asan/libdwarf/libdwarf/dwarf_init_finish.c:922:20
+
+ With Ubuntu 16.04 libelf dwarfdump gets:
+ ERROR:  dwarf_elf_init:  DW_DLE_ELF_STRPTR_ERROR (30) 
+ a call to elf_strptr() failed trying to get a section name
+ 
+ + +datefixed: +references: regressiontests/marcel/crash7 +gitfixid: +tarrelease: libdwarf-20160507.tar.gz +endrec: DW201703-007 + + +id: DW201703-006 +cve: CVE-2017-9052 +datereported: 2017-03-21 +reportedby: Marcel Bohme and Van-Thuan Pham +vulnerability: Heap overflow in dwarf_formsdata +product: libdwarf +description: 6/7. A heap overflow in + dwarf_formsdata() is due to a failure to check + a pointer for being in bounds (in a few places in this + function) and a failure in a check in dwarf_attr_list(). + The test object is intentionally corrupted (fuzzed). + +
+ A portion of sanitizer output with Ubuntu 14.04:
+ ==180130==ERROR: AddressSanitizer: heap-buffer-overflow 
+  on address 0x61100000589c at pc 0x0000006cab95 
+  bp 0x7fff749aab10 sp 0x7fff749aab08
+ READ of size 1 at 0x61100000589c thread T0
+    #0 0x6cab94 in dwarf_formsdata /home/ubuntu/subjects/
+       build-asan/libdwarf/libdwarf/dwarf_form.c:937:9
+    #1 0x567daf in get_small_encoding_integer_and_name /home/ubuntu/subjects/
+       build-asan/libdwarf/dwarfdump/print_die.c:1533:16
+    #2 0x562f28 in get_attr_value /home/ubuntu/subjects/
+       build-asan/libdwarf/dwarfdump/print_die.c:5030:24
+    #3 0x555f86 in print_attribute /home/ubuntu/subjects/
+       build-asan/libdwarf/dwarfdump/print_die.c:3357:13
+
+ After fixes applied dwarfdump says:
+ ERROR:  dwarf_attrlist:  DW_DLE_DW_DLE_ATTR_OUTSIDE_SECTION(281)
+ 
+ +datefixed: 2017-03-21 +references: regressiontests/marcel/crash6 +gitfixid: cc37d6917011733d776ae228af4e5d6abe9613c1 +tarrelease: libdwarf-20160507.tar.gz +endrec: DW201703-006 + + + +id: DW201703-005 +cve: CVE-2017-9053 +datereported: 2017-03-21 +reportedby: Marcel Bohme and Van-Thuan Pham +vulnerability: Heap overflow in _dwarf_read_loc_expr_op() +product: libdwarf +description: 5/7. A heap overflow in + _dwarf_read_loc_expr_op() is due to a failure to check + a pointer for being in bounds (in a few places in this + function). + The test object is intentionally corrupted (fuzzed). + +
+ A portion of sanitizer output with Ubuntu 14.04:
+ ==180112==ERROR: AddressSanitizer: heap-buffer-overflow 
+  on address 0x60800000bf72 at pc 0x00000084dd52 
+  bp 0x7ffc12136fd0 sp 0x7ffc12136fc8
+ READ of size 1 at 0x60800000bf72 thread T0
+    #0 0x84dd51 in _dwarf_read_loc_expr_op /home/ubuntu/subjects/
+       build-asan/libdwarf/libdwarf/./dwarf_loc.c:250:9
+    #1 0x841f16 in _dwarf_get_locdesc_c /home/ubuntu/subjects/
+       build-asan/libdwarf/libdwarf/./dwarf_loc2.c:109:15
+    #2 0x837d08 in dwarf_get_loclist_c /home/ubuntu/subjects/
+       build-asan/libdwarf/libdwarf/./dwarf_loc2.c:685:18
+    #3 0x57dff2 in get_location_list /home/ubuntu/subjects/
+       build-asan/libdwarf/dwarfdump/print_die.c:3812:16
+
+ After fixes applied dwarfdump says:
+ ERROR:  dwarf_get_loclist_c:  DW_DLE_LOCEXPR_OFF_SECTION_END 
+ (343) Corrupt dwarf
+ 
+ +datefixed: 2017-03-21 +references: regressiontests/marcel/crash5 +gitfixid: cc37d6917011733d776ae228af4e5d6abe9613c1 +tarrelease: libdwarf-20160507.tar.gz +endrec: DW201703-005 + +id: DW201703-004 +cve: +datereported: 2017-03-21 +reportedby: Marcel Bohme and Van-Thuan Pham +vulnerability: Heap overflow in set_up_section strlen +product: libdwarf (libelf) +description: 4/7. An apparent heap overflow that + gives the appearance of being in libdwarf is due to + libelf call elf_strptr() failing to fully check + that its arguments make sense. + This is not a bug in libdwarf, it is a libelf bug. + The test object is intentionally corrupted (fuzzed). + The submission was with Ubuntu 14.04. With Ubuntu + 16.04 there is no sanitizer error report. +
+
+ A portion of sanitizer output with Ubuntu 14.04:
+ ==180109==ERROR: AddressSanitizer: heap-buffer-overflow 
+   on address 0x60b00000b000 at pc 0x00000048fd12 
+   bp 0x7fff4ad31ef0 sp 0x7fff4ad316b0
+ READ of size 16 at 0x60b00000b000 thread T0
+    #0 0x48fd11 in __interceptor_strlen (/home/ubuntu/
+       subjects/build-asan/libdwarf/dwarfdump/dwarfdump+0x48fd11)
+    #1 0x7a84a4 in set_up_section /home/ubuntu/
+       subjects/build-asan/libdwarf/libdwarf/dwarf_init_finish.c:285:27
+    #2 0x79aaa5 in enter_section_in_de_debug_sections_array /home/ubuntu/
+       subjects/build-asan/libdwarf/libdwarf/dwarf_init_finish.c:355:5
+    #3 0x78170b in _dwarf_setup /home/ubuntu/
+       subjects/build-asan/libdwarf/libdwarf/dwarf_init_finish.c:746:19
+
+ With Ubuntu 16.04 libelf one gets:
+ ERROR:  dwarf_elf_init:  DW_DLE_ELF_STRPTR_ERROR (30) 
+ a call to elf_strptr() failed trying to get a section name
+ 
+datefixed: +references: regressiontests/marcel/crash4 +gitfixid: +tarrelease: libdwarf-20160507.tar.gz +endrec: DW201703-004 + + + +id: DW201703-003 +cve: +datereported: 2017-03-21 +reportedby: Marcel Bohme and Van-Thuan Pham +vulnerability: Heap overflow in strcmp +product: libdwarf (libelf) +description: 3/7. An apparent heap overflow that + gives the appearance of being in libdwarf is due to + libelf call elf_strptr() failing to fully check + that its arguments make sense. + This is not a bug in libdwarf, it is a libelf bug. + The test object is intentionally corrupted (fuzzed). + The submission was with Ubuntu 14.04. With Ubuntu + 16.04 there is no sanitizer error report. +
+
+ A portion of sanitizer output with Ubuntu 14.04:
+  ==180106==ERROR: AddressSanitizer: heap-buffer-overflow 
+    on address 0x60f00000ef09 at pc 0x000000447300 
+    bp 0x7ffc667dce10 sp 0x7ffc667dc5d0
+  READ of size 4 at 0x60f00000ef09 thread T0
+    #0 0x4472ff in __interceptor_strcmp (/home/ubuntu/
+       subjects/build-asan/libdwarf/dwarfdump/dwarfdump+0x4472ff)
+    #1 0x79938f in this_section_dwarf_relevant /home/ubuntu/
+       subjects/build-asan/libdwarf/libdwarf/dwarf_init_finish.c:612:12
+    #2 0x781064 in _dwarf_setup /home/ubuntu/
+       subjects/build-asan/libdwarf/libdwarf/dwarf_init_finish.c:722:14
+    #3 0x77d59c in dwarf_object_init /home/ubuntu/
+       subjects/build-asan/libdwarf/libdwarf/dwarf_init_finish.c:922:20
+    #4 0x899d4f in dwarf_elf_init_file_ownership /
+
+  With Ubuntu 16.04 libelf one gets:
+  ERROR:  dwarf_elf_init:  DW_DLE_ELF_STRPTR_ERROR (30) 
+  a call to elf_strptr() failed trying to get a section name
+ 
+datefixed: +references: regressiontests/marcel/crash3 +gitfixid: +tarrelease: libdwarf-20160507.tar.gz +endrec: DW201703-003 + + +id: DW201703-002 +cve: CVE-2017-9054 +datereported: 2017-03-21 +reportedby: Marcel Bohme and Van-Thuan Pham +vulnerability: Heap overflow in _dwarf_decode_s_leb128_chk() +product: libdwarf +description: 2/7. In _dwarf_decode_s_leb128_chk() + a byte pointer was dereferenced just before was checked + as being in bounds. + The test object is intentionally corrupted (fuzzed). +
+
+ A portion of sanitizer output:
+  .debug_line: line number info for a single cu
+  ==180103==ERROR: AddressSanitizer: heap-buffer-overflow 
+    on address 0x610000007ffc at pc 0x0000007b0f5b 
+    bp 0x7ffe06bbf510 sp 0x7ffe06bbf508
+  READ of size 1 at 0x610000007ffc thread T0
+    #0 0x7b0f5a in _dwarf_decode_s_leb128_chk /home/ubuntu/
+       subjects/build-asan/libdwarf/libdwarf/dwarf_leb.c:304:9
+    #1 0x7e753e in read_line_table_program /home/ubuntu/
+       subjects/build-asan/libdwarf/libdwarf/./
+       dwarf_line_table_reader_common.c:1167:17
+    #2 0x7d7fe3 in _dwarf_internal_srclines /home/ubuntu/
+       subjects/build-asan/libdwarf/libdwarf/./dwarf_line.c:690:15
+    #3 0x7f9dbb in dwarf_srclines_b /home/ubuntu/
+       subjects/build-asan/libdwarf/libdwarf/./dwarf_line.c:944:12
+    #4 0x5caaa5 in print_line_numbers_this_cu /home/ubuntu/
+       subjects/build-asan/libdwarf/dwarfdump/print_lines.c:762:16
+
+  After fix applied one gets:
+  ERROR:  dwarf_srclines:  DW_DLE_LEB_IMPROPER (329) 
+  Runs off end of section or CU
+ 
+ +datefixed: 2017-03-21 +references: regressiontests/marcel/crash2 +gitfixid: cc37d6917011733d776ae228af4e5d6abe9613c1 +tarrelease: libdwarf-20160507.tar.gz +endrec: DW201703-002 + + +id: DW201703-001 +cve: CVE-2017-9055 +datereported: 2017-03-21 +reportedby: Marcel Bohme and Van-Thuan Pham +vulnerability: Heap overflow in dwarf_formsdata +product: libdwarf +description: 1/7. In dwarf_formsdata() a few + data types were not checked as being in bounds. + The test object is intentionally corrupted (fuzzed). +
+
+ A portion of sanitizer output:
+ LOCAL_SYMBOLS:
+ < 1><0x0000002f>    DW_TAG_subprogram
+
+ ==180088==ERROR: AddressSanitizer: heap-buffer-overflow on 
+  address 0x60800000bf72 at pc 0x0000006cab95 bp 
+  0x7fff31425830 sp 0x7fff31425828
+  READ of size 1 at 0x60800000bf72 thread T0
+    #0 0x6cab94 in dwarf_formsdata /home/ubuntu/subjects/
+       build-asan/libdwarf/libdwarf/dwarf_form.c:937:9
+    #1 0x567daf in get_small_encoding_integer_and_name /home/
+       ubuntu/subjects/build-asan/libdwarf/dwarfdump/print_die.c:1533:16
+    #2 0x576f38 in check_for_type_unsigned /home/ubuntu/
+       subjects/build-asan/libdwarf/dwarfdump/print_die.c:4301:11
+    #3 0x56ad8c in formxdata_print_value /home/ubuntu/
+       subjects/build-asan/libdwarf/dwarfdump/print_die.c:4374:39
+    #4 0x5643be in get_attr_value /home/ubuntu/
+       subjects/build-asan/libdwarf/dwarfdump/print_die.c:5140:24
+    #5 0x555f86 in print_attribute /home/ubuntu/subjects/build
+  ...
+
+  After fixes applied dwarfdump gets:
+  ERROR:  dwarf_attrlist:  DW_DLE_DW_DLE_ATTR_OUTSIDE_SECTION(281)
+ 
+datefixed: 2017-03-21 +references: regressiontests/marcel/crash1 +gitfixid: cc37d6917011733d776ae228af4e5d6abe9613c1 +tarrelease: libdwarf-20160507.tar.gz +endrec: DW201703-001 + + + + + +id: DW201611-006 +cve: CVE-2016-9480 +datereported: 2016-11-14 +reportedby: Puzzor (Shi Ji) +vulnerability: Heap buffer overflow +product: libdwarf +description: An object with corrupt contents causes a memory reference + out of bounds, a heap buffer overflow reference. +
+ heap-buffer-overflow in dwarf_util.c:208 for val_ptr
+
+ # Version
+ bb9a3492ac5713bed9cf3ae58ddb7afa6e9e98f8
+ (in regression tests here named  heap_buf_overflow.o)
+
+
+ # ASAN Output
+ <0> tag: 17 DW_TAG_compile_unit  name: "strstrnocase.c" FORM 0xe "DW_FORM_strp"
+ <1> tag: 46 DW_TAG_subprogram  name: "is_strstrnocase" FORM 0xe "DW_FORM_strp"
+ =================
+ ==1666==ERROR: AddressSanitizer: heap-buffer-overflow on address 
+   0xb5846db9 at p
+ c 0x080b3a1b bp 0xbfa75d18 sp 0xbfa75d08
+ READ of size 1 at 0xb5846db9 thread T0
+    #0 0x80b3a1a in _dwarf_get_size_of_val /home/puzzor/libdwarf-code/
+        libdwarf/dwarf_util.c:208
+    #1 0x8056602 in _dwarf_next_die_info_ptr /home/puzzor/libdwarf-code/
+        libdwarf/dwarf_die_deliv.c:1353
+    #2 0x8057f4b in dwarf_child /home/puzzor/libdwarf-code/libdwarf/
+       dwarf_die_de liv.c:1688
+    #3 0x804b5fa in get_die_and_siblings simplereader.c:637
+    #4 0x804b65c in get_die_and_siblings simplereader.c:643
+    #5 0x804b3f3 in read_cu_list simplereader.c:611
+    #6 0x804aeae in main simplereader.c:533
+    #7 0xb6ffe275 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x18275)
+    #8 0x80491c0  (/home/puzzor/libdwarf-code/dwarfexample/simplereader+
+         0x80491c 0)
+
+ 0xb5846db9 is located 0 bytes to the right of 249-byte region 
+    [0xb5846cc0,0xb5846db9)
+ allocated by thread T0 here:
+    #0 0xb727fae4 in __interceptor_malloc (/usr/lib/i386-linux-gnu/libasan.so.
+       3+ 0xc3ae4)
+    #1 0xb71a9b98  (/usr/lib/i386-linux-gnu/libelf.so.1+0x9b98)
+ 
+ For the orignal bug report see +
+ https://sourceforge.net/p/libdwarf/bugs/5/
+ 
+datefixed: 2016-11-16 +references: regressiontests/puzzor/heap_buf_overflow.o +gitfixid: 5dd64de047cd5ec479fb11fe7ff2692fd819e5e5 +tarrelease: libdwarf-20160507.tar.gz +endrec: + + +id: DW201611-005 +cve: +datereported: 2016-11-11 +reportedby: Agostino Sarubbo +vulnerability: negation of -9223372036854775808 cannot be represented in type +product: libdwarf +description: With the right bit pattern in a signed leb number + the signed leb decode would execute an unary minus with undefined + effect. This is not known to generate an incorrect value, + but it could, one supposes. +datefixed: 2016-11-11 +references: regressiontests/sarubbo-2/00050-libdwarf-negate-itself +gitfixid: 4f19e1050cd8e9ddf2cb6caa061ff2fec4c9b5f9 +tarrelease: libdwarf-20160507.tar.gz +endrec: + +id: DW201611-004 +cve: +datereported: 2016-11-02 +reportedby: Agostino Sarubbo +vulnerability: Heap overflow in dwarf_skim_forms() +product: libdwarf +description: If a non-terminated string + in a DWARF5 macro section + ends a section it can result in accessing memory not + in the application. dwarf_macro5.c(in _dwarf_skim_forms()). +datefixed: 2016-11-04 +references: regressiontests/sarubbo-2/00027-libdwarf-heapoverflow-_dwarf_skim_forms +gitfixid: 583f8834083b5ef834c497f5b47797e16101a9a6 +endrec: + +id: DW201611-003 +cve: +datereported: 2016-11-02 +reportedby: Agostino Sarubbo +vulnerability: Bad aranges length leads to overflow and bad pointer +product: libdwarf +description: in dwarf_arange.c(dwarf_get_aranges_list) an aranges + header with corrupt data could, with an overflowing calculation, + result in pointers to invalid or inappropriate memory being + dereferenced. +datefixed: 2016-11-04 +references: regressiontests/sarubbo-2/00026-libdwarf-heapoverflow-dwarf_get_aranges_list +gitfixid: 583f8834083b5ef834c497f5b47797e16101a9a6 +tarrelease: libdwarf-20170416.tar.gz +endrec: + + +id: DW201611-002 +cve: +datereported: 2016-11-02 +reportedby: Agostino Sarubbo +vulnerability: heap overflow in get_attr_value +product: libdwarf +description: Libdwarf failed to check for a bogus + length in dwarf_form.c (dwarf_formblock()) resulting + in a pointer pointing outside of the intended memory + region. Anything could happen in the subsequent + use of the bogus pointer. +
+ 0x61300000de1c is located 0 bytes to the right of 348-byte region 
+ [0x61300000dcc0,0x61300000de1c) 
+ allocated by thread T0 here: 
+   #0 0x4c0ad8 in malloc /var/tmp/portage/sys-devel/llvm-3.8.1-
+ r2/work/llvm-3.8.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:52 
+   #1 0x7f883cfc6206 in __libelf_set_rawdata_wrlock /tmp/portage/dev-
+ libs/elfutils-0.166/work/elfutils-0.166/libelf/elf_getdata.c:318
+ 
+datefixed: 2016-11-04 +references: regressiontests/sarubbo-2/00025-libdwarf-heapoverflow-get_attr_value +gitfixid: 583f8834083b5ef834c497f5b47797e16101a9a6 +tarrelease: libdwarf-20170416.tar.gz +endrec: + +id: DW201611-001 +cve: +datereported: 2016-11-02 +reportedby: Agostino Sarubbo +vulnerability: Memory allocation failure in do_decompress_zlib +product: libdwarf +description: In decompressing a zlib compressed section if + the decompressed section size is nonsense (too large) + an attempted malloc will fail and could let an exception + propagate to callers. +
+  ==27994==WARNING: AddressSanitizer failed to allocate 0x62696c2f7273752f
+  bytes ==27994==AddressSanitizer's allocator is terminating the process
+  instead of returning 0
+  ...
+   #6 0x4c0ab1 in malloc /var/tmp/portage/sys-devel/llvm-3.8.1-
+r2/work/llvm-3.8.1.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:53
+#7 0x5b582e in do_decompress_zlib
+/tmp/dwarf-20161021/libdwarf/dwarf_init_finish.c:1085:12
+   #8 0x5b582e in _dwarf_load_section
+/tmp/dwarf-20161021/libdwarf/dwarf_init_finish.c:1159
+   #9 0x5bb479 in dwarf_srcfiles
+/tmp/dwarf-20161021/libdwarf/./dwarf_line.c:336:11
+   #10 0x5145cd in print_one_die_section
+ 
+datefixed: 2016-11-04 +references: regressiontests/sarubbo-2/00024-libdwarf-memalloc-do_decompress_zlib +gitfixid: 583f8834083b5ef834c497f5b47797e16101a9a6 +tarrelease: libdwarf-20170416.tar.gz +endrec: + + + + +id: DW201609-004 +cve: +datereported: 20160917 +reportedby: Puzzor +vulnerability: libdwarf 20160613 Out-of-Bounds read +product: libdwarf +description: read line table program Out-of-Bounds read + line_ptr in dwarf_line_table_reader_common.c:1433 Out-of-Bounds read + See: +
+ https://bugzilla.redhat.com/show_bug.cgi?id=1377015
+ https://sourceforge.net/p/libdwarf/bugs/4/
+ 
+
+ # Address Sanitizer Output
+ ==27763==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4603f84 at pc 0x8408ede bp 0xffff6518 sp 0xffff6510
+ READ of size 1 at 0xf4603f84 thread T0
+ #0 0x8408edd in read_line_table_program /home/puzzor/test-fuzzing/code/libdwarf/./dwarf_line_table_reader_common.c:1433
+ #1 0x83f716c in _dwarf_internal_srclines /home/puzzor/test-fuzzing/code/libdwarf/./dwarf_line.c:690
+ #2 0x841436c in dwarf_srclines_b /home/puzzor/test-fuzzing/code/libdwarf/./dwarf_line.c:944
+ #3 0x81fbc28 in print_line_numbers_this_cu /home/puzzor/test-fuzzing/code/dwarfdump/print_lines.c:763
+ #4 0x815c191 in print_one_die_section /home/puzzor/test-fuzzing/code/dwarfdump/print_die.c:850
+ #5 0x81565c1 in print_infos /home/puzzor/test-fuzzing/code/dwarfdump
+ 
+datefixed: 20160923 +references: regressiontests/DW201609-004/poc +gitfixid: 3767305debcba8bd7e1c483ae48c509d25399252 +tarrelease: libdwarf-20160923.tar.gz +endrec: + + + + +id: DW201609-003 +cve: CVE-2016-7410 +datereported: 20160913 +reportedby: https://marc.info/?l=oss-security&m=147391785920048&w=2 +vulnerability: libdwarf 20160613 heap-buffer-overflow +product: libdwarf +description: With AddressSanitizer, + we found a Heap-Buffer-overflow in the latest + release version of dwarfdump. The crash output is as follows: +
+  See also:
+  https://marc.info/?l=oss-security&m=147378394815872&w=2
+  The testcase poc is from this web page.
+  
+
+  ==17411==ERROR: AddressSanitizer: heap-buffer-overflow on address
+  0xf3808904 at pc 0x80a6f76 bp 0xffb95e78 sp 0xffb95a5c
+  READ of size 4 at 0xf3808904 thread T0
+  ==17411==WARNING: Trying to symbolize code, but external symbolizer is
+  not initialized!
+    #0 0x80a6f75 in __interceptor_memcpy ??:?
+    #1 0x8426c3b in _dwarf_read_loc_section
+  /home/starlab/fuzzing/dwarf-20160613/libdwarf/./dwarf_loc.c:919
+    #2 0x84250e2 in _dwarf_get_loclist_count
+  /home/starlab/fuzzing/dwarf-20160613/libdwarf/./dwarf_loc.c:970
+    #3 0x8438826 in dwarf_get_loclist_c
+  /home/starlab/fuzzing/dwarf-20160613/libdwarf/./dwarf_loc2.c:551
+    #4 0x81a1be8 in get_location_list
+  /home/starlab/fuzzing/dwarf-20160613/dwarfdump/print_die.c:3523
+    #5 0x816e1a2 in print_attribute
+  
+ _dwarf_get_loclist_header_start() is not cautious about values + in the header being absurdly large. + Unclear as yet if this is the problem + but it is a potential problem (fixed for next release). +
+  Address Sanitizer in gcc reproduces the report.
+  In _dwarf_read_loc_section() the simple calculation of
+  loc_section_end was wrong, so end-of section was
+  incorrect for the local reads.
+  With that fixed we get DW_DLE_READ_LITTLEENDIAN_ERROR when
+  libdwarf attempts to read off end of section.
+  
+datefixed: 20160923 +references: regressiontests/DW201609-003/poc +gitfixid: 3767305debcba8bd7e1c483ae48c509d25399252 +tarrelease: libdwarf-20160923.tar.gz +endrec: + + +id: DW201609-002 +cve: CVE-2016-7511 +datereported: 20160918 +reportedby: Shi Ji (@Puzzor) +vulnerability: libdwarf 20160613 Integer Overflow +product: libdwarf +description: In dwarf_get_size_of_val() with + fuzzed DWARF data we get a SEGV. +
+  See
+  https://sourceforge.net/p/libdwarf/bugs/3/
+  
+
+  ==6825== ERROR: AddressSanitizer: SEGV on unknown address 0x0583903c (pc 0xb61f1a98 sp 0xbfa388b4 bp 0xbfa38d08 T0)
+  AddressSanitizer can not provide additional info.
+  #1 0xb61e3c0b (/usr/lib/i386-linux-gnu/libasan.so.0+0xdc0b)
+  #2 0x80a21b1 in _dwarf_get_size_of_val /home/fuzzing/fuzzing/dwarf-20160613/libdwarf/dwarf_util.c:210
+  #3 0x8054214 in _dwarf_next_die_info_ptr /home/fuzzing/fuzzing/dwarf-20160613/libdwarf/dwarf_die_deliv.c:1340
+  #4 0x80557a5 in dwarf_child /home/fuzzing/fuzzing/dwarf-20160613/libdwarf/dwarf_die_deliv.c:1640
+  #5 0x804b23f in get_die_and_siblings /home/fuzzing/fuzzing/dwarf-20160613/dwarfexample/./simplereader.c:573
+  
+ _dwarf_make_CU_Context() is insufficiently cautious about + the length of a CU being absurd. + Unclear as yet if this is the problem + but it is a problem and is fixed for next release. +datefixed: 20160923 +references: regressiontests/DW201609-002/DW201609-002-poc +gitfixid: 3767305debcba8bd7e1c483ae48c509d25399252 +tarrelease: libdwarf-20160923.tar.gz +endrec: + + + +id: DW201609-001 +cve: +datereported: 20160916 +reportedby: STARLAB + https://sourceforge.net/p/libdwarf/bugs/2/ +vulnerability: libdwarf 20160613 die_info_ptr in dwarf_die_deliv.c: 1533 Out-Of_bounds +product: libdwarf +description: At line 1533 of dwarf_die_deliv.c a + pointer dereference is done with a pointer pointing + past the end of the CU data. +
+ see
+ https://sourceforge.net/p/libdwarf/bugs/2/
+ 
+
+ ==8054==ERROR: AddressSanitizer: heap-buffer-overflow on 
+    address 0xf4c027ab at pc 0x819e4a4 bp 0xff88eb38 sp 0xff88eb30
+ READ of size 1 at 0xf4c027ab thread T0
+ #0 0x819e4a3 in dwarf_siblingof_b /home/starlab/fuzzing/dwarf-20160613/libdwarf/dwarf_die_deliv.c:1533
+ #1 0x8116201 in print_die_and_children_internal /home/starlab/fuzzing/dwarf-20160613/dwarfdump/print_die.c:1157
+ Bug report on sourceforge.net bug list for libdwarf.
+ The bad pointer dereference is due to libdwarf 
+ not noticing that the DWARF in that file is corrupt.
+ In addtion
+ The code was not noticing that it could dereference
+ a pointer that pointed out of bounds in the end-sibling-list
+ loop. 
+ 
+
+ The example from the bug report (DW201609-001-poc) has
+ the same problem.
+ dwarfdump now reports DW_DLE_SIBLING_LIST_IMPROPER
+ on both test2.o and DW201609-001-poc.
+ 
+datefixed: 20160917 +references: regressiontests/DW201609-001/test2.o + regressiontests/DW201609-001/DW201609-001-poc +gitfixid: 3767305debcba8bd7e1c483ae48c509d25399252 +tarrelease: libdwarf-20160923.tar.gz +endrec: + + +id: DW201605-019 +cve: CVE-2016-5028 +datereported: 20160523 +reportedby: Yue Liu +vulnerability: Null dereference in print_frame_inst_bytes (dwarfdump) +product: libdwarf +description: The null dereference is due to a corrupted + object file. Libdwarf was not dealing with empty (bss-like) + sections since it really did not expect to see such in + sections it reads! Now libdwarf catches the object error + so dwarfdump sees the section as empty (as indeed it is!). +datefixed: 20160523 +references: regressiontests/liu/NULLdeference0522c.elf +gitfixid: a55b958926cc67f89a512ed30bb5a22b0adb10f4 +tarrelease: libdwarf-20160923.tar.gz +endrec: + + +id: DW201605-018 +cve: CVE-2016-5029 +datereported: 20160522 +reportedby: Yue Liu +vulnerability: Null dereference in create_fullest_file_path(). +product: libdwarf +description: The null dereference in create_fullest_file_path() + causes a crash. This is due to corrupted dwarf and the fix + detects this corruption and if that null string pointer + happens undetected a static string is substituted so + readers can notice the situation. +
+  202             }
+ 203             if (dirno > 0 && fe->fi_dir_index > 0) {
+ 204                 inc_dir_name = (char *) 
+                         line_context->lc_include_directories[
+ 205                     fe->fi_dir_index - 1];
+ 206                 incdirnamelen = strlen(inc_dir_name);  <- $pc
+ 207             }
+ 208             full_name = (char *) _dwarf_get_alloc(dbg, 
+
+ #0  create_fullest_file_path (dbg=,
+ fe=0x68d510, line_context=0x68c4f0, name_ptr_out=, error=0x7fffffffe2b8) at ./dwarf_line.c:206
+
+ #1  0x00007ffff7b6d3f9 in dwarf_filename (context=, fileno_in=, ret_filename=0x7fffffffe280,
+ error=0x7fffffffe2b8) at ./dwarf_line.c:1418
+
+ #2  dwarf_linesrc (line=,
+ ret_linesrc=, error=) at
+ ./dwarf_line.c:1436
+ 
+datefixed: 20160522 +references: regressiontests/liu/NULLdereference0522.elf +gitfixid: acae971371daa23a19358bc62204007d258fbc5e +tarrelease: libdwarf-20160923.tar.gz +endrec: + + + + +id: DW201605-017 +cve: CVE-2016-5030 +datereported: 20160519 +reportedby: Yue Liu +vulnerability: Null dereference bug in _dwarf_calculate_info_section_end_ptr(). +product: libdwarf +description: + NULL dereference bug in _dwarf_calculate_info_section_end_ptr(). +
+ 1742         Dwarf_Off off2 = 0;
+ 1743         Dwarf_Small *dataptr = 0;
+ 1744     
+ 1745         dbg = context->cc_dbg;
+ 1746         dataptr = context->cc_is_info? dbg->de_debug_info.dss_data:                 <- $pc
+ 1747             dbg->de_debug_types.dss_data;
+ 1748         off2 = context->cc_debug_offset;
+ 1749         info_start = dataptr + off2;
+ 1750         info_end = info_start + context->cc_length +
+ 
+ #0  _dwarf_calculate_info_section_end_ptr
+ (context=context@entry=0x0) at dwarf_query.c:1746
+ 
+ #1  0x00002aaaaace307d in
+ _dwarf_extract_string_offset_via_str_offsets
+ (dbg=dbg@entry=0x655a70, info_data_ptr=0x6629f0
+ "", attrnum=attrnum@entry=121,
+ attrform=attrform@entry=26, cu_context=0x0,
+ str_sect_offset_out=str_sect_offset_out@entry=0x7fffffffd718,
+ error=error@entry=0x7fffffffd878) at dwarf_form.c:1099
+ 
+ #2  0x00002aaaaacf4ed7 in dwarf_get_macro_defundef
+ (macro_context=macro_context@entry=0x65b790,
+ op_number=op_number@entry=1,
+ line_number=line_number@entry=0x7fffffffd858,
+ index=index@entry=0x7fffffffd860,
+ offset=offset@entry=0x7fffffffd868,
+ forms_count=forms_count@entry=0x7fffffffd7ce,
+ macro_string=macro_string@entry=0x7fffffffd870,
+ error=error@entry=0x7fffffffd878) at dwarf_macro5.c:557
+ 
+ ------
+ 
+ _dwarf_calculate_info_section_end_ptr (context=context@entry=0x0) at 
+   dwarf_query.c:1746
+ 1746        dataptr = context->cc_is_info? dbg->de_debug_info.dss_data:
+ gef> p/x $rdi
+ $4 = 0x0
+ 
+datefixed: 20160522 +references: regressiontests/liu/NULLdereference0519.elf +gitfixid: 6fa3f710ee6f21bba7966b963033a91d77c952bd +tarrelease: libdwarf-20160923.tar.gz +endrec: + + + +id: DW201605-016 +cve: +datereported: 20160519 +reportedby: Yue Liu +vulnerability: Invalid dwarf leads to + dwarfdump crash in print_frame_inst_bytes. +product: dwarfdump +description: Corrupted dwarf crashes dwarfdump +
+ 1297         }
+ 1298         len = len_in;
+ 1299         endpoint = instp + len;
+ 1300         for (; len > 0;) {
+ 1301             unsigned char ibyte = *instp;           <- $pc
+ 1302             int top = ibyte & 0xc0;
+ 1303             int bottom = ibyte & 0x3f;
+ 1304             int delta = 0;
+ 1305             int reg = 0;
+
+ #0  print_frame_inst_bytes (dbg=dbg@entry=0x655ca0,
+ cie_init_inst=, len_in=,
+ data_alignment_factor=-4, code_alignment_factor=4,
+ addr_size=addr_size@entry=4, offset_size=4, version=3,
+ config_data=config_data@entry=0x63cda0 )
+ at print_frames.c:1301
+
+ #1  0x000000000041b70c in print_one_cie
+ (dbg=dbg@entry=0x655ca0, cie=,
+ cie_index=cie_index@entry=2, address_size=,
+ config_data=config_data@entry=0x63cda0 )
+ at print_frames.c:1161
+
+ #2  0x000000000041cf52 in print_frames (dbg=0x655ca0,
+ print_debug_frame=print_debug_frame@entry=1, print_eh_frame=0,
+ config_data=config_data@entry=0x63cda0 )
+ at print_frames.c:2229
+
+ gef> p/x $r13
+ $1 = 0x4bcad8
+ gef> p/x *$r13
+ Cannot access memory at address 0x4bcad8
+ 
+datefixed: 20160522 +references: regressiontests/liu/OOB_READ0519.elf +gitfixid: 6fa3f710ee6f21bba7966b963033a91d77c952bd +tarrelease: libdwarf-20160923.tar.gz +endrec: + + +id: DW201605-015 +cve: CVE-2016-5031 +datereported: 20160517 +reportedby: Yue Liu +vulnerability: OOB read bug in print_frame_inst_bytes() +product: libdwarf +description: Test object shows + an invalid read in print_frame_inst_bytes(). +
+ 1294         for (; len > 0;) {
+ 1295             unsigned char ibyte = *instp;           <- $pc
+ 1296             int top = ibyte & 0xc0;
+
+ #0  print_frame_inst_bytes (dbg=dbg@entry=0x654c80, 
+    cie_init_inst=, len=503715, data_alignment_factor=-4, 
+    code_alignment_factor=1, addr_size=addr_size@entry=4, offset_size=4, 
+    version=3, config_data=config_data@entry=0x63bda0 
+    ) at print_frames.c:1295
+ #1  0x000000000041b64c in print_one_cie (dbg=dbg@entry=0x654c80, 
+    cie=, cie_index=cie_index@entry=1, 
+    address_size=, config_data=
+    config_data@entry=0x63bda0 ) at print_frames.c:1161
+ #2  0x000000000041ce92 in print_frames (dbg=0x654c80, 
+    print_debug_frame=print_debug_frame@entry=1, print_eh_frame=0, 
+    config_data=config_data@entry=0x63bda0 ) 
+    at print_frames.c:2209
+
+ gef> x/10x $r13
+ 0x5e7981:       Cannot access memory at address 0x5e7981
+ gef> p/x $r13
+ $14 = 0x5e7981
+ 
+datefixed: 20150518 +references: regressiontests/liu/OOB0517_03.elf +gitfixid: ac6673e32f3443a5d36c2217cb814000930b2c54 +tarrelease: libdwarf-20160923.tar.gz +endrec: + + + + +id: DW201605-014 +cve: CVE-2016-5032 +datereported: 20160517 +reportedby: Yue Liu +vulnerability: OOB read bug in dwarf_get_xu_hash_entry() +product: libdwarf +description: Test object shows + an invalid read in dwarf_get _xu_hash_entry, lin 211. +
+ #0  dwarf_get_xu_hash_entry (xuhdr=xuhdr@entry=0x657360, 
+    index=index@entry=2897626028, hash_value=
+    hash_value@entry=0x7fffffffd5b0, 
+    index_to_sections=index_to_sections@entry=0x7fffffffd5a8, 
+    err=err@entry=0x7fffffffdb08) at dwarf_xu_index.c:211
+ #1  0x00002aaaaacfd05e in _dwarf_search_fission_for_key (
+    dbg=0x654a50, error=0x7fffffffdb08, percu_index_out=,
+    key_in=0x7fffffffd670, xuhdr=0x657360) at dwarf_xu_index.c:363
+ #2  dwarf_get_debugfission_for_key (dbg=dbg@entry=0x654a50, 
+    key=key@entry=0x7fffffffd670, key_type=key_type@entry=0x2aaaaad15e2a 
+    "tu", percu_out=percu_out@entry=0x65a830, 
+    error=error@entry=0x7fffffffdb08) at dwarf_xu_index.c:577
+ 
+datefixed: 20150518 +references: regressiontests/liu/OOB0517_02.elf +gitfixid: ac6673e32f3443a5d36c2217cb814000930b2c54 +tarrelease: libdwarf-20160923.tar.gz +endrec: + + + + +id: DW201605-013 +cve: CVE-2016-5033 +datereported: 20160517 +reportedby: Yue Liu +vulnerability: OOB read bug in print_exprloc_content +product: libdwarf +description: Test object shows + an invalid write in print_exprloc_content. +
+ #0  print_exprloc_content (dbg=dbg@entry=0x654ea0, 
+    die=die@entry=0x65b110, attrib=attrib@entry=0x65b590, 
+    esbp=esbp@entry=0x7fffffffcef0, showhextoo=1) at print_die.c:4182
+ #1  0x0000000000412fb1 in get_attr_value (dbg=dbg@entry=0x654ea0, 
+    tag=, die=die@entry=0x65b110, 
+    dieprint_cu_goffset=dieprint_cu_goffset@entry=11, 
+    attrib=attrib@entry=0x65b590, srcfiles=srcfiles@entry=0x0, 
+    cnt=cnt@entry=0, esbp=esbp@entry=0x7fffffffcef0, show_form=0, 
+    local_verbose=0) at print_die.c:4972
+ 
+datefixed: 20150518 +references: regressiontests/liu/OOB0517_01.elf +gitfixid: ac6673e32f3443a5d36c2217cb814000930b2c54 +tarrelease: libdwarf-20160923.tar.gz +endrec: + + +id: DW201605-012 +cve: CVE-2016-5034 +datereported: 20160513 +reportedby: Yue Liu +vulnerability: OOB write. From relocation records +product: libdwarf +description: Test object shows + an invalid write in dwarf_elf_access.c + (when doing the relocations). + Adding the relocation value to anything overflowed + and disguised the bad relocation record. + With a 32bit kernel build the test could show + a double-free and coredump due to the unchecked invalid + writes from relocations. +datefixed: 20160517 +references: regressiontests/liu/HeapOverflow0513.elf +gitfixid: 10ca310f64368dc083efacac87732c02ef560a92 +tarrelease: libdwarf-20160923.tar.gz +endrec: + + + +id: DW201605-011 +cve: CVE-2016-5035 +datereported: 20160506 +reportedby: Yue Liu +vulnerability: OOB read bug in _dwarf_read_line_table_header +product: libdwarf +description: Test object shows + null dereference at line 62 + of dwarf_line_table_reader.c. + Frame code and linetable code was not noticing data corruption. +datefixed: 20160512 +references: regressiontests/liu/OOB_read4.elf +gitfixid: 82d8e007851805af0dcaaff41f49a2d48473334b +tarrelease: libdwarf-20160923.tar.gz +endrec: + + +id: DW201605-010 +cve: CVE-2016-5036 +datereported: 20160506 +reportedby: Yue Liu +vulnerability: OOB read bug in dump_block +product: libdwarf +description: Test object shows + null dereverence at line 186 + of dump_block() in print_sections.c + Frame code was not noticing frame data corruption. +datefixed: 20160512 +references: regressiontests/liu/OOB_read3.elf + regressiontests/liu/OOB_read3_02.elf +gitfixid: 82d8e007851805af0dcaaff41f49a2d48473334b +tarrelease: libdwarf-20160923.tar.gz +endrec: + +id: DW201605-009 +cve: CVE-2016-5037 +datereported: 20160505 +reportedby: Yue Liu +vulnerability: NULL dereference in _dwarf_load_section +product: libdwarf +description: Test object shows + null dereverence at line 1010 + if(!strncmp("ZLIB",(const char *)src,4)) { + in dwarf_init_finish.c + The zlib code was not checking for + a corrupted length-value. +datefixed: 20160506 +references: regressiontests/liu/NULLderefer0505_01.elf +gitfixid: b6ec2dfd850929821626ea63fb0a752076a3c08a +tarrelease: libdwarf-20160507.tar.gz +endrec: + +id: DW201605-008 +cve: CVE-2016-5038 +datereported: 20160505 +reportedby: Yue Liu +vulnerability: OOB read in dwarf_get_macro_startend_file() +product: libdwarf +description: Test object shows + out of bound read. + OOB at: + line 772 *src_file_name = macro_context->mc_srcfiles[trueindex]; + in dwarf_macro5.c + A string offset into .debug_str is outside the bounds + of the .debug_str section. +datefixed: 20160512 +references: regressiontests/liu/OOB0505_02.elf + regressiontests/liu/OOB0505_02_02.elf +gitfixid: 82d8e007851805af0dcaaff41f49a2d48473334b +tarrelease: libdwarf-20160923.tar.gz +endrec: + +id: DW201605-007 +cve: CVE-2016-5039 +datereported: 20160505 +reportedby: Yue Liu +vulnerability: OOB read bug in get_attr_value() +product: libdwarf +description: Test object shows + out of bound read. + Object had data all-bits-on so + the existing length check did not work + due to wraparound. Added a check + not susceptible to that error (DW_DLE_FORM_BLOCK_LENGTH_ERROR). +datefixed: 20160506 +references: regressiontests/liu/OOB0505_01.elf +gitfixid: eb1472afac95031d0c9dd8c11d527b865fe7deb8 +gittag: 20160507 +tarrelease: libdwarf-20160507.tar.gz +endrec: + +id: DW201605-006 +cve: +datereported: 20160505 +reportedby: Yue Liu +vulnerability: Two Heap-Overflow bug +product: libdwarf +description: Two test objects showing + a heap overflow in libdwarf when + using dwarfdump. + It seems that these were fixed + by the previous git update. + Neither gdb nor valgrind find any errors + when building with yesterday's commit. +datefixed: 20160504 +references: regressiontests/liu/free_invalid_address.elf + regressiontests/liu/heapoverflow01b.elf +gitfixid: 98a3da1e8237fe0d45b67ef77f3fa5ed9ff0215f +tarrelease: libdwarf-20160507.tar.gz +endrec: + +id: DW201605-001 +cve: CVE-2016-5044 +datereported: 20160502 +reportedby: Yue Liu +vulnerability: A specially crafted DWARF section + results in a duplicate free() in libdwarf and + the calling application will crash. +product: libdwarf +description: + In file dwarf_elf_access.c:1071 +
+ WRITE_UNALIGNED(dbg,target_section + offset,
+     &outval,sizeof(outval),reloc_size);
+ 
+ A crafted ELF file may lead to a large offset value, which + bigger than the size of target_section heap chunk, then this + WRITE_UNALIGNED() function will write the value of &outval + out of the heap chunk. + offset is a 64bit unsigned int value, so this is more than + a heap overflow bug, but also a Out-of-Bound write bug. + So WRITE_UNALIGNED() need more strictly checking to prevent + this. +datefixed: 20160504 +references: regressiontests/liu/heapoverflow01.elf +
+ https://bugzilla.redhat.com/show_bug.cgi?id=1332141
+ 
+gitfixid: 98a3da1e8237fe0d45b67ef77f3fa5ed9ff0215f +gittag: 20160507 +tarrelease: libdwarf-20160507.tar.gz +endrec: + + + +id: DW201605-002 +cve: CVE-2016-5043 +datereported: 20160502 +reportedby: Yue Liu +vulnerability: A specially crafted DWARF section + results in a read outside the bounds of in memory + data so the calling application can crash. +product: libdwarf +description: + + Out of bound read bug in libdwarf git code. + + dwarf_dealloc() did not check the Dwarf_Ptr space argument + before using it. This will lead to a out-of-bound read bug. +
+ backtrace:
+ #0  dwarf_dealloc (dbg=dbg@entry=0x655f30, space=0xa0,
+ alloc_type=alloc_type@entry=1) at dwarf_alloc.c:477
+ #1  0x00002aaaaacf3296 in dealloc_srcfiles
+ (dbg=0x655f30, srcfiles=0x66b8f0, srcfiles_count=17) at
+ dwarf_macro5.c:1025 #2  0x00002aaaaacf50e6 in dealloc_srcfiles
+ (srcfiles_count=, srcfiles=,
+ dbg=) at dwarf_macro5.c:1021 -----
+
+ gef> p &r->rd_dbg
+ $14 = (void **) 0x90
+ 
+datefixed: 20160504 +references: regressiontests/liu/outofbound01.elf +
+ https://bugzilla.redhat.com/show_bug.cgi?id=1332144
+ 
+gitfixid: 98a3da1e8237fe0d45b67ef77f3fa5ed9ff0215f +tarrelease: libdwarf-20160507.tar.gz +endrec: + +id: DW201605-003 +cve: CVE-2016-5042 +datereported: 20160502 +reportedby: Yue Liu +vulnerability: A specially crafted DWARF section + results in an infinite loop that eventually + crashes the application. +product: libdwarf +description: + In dwarf_get_aranges_list() + an invalid count will iterate, reading from memory + addresses that increase till it all fails. + +datefixed: 20160504 +references: regressiontests/liu/infiniteloop.elf +
+ https://bugzilla.redhat.com/show_bug.cgi?id=1332145
+ 
+gitfixid: 98a3da1e8237fe0d45b67ef77f3fa5ed9ff0215f +tarrelease: libdwarf-20160507.tar.gz +endrec: + +id: DW201605-004 +cve: CVE-2016-5041 +datereported: 20160502 +reportedby: Yue Liu +vulnerability: A specially crafted DWARF section + results in a null dereference reading debugging + information entries which + crashes the application. +product: libdwarf +description: + If no DW_AT_name is present in a debugging + information entry using DWARF5 macros + a null dereference in dwarf_macro5.c will + crash the application. + +datefixed: 20160504 +references: regressiontests/liu/null01.elf +
+ https://bugzilla.redhat.com/show_bug.cgi?id=1332148
+ 
+gitfixid: 98a3da1e8237fe0d45b67ef77f3fa5ed9ff0215f +tarrelease: libdwarf-20160507.tar.gz +endrec: + +id: DW201605-005 +cve: CVE-2016-5040 +datereported: 20160502 +reportedby: Yue Liu +vulnerability: A specially crafted DWARF section + results in reading a compilation unit header + that crashes the application. +product: libdwarf +description: + If the data read for a compilation unit header + contains a too large length value the library + will read outside of its bounds and crash the application. +datefixed: 20160504 +references: regressiontests/liu/null02.elf +
+ https://bugzilla.redhat.com/show_bug.cgi?id=1332149
+ 
+gitfixid: 98a3da1e8237fe0d45b67ef77f3fa5ed9ff0215f +tarrelease: libdwarf-20160507.tar.gz +endrec: + diff --git a/dwarf-compilation.base/contrib/libdwarf/bugxml/readbugs.py b/dwarf-compilation.base/contrib/libdwarf/bugxml/readbugs.py new file mode 100755 index 0000000..3aaf951 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/bugxml/readbugs.py @@ -0,0 +1,257 @@ +#!/usr/bin/python3 +# Copyright (c) 2016-2016 David Anderson. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the example nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY David Anderson ''AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL David Anderson BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. + +import os +import sys +sys.path.append(os.path.abspath("/home/davea/dwarf/code/bugxml")) +import bugrecord + +def ignore_this_line(d,inrecord): + if len(d) < 1: + if inrecord == "y": + return "n" + else: + return "y" + s = str(d) + if s[0] == '#': + return "y" + return "n" + +def closeouttext(bugrec,intext,text,linecount): + if intext == 'd': + bugrec.setdescription(text) + return + elif intext == 'v': + bugrec.setvulnerability(text) + return + elif intext == 'r': + bugrec.setreferences(text) + return + if intext == "": + return + print("bogus closeout line at line ",linecount) + sys.exit(1) + + +def readbugs(iname): + name = iname + if len(name) == 0: + name = "/home/davea/dwarf/code/bugxml/data.txt" + try: + file = open(name,"r") + except IOError as message: + print("failed to open ",name, message) + + inrecord = "n" + linecount = 0 + text = [] + usedid ={} + intext = '' + bugrec = '' + buglist = [] + while 1: + try: + rec = file.readline() + except EOFError: + break + if len(rec) < 1: + # eof + break + linecount += 1 + if ignore_this_line(rec,inrecord) == "y": + continue + rec = rec.rstrip() + if inrecord == "n": + if len(rec) == 0: + continue + if rec.find(":") == -1: + print("bogus non-blank line at line ",linecount) + sys.exit(1) + if inrecord == "y" and len(rec) > 0: + # A multi line entry may have ":" in it. + if intext != "" and rec[0] == ' ': + s3 = ''.join(rec) + text += [s3] + continue + low = rec.find(":") + fldname = rec[0:low+1] + fldval = rec[low+1:] + if fldname == "id:": + if inrecord == "y": + print("bogus id: at line ",linecount) + sys.exit(1) + inrecord = "y" + f = fldval.strip() + if f in usedid: + print("Duplicate Key:",f,"Giving up.") + sys.exit(1) + usedid[f] = 1 + s4= ''.join(fldval) + bugrec = bugrecord.bugrecord(s4) + elif fldname == "cve:": + closeouttext(bugrec,intext,text,linecount), + intext = "" + text = [] + s4= ''.join(fldval) + bugrec.setcve(s4) + elif fldname == "datereported:": + closeouttext(bugrec,intext,text,linecount), + intext = "" + text = [] + s4= ''.join(fldval) + bugrec.setdatereported(s4) + elif fldname == "reportedby:": + closeouttext(bugrec,intext,text,linecount), + intext = "" + text = [] + s4= ''.join(fldval) + bugrec.setreportedby(s4) + elif fldname == "vulnerability:": + closeouttext(bugrec,intext,text,linecount), + intext = 'v' + text = [] + if len(fldval) > 0: + s4= ''.join(fldval) + text = [s4] + + elif fldname == "product:": + closeouttext(bugrec,intext,text,linecount), + intext = "" + text = [] + s4= ''.join(fldval) + bugrec.setproduct(s4) + elif fldname == "description:": + closeouttext(bugrec,intext,text,linecount), + text = [] + intext = 'd' + if len(fldval) > 0: + s4= ''.join(fldval) + text = [s4] + + elif fldname == "datefixed:": + closeouttext(bugrec,intext,text,linecount), + text = [] + intext = "" + s4= ''.join(fldval) + bugrec.setdatefixed(s4) + elif fldname == "references:": + closeouttext(bugrec,intext,text,linecount), + text = [] + intext = 'r' + if len(fldval) > 0: + s4= ''.join(fldval) + text = [s4] + elif fldname == "gitfixid:": + closeouttext(bugrec,intext,text,linecount), + text = [] + intext = "" + s4= ''.join(fldval) + bugrec.setgitfixid(s4) + elif fldname == "tarrelease:": + closeouttext(bugrec,intext,text,linecount), + text = [] + intext = "" + s4= ''.join(fldval) + bugrec.settarrelease(s4) + elif fldname == "endrec:": + closeouttext(bugrec,intext,text,linecount), + text = [] + if inrecord == "n": + print("bogus endrec: at line ",linecount) + sys.exit(1) + buglist += [bugrec] + inrecord = "n" + text = [] + intext = "" + inrecord = "n" + file.close() + return buglist + + + + + + + +def sort_by_id(myl): + """ Sort the list of objects by name. """ + auxiliary = [ ( x._id, x) for x in myl ] + auxiliary.sort() + return [ x[1] for x in auxiliary ] + + +def write_line(file,l): + file.write(l + "\n") + +def write_all_lines(file,txt): + for t in txt: + write_line(file,t) + +def generatehtml(list2,name): + try: + file = open(name,"w") + except IOError as message: + print("failed to open ",name, message) + sys.exit(1) + for b in list2: + txt=b.generate_html() + write_all_lines(file,txt) + write_line(file,"") + write_line(file,"") + file.close() + +def generatexml(list2,name): + try: + file = open(name,"w") + except IOError as message: + print("failed to open ",name, message) + sys.exit(1) + t = '' + write_line(file,t) + write_line(file,"") + for b in list2: + txt=b.generate_xml() + write_all_lines(file,txt) + write_line(file,"") + file.close() + + + + +if __name__ == '__main__': + list = readbugs("") + list2 = sort_by_id(list) + list2.reverse() + #for b in list2: + # b.printbug() + + generatehtml(list2,"./dwarfbugtail") + generatexml(list2,"./dwarfbuglohi.xml") + + list2.reverse() + generatehtml(list2,"./dwarfbuglohitail") + diff --git a/dwarf-compilation.base/contrib/libdwarf/cmake/AutoconfHelper.cmake b/dwarf-compilation.base/contrib/libdwarf/cmake/AutoconfHelper.cmake new file mode 100644 index 0000000..8cd3334 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/cmake/AutoconfHelper.cmake @@ -0,0 +1,383 @@ +# Helper functions for translating autoconf projects. Several functions +# are lifted from the Mono sources + +include (CheckCSourceCompiles) +include (CheckIncludeFile) +include (TestBigEndian) +include (CheckFunctionExists) +include (CheckTypeSize) +include (CheckCSourceRuns) + + +# Function to get the version information from the configure.ac file in the +# current directory. Its argument is the name of the library as passed to +# AC_INIT. It will set the variables ${LIBNAME}_VERSION and ${LIBNAME}_SOVERSION +function (ac_get_version libname) + string(TOUPPER "${libname}" libname_upper) + + # Read the relevant content from configure.ac + file (STRINGS configure.ac tmp_configure_ac + REGEX "${libname_upper}_[_A-Z]+=[ \\t]*[0-9]+") + + # Product version + string (REGEX REPLACE ".+MAJOR[_A-Z]+=([0-9]+).+MINOR[_A-Z]+=([0-9]+).+MICRO[_A-Z]+=([0-9]+).*" + "\\1.\\2.\\3" ${libname_upper}_VERSION "${tmp_configure_ac}") + + # Library version for libtool + string (REGEX REPLACE ".+CURRENT=([0-9]+).+REVISION=([0-9]+).+AGE=([0-9]+).*" + "\\1.\\2.\\3" ${libname_upper}_SOVERSION "${tmp_configure_ac}") + + # Checks if the string needs to be displayed + set (${libname_upper}_DISPLAYSTR_AUX + "Found ${libname} version ${${libname_upper}_VERSION}, soversion ${${libname_upper}_SOVERSION} from configure.ac" + ) + if ((NOT ${libname_upper}_DISPLAYSTR) OR (NOT ${libname_upper}_DISPLAYSTR STREQUAL ${libname_upper}_DISPLAYSTR_AUX)) + set (${libname_upper}_DISPLAYSTR ${${libname_upper}_DISPLAYSTR_AUX} + CACHE INTERNAL "Version string from ${libname}" FORCE) + message (STATUS ${${libname_upper}_DISPLAYSTR}) + endif () + + # Export the result to the caller + set(${libname_upper}_VERSION "${${libname_upper}_VERSION}" PARENT_SCOPE) + set(${libname_upper}_SOVERSION "${${libname_upper}_SOVERSION}" PARENT_SCOPE) +endfunction() + + +# Also from mono's source code +# Implementation of AC_CHECK_HEADERS +# In addition, it also records the list of variables in the variable +# 'autoheader_vars', and for each variable, a documentation string in the +# variable ${var}_doc +function(ac_check_headers) + foreach (header ${ARGV}) + string(TOUPPER ${header} header_var) + string(REPLACE "." "_" header_var ${header_var}) + string(REPLACE "/" "_" header_var ${header_var}) + set(header_var "HAVE_${header_var}") + check_include_file (${header} ${header_var}) + set("${header_var}_doc" "Define to 1 if you have the <${header}> header file." PARENT_SCOPE) + if (${header_var}) + set("${header_var}_defined" "1" PARENT_SCOPE) + endif() + set("${header_var}_val" "1" PARENT_SCOPE) + set (autoheader_vars ${autoheader_vars} ${header_var}) + endforeach() + set (autoheader_vars ${autoheader_vars} PARENT_SCOPE) +endfunction() + +# Function taken from mono's source code +function (ac_check_funcs) + foreach (func ${ARGV}) + string(TOUPPER ${func} var) + set(var "HAVE_${var}") + set(${var}) + check_function_exists (${func} ${var}) + set("${var}_doc" "Define to 1 if you have the '${func}' function." PARENT_SCOPE) + if (${var}) + set("${var}_defined" "1" PARENT_SCOPE) + set(${var} yes PARENT_SCOPE) + endif() + set("${var}_val" "1" PARENT_SCOPE) + set (autoheader_vars ${autoheader_vars} ${var}) + endforeach() + set (autoheader_vars ${autoheader_vars} PARENT_SCOPE) +endfunction() + + +# Specifically, this macro checks for stdlib.h', stdarg.h', +# string.h', and float.h'; if the system has those, it probably +# has the rest of the ANSI C header files. This macro also checks +# whether string.h' declares memchr' (and thus presumably the +# other mem' functions), whether stdlib.h' declare free' (and +# thus presumably malloc' and other related functions), and whether +# the ctype.h' macros work on characters with the high bit set, as +# ANSI C requires. +function (ac_header_stdc) + if (STDC_HEADERS) + return() + endif() + message(STATUS "Looking for ANSI-C headers") + set(code " +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + void *ptr; + free((void*)1); + ptr = memchr((void*)1, 0, 0); + + return (int)ptr; +} +") + # FIXME Check the ctype.h high bit + CHECK_C_SOURCE_COMPILES("${code}" STDC_HEADERS) + if (STDC_HEADERS) + set(STDC_HEADERS 1 PARENT_SCOPE) + message(STATUS "Looking for ANSI-C headers - found") + else() + message(STATUS "Looking for ANSI-C headers - not found") + endif() +endfunction() + + +# Also from the mono sources, kind of implements AC_SYS_LARGEFILE +function (ac_sys_largefile) + CHECK_C_SOURCE_RUNS(" +#include +#define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62)) +int main (int argc, char **argv) { + int big_off_t=((BIG_OFF_T%2147483629==721) && + (BIG_OFF_T%2147483647==1)); + return big_off ? 0 : 1; +} +" HAVE_LARGE_FILE_SUPPORT) + +# Check if it makes sense to define _LARGE_FILES or _FILE_OFFSET_BITS + if (HAVE_LARGE_FILE_SUPPORT) + return() + endif() + + set (_LARGE_FILE_EXTRA_SRC " +#include +int main (int argc, char **argv) { + return sizeof(off_t) == 8 ? 0 : 1; +} +") + CHECK_C_SOURCE_RUNS ("#define _LARGE_FILES\n${_LARGE_FILE_EXTRA_SRC}" + HAVE_USEFUL_D_LARGE_FILES) + if (NOT HAVE_USEFUL_D_LARGE_FILES) + if (NOT DEFINED HAVE_USEFUL_D_FILE_OFFSET_BITS) + set (SHOW_LARGE_FILE_WARNING TRUE) + endif () + CHECK_C_SOURCE_RUNS ("#define _FILE_OFFSET_BITS 64\n${_LARGE_FILE_EXTRA_SRC}" + HAVE_USEFUL_D_FILE_OFFSET_BITS) + if (HAVE_USEFUL_D_FILE_OFFSET_BITS) + set (_FILE_OFFSET_BITS 64 PARENT_SCOPE) + elseif (SHOW_LARGE_FILE_WARNING) + message (WARNING "No 64 bit file support through off_t available.") + endif () + else () + set (_LARGE_FILES 1 PARENT_SCOPE) + endif () +endfunction () + + +# Quick way to set some basic variables +# FIXME add support for variable number of arguments: only package and version are mandatory +# arguments are package version bug_report tarname url +function (ac_init) + set(package ${ARGV0}) + set(version ${ARGV1}) + set(bug_report ${ARGV2}) + set(tarname ${ARGV3}) + set(url ${ARGV4}) + set(PACKAGE_NAME "\"${package}\"" PARENT_SCOPE) + set(PACKAGE_VERSION "\"${version}\"" PARENT_SCOPE) + set(VERSION "\"${version}\"" PARENT_SCOPE) + if(version) + set(PACKAGE_STRING "\"${package} ${version}\"" PARENT_SCOPE) + else() + set(PACKAGE_STRING "\"${package}\"" PARENT_SCOPE) + endif() + + set(PACKAGE_BUGREPORT "\"${bug_report}\"" PARENT_SCOPE) + + if(NOT tarname) + string(REGEX REPLACE "[^a-zA-Z0-9_]" "-" tarname "${package}") + endif() + set(PACKAGE_TARNAME "\"${tarname}\"" PARENT_SCOPE) + + set(PACKAGE_URL "\"${url}\"" PARENT_SCOPE) +endfunction() + + +# Checks for the const keyword, defining "HAS_CONST_SUPPORT" +# If it does not have support, defines "const" to 0 in the parent scope +function (ac_c_const) + CHECK_C_SOURCE_COMPILES( + "int main(int argc, char **argv){const int r = 0;return r;}" + HAS_CONST_SUPPORT) + if (NOT HAS_CONST_SUPPORT) + set(const 0 PARENT_SCOPE) + endif() +endfunction() + + +# Inline keyword support. Defines "inline" in the parent scope to the +# compiler internal keyword for inline in C +# TODO write a better test! +function (ac_c_inline) + if (MSVC) + set (inline __inline) + elseif(CMAKE_COMPILER_IS_GNUC) + set (inline __inline__) + endif() + set(inline "${inline}" PARENT_SCOPE) +endfunction() + + +# Test if you can safely include both and +function (ac_header_time) + CHECK_C_SOURCE_COMPILES( + "#include \n#include \nint main(int argc, char **argv) { return 0; }" + TIME_WITH_SYS_TIME) + set(TIME_WITH_SYS_TIME ${TIME_WITH_SYS_TIME} PARENT_SCOPE) +endfunction() + + +# Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian +# (Intel), setting "WORDS_BIGENDIAN" to 1 if big endian +function (ac_c_bigendian) + TEST_BIG_ENDIAN(HOST_BIGENDIAN) + if (HOST_BIGENDIAN) + set(WORDS_BIGENDIAN 1 PARENT_SCOPE) + endif() +endfunction() + + +# Check for off_t, setting "off_t" in the parent scope +function(ac_type_off_t) + CHECK_TYPE_SIZE("off_t" SIZEOF_OFF_T) + if (NOT SIZEOF_OFF_T) + set(off_t "long int") + endif() + set(off_t ${off_t} PARENT_SCOPE) +endfunction() + + +# Check for size_t, setting "size_t" in the parent scope +function(ac_type_size_t) + CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T) + if (NOT SIZEOF_SIZE_T) + set(size_t "unsigned int") + endif() + set(size_t ${size_t} PARENT_SCOPE) +endfunction() + + +# Define "TM_IN_SYS_TIME" to 1 if declares "struct tm" +function(ac_struct_tm) + CHECK_C_SOURCE_COMPILES( + "#include \nint main(int argc, char **argv) { struct tm x; return 0; }" + TM_IN_SYS_TIME + ) + if (TM_IN_SYS_TIME) + set (TM_IN_SYS_TIME 1 PARENT_SCOPE) + endif() +endfunction() + + +# Obtain size of an 'type' and define as SIZEOF_TYPE +function (ac_check_sizeof typename) + string(TOUPPER "SIZEOF_${typename}" varname) + string(REPLACE " " "_" varname "${varname}") + string(REPLACE "*" "p" varname "${varname}") + CHECK_TYPE_SIZE("${typename}" ${varname} BUILTIN_TYPES_ONLY) + if(NOT ${varname}) + set(${varname} 0 PARENT_SCOPE) + endif() +endfunction() + + +# Check if the type exists, defines HAVE_ +function (ac_check_type typename) + string(TOUPPER "${typename}" varname) + string(REPLACE " " "_" varname "${varname}") + string(REPLACE "*" "p" varname "${varname}") + CHECK_TYPE_SIZE("${typename}" ${varname}) + if (NOT "${varname}" STREQUAL "") + set("HAVE_${varname}" 1 PARENT_SCOPE) + set("${varname}" "${typename}" PARENT_SCOPE) + else() + set("${varname}" "unknown" PARENT_SCOPE) + endif() +endfunction() + + +# Verifies if each type on the list exists, using the given prelude +function (ac_check_types type_list prelude) + foreach(typename ${type_list}) + string(TOUPPER "HAVE_${typename}" varname) + string(REPLACE " " "_" varname "${varname}") + string(REPLACE "*" "p" varname "${varname}") + CHECK_C_SOURCE_COMPILES("${prelude}\n ${typename} foo;" ${varname}) + endforeach() +endfunction() + +function(ac_path_prog variable prog_to_check_for value_if_not_found env_var) + find_program(${variable} NAMES ${prog_to_check_for} PATHS ENV ${env_var} NO_DEFAULT_PATH) + if(NOT ${variable}) + message(STATUS "Looking for ${prog_to_check_for} - not found") + set(${variable} ${value_if_not_fount} PARENT_SCOPE) + else() + message(STATUS "Looking for ${prog_to_check_for} - ${variable}") + set(${variable} ${${variable}} PARENT_SCOPE) + endif() +endfunction() + +# check if function func exists in library lib +function(ac_check_lib lib func) + string(TOUPPER "HAVE_${func}" varname) + set(CMAKE_REQUIRED_LIBRARIES ${lib}) + check_function_exists(${func} ${varname}) + set(CMAKE_REQUIRED_LIBRARIES) +endfunction() + +# check if source compiles without linking +function(ac_try_compile SOURCE VAR) + set(CMAKE_TMP_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp) + if(NOT DEFINED "${VAR}") + file(WRITE + "${CMAKE_TMP_DIR}/src.c" + "${SOURCE}\n" + ) + + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Performing Test ${VAR}") + endif() + # Set up CMakeLists.txt for static library: + file(WRITE + ${CMAKE_TMP_DIR}/CMakeLists.txt + "add_library(compile STATIC src.c)" + ) + + # Configure: + execute_process( + COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . + WORKING_DIRECTORY ${CMAKE_TMP_DIR} + ) + + # Build: + execute_process( + COMMAND ${CMAKE_COMMAND} --build ${CMAKE_TMP_DIR} + RESULT_VARIABLE RESVAR + OUTPUT_VARIABLE OUTPUT + ERROR_VARIABLE OUTPUT + ) + + # Set up result: + if(RESVAR EQUAL 0) + set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Performing Test ${VAR} - Success") + endif() + + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" + "${OUTPUT}\n" + "Source file was:\n${SOURCE}\n") + else() + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Performing Test ${VAR} - Failed") + endif() + set(${VAR} "" CACHE INTERNAL "Test ${VAR}") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" + "${OUTPUT}\n" + "Source file was:\n${SOURCE}\n") + endif() + endif() +endfunction() diff --git a/dwarf-compilation.base/contrib/libdwarf/cmake/FindLibElf.cmake b/dwarf-compilation.base/contrib/libdwarf/cmake/FindLibElf.cmake new file mode 100644 index 0000000..493f212 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/cmake/FindLibElf.cmake @@ -0,0 +1,64 @@ +# - Try to find libelf +# Once done this will define +# +# LIBELF_FOUND - system has libelf +# LIBELF_INCLUDE_DIRS - the libelf include directory +# LIBELF_LIBRARIES - Link these to use libelf +# LIBELF_DEFINITIONS - Compiler switches required for using libelf +# +# This module reads hints about search locations from variables: +# +# LIBELF_ROOT - Preferred installation prefix +# +# Copyright (c) 2008 Bernhard Walle +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +if (LIBELF_LIBRARIES AND LIBELF_INCLUDE_DIRS) + set (LibElf_FIND_QUIETLY TRUE) +endif (LIBELF_LIBRARIES AND LIBELF_INCLUDE_DIRS) + +find_path (LIBELF_INCLUDE_DIRS + NAMES + libelf/libelf.h libelf.h + HINTS + ${LIBELF_ROOT} + PATH_SUFFIXES + include + libelf/include +) + +find_library (LIBELF_LIBRARIES + NAMES + elf libelf + HINTS + ${LIBELF_ROOT} + PATH_SUFFIXES + lib + libelf/lib +) + +include (FindPackageHandleStandardArgs) + + +# handle the QUIETLY and REQUIRED arguments and set LIBELF_FOUND to TRUE if all listed variables are TRUE +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibElf DEFAULT_MSG + LIBELF_LIBRARIES + LIBELF_INCLUDE_DIRS) + +set(CMAKE_REQUIRED_LIBRARIES elf) +include(CheckCXXSourceCompiles) +check_cxx_source_compiles("#include +int main() { + Elf *e = (Elf*)0; + size_t sz; + elf_getshdrstrndx(e, &sz); + return 0; +}" ELF_GETSHDRSTRNDX) +unset(CMAKE_REQUIRED_LIBRARIES) + +mark_as_advanced(LIBELF_INCLUDE_DIRS LIBELF_LIBRARIES ELF_GETSHDRSTRNDX) diff --git a/dwarf-compilation.base/contrib/libdwarf/cmake/LibdwarfMacros.cmake b/dwarf-compilation.base/contrib/libdwarf/cmake/LibdwarfMacros.cmake new file mode 100644 index 0000000..e5ac910 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/cmake/LibdwarfMacros.cmake @@ -0,0 +1,19 @@ +# used to compile on MSVC upto 2013 where snprintf is not available +macro(msvc_posix target) + if(MSVC AND ("${MSVC_VERSION}" LESS 1900)) + # under VS 2015 + target_compile_definitions(${target} PUBLIC + snprintf=_snprintf) + endif() +endmacro() + +# set target folder on IDE +macro(set_folder target folder) + set_target_properties(${target} PROPERTIES FOLDER ${folder}) +endmacro() + +# set source groups on IDE +macro(set_source_group list_name group_name) + set(${list_name} ${ARGN}) + source_group(${group_name} FILES ${ARGN}) +endmacro() \ No newline at end of file diff --git a/dwarf-compilation.base/contrib/libdwarf/config.h.in b/dwarf-compilation.base/contrib/libdwarf/config.h.in new file mode 100644 index 0000000..10ec9f7 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/config.h.in @@ -0,0 +1,64 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif diff --git a/dwarf-compilation.base/contrib/libdwarf/configure b/dwarf-compilation.base/contrib/libdwarf/configure new file mode 100755 index 0000000..248fac6 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/configure @@ -0,0 +1,5156 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +enable_option_checking=no +ac_subst_vars='LTLIBOBJS +LIBOBJS +subdirs +dwfsanitize +build_nonshared +dwfpic +AR +RANLIB +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_shared +enable_nonshared +enable_sanitize +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' +ac_subdirs_all='libdwarf dwarfdump dwarfgen dwarfexample' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-shared build shared library libdwarf.so and use it if + present + --disable-nonshared do not build archive library libdwarf.a + --enable-sanitize Add -fsanitize (default is not to) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_config_headers="$ac_config_headers config.h" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + +if test $ac_cv_c_compiler_gnu = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } +if ${ac_cv_prog_gcc_traditional+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + +shrd='' +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; +fi + +if test "x$enable_shared" = "xyes"; then : + + shrd='--enable-shared' +fi + +dwfpic=-fPIC + +nonshrd='' +build_nonshared=none.a + +# Check whether --enable-nonshared was given. +if test "${enable_nonshared+set}" = set; then : + enableval=$enable_nonshared; +fi + +if test "x$enable_nonshared" = "xno"; then : + + nonshrd='--disable-shared' + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build -fsanitize-address" >&5 +$as_echo_n "checking build -fsanitize-address... " >&6; } +# Check whether --enable-sanitize was given. +if test "${enable_sanitize+set}" = set; then : + enableval=$enable_sanitize; dwfsanitize="-fsanitize=address -fsanitize=leak -fsanitize=undefined" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + +fi + + +chckres() { +if test $1 != 0 +then + echo "Configure Error exit: $2" + exit 2 +fi +} + + + +subdirs="$subdirs libdwarf dwarfdump dwarfgen dwarfexample" + + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi + +# +# CONFIG_SUBDIRS section. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file, --srcdir, and --disable-option-checking arguments + # so they do not pile up. + ac_sub_configure_args= + ac_prev= + eval "set x $ac_configure_args" + shift + for ac_arg + do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ + | --c=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + --disable-option-checking) + ;; + *) + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_sub_configure_args " '$ac_arg'" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_arg="--prefix=$prefix" + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" + + # Pass --silent + if test "$silent" = yes; then + ac_sub_configure_args="--silent $ac_sub_configure_args" + fi + + # Always prepend --disable-option-checking to silence warnings, since + # different subdirs can have different --enable and --with options. + ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d "$srcdir/$ac_dir" || continue + + ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" + $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 + $as_echo "$ac_msg" >&6 + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + cd "$ac_dir" + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f "$ac_srcdir/configure.gnu"; then + ac_sub_configure=$ac_srcdir/configure.gnu + elif test -f "$ac_srcdir/configure"; then + ac_sub_configure=$ac_srcdir/configure + elif test -f "$ac_srcdir/configure.in"; then + # This should be Cygnus configure. + ac_sub_configure=$ac_aux_dir/configure + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 +$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative name. + ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + # The eval makes quoting arguments work. + eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ + --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || + as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 + fi + + cd "$ac_popdir" + done +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/dwarf-compilation.base/contrib/libdwarf/configure.cmake b/dwarf-compilation.base/contrib/libdwarf/configure.cmake new file mode 100644 index 0000000..0c4a9f3 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/configure.cmake @@ -0,0 +1,17 @@ +include(AutoconfHelper) + +ac_c_bigendian() +ac_check_headers(sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h inttypes.h stdint.h unistd.h) + +# libdwarf default-disabled shared +option(shared "build shared library libdwarf.so and use it if present" FALSE) + +option(nonshared "build archive library libdwarf.a" TRUE) + +# This adds compiler option -Wall (gcc compiler warnings) +option(wall "Add -Wall" FALSE) +set(dwfwall $<$:"-Wall -O0 -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wextra -Wcomment -Wformat -Wpedantic -Wuninitialized -Wno-long-long -Wshadow">) + +option(nonstandardprintf "Use a special printf format for 64bit (default is NO)" FALSE) +set(HAVE_NONSTANDARD_PRINTF_64_FORMAT ${nonstandardprintf}) +message(STATUS "Checking enable nonstandardprintf... ${HAVE_NONSTANDARD_PRINTF_64_FORMAT}") diff --git a/dwarf-compilation.base/contrib/libdwarf/configure.in b/dwarf-compilation.base/contrib/libdwarf/configure.in new file mode 100644 index 0000000..ae9c12a --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/configure.in @@ -0,0 +1,51 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT() +AC_CONFIG_HEADER(config.h) + +AC_PROG_CC +AC_C_BIGENDIAN +AC_GCC_TRADITIONAL +AC_PROG_INSTALL +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(AR, ar) + +dnl libdwarf default-disabled shared +shrd='' +AC_ARG_ENABLE(shared,AC_HELP_STRING([--enable-shared], + [build shared library libdwarf.so and use it if present])) +AS_IF([ test "x$enable_shared" = "xyes"], [ + shrd='--enable-shared']) + +AC_SUBST(dwfpic,[-fPIC]) +nonshrd='' +dnl default-enabled nonshared +AC_SUBST(build_nonshared,[none.a]) +AC_ARG_ENABLE(nonshared,AC_HELP_STRING([--disable-nonshared], + [do not build archive library libdwarf.a])) +AS_IF([ test "x$enable_nonshared" = "xno"], [ + nonshrd='--disable-shared' +]) + +dnl This adds compiler option -fsanitize=address (gcc compiler run-time checks)) +AC_SUBST(dwfsanitize,[]) +AC_MSG_CHECKING(build -fsanitize-address) +AC_ARG_ENABLE(sanitize,AC_HELP_STRING([--enable-sanitize], + [Add -fsanitize (default is not to)]), + [ AC_SUBST(dwfsanitize,["-fsanitize=address -fsanitize=leak -fsanitize=undefined"]) + AC_MSG_RESULT(yes) ], + [ AC_SUBST(dwfsanitize,[]) + AC_MSG_RESULT(no) + ] + ) + +chckres() { +if test $1 != 0 +then + echo "Configure Error exit: $2" + exit 2 +fi +} + +AC_CONFIG_SUBDIRS([libdwarf dwarfdump dwarfgen dwarfexample]) + +AC_OUTPUT(Makefile) diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/CMakeLists.txt b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/CMakeLists.txt new file mode 100644 index 0000000..5ea8058 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/CMakeLists.txt @@ -0,0 +1,168 @@ +include(configure.cmake) + +add_library(esb_and_tsearchbal OBJECT esb.c dwarf_tsearchbal.c) + +set_folder(esb_and_tsearchbal dwarfdump) + +target_include_directories(esb_and_tsearchbal PRIVATE + $) + +msvc_posix(esb_and_tsearchbal) + +set_source_group(SOURCES "Source Files" addrmap.c checkutil.c dwarfdump.c dwconf.c helpertree.c + glflags.c + macrocheck.c print_abbrevs.c print_aranges.c print_debugfission.c print_die.c + print_dnames.c print_frames.c print_gdbindex.c + print_lines.c print_locs.c print_macro.c print_macros.c print_pubnames.c print_ranges.c print_reloc.c + print_sections.c print_section_groups.c print_static_funcs.c print_static_vars.c print_strings.c print_types.c print_weaknames.c + sanitized.c section_bitmaps.c strstrnocase.c uri.c dwgetopt.c makename.c naming.c common.c $) + +set_source_group(HEADERS "Header Files" checkutil.h common.h dwconf.h dwgetopt.h esb.h glflags.h globals.h macrocheck.h + makename.h dwarf_tsearch.h print_frames.h section_bitmaps.h uri.h) + +set_source_group(CONFIGURATION_FILES "Configuration Files" configure.cmake config.h.in.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) + +set_source_group(TAG_GENERATED "Generated Files" tmp-tt-table.c tmp-ta-table.c tmp-ta-ext-table.c tmp-tt-ext-table.c) + +add_executable(dwarfdump ${SOURCES} ${HEADERS} ${TAG_GENERATED} ${CONFIGURATION_FILES}) + +set_folder(dwarfdump dwarfdump) + +target_compile_options(dwarfdump PRIVATE ${dwfwall}) + +target_compile_definitions(dwarfdump PRIVATE "CONFPREFIX=${CMAKE_INSTALL_PREFIX}/lib") + +target_link_libraries(dwarfdump PRIVATE ${dwarf-target} ${dwfzlib}) + +# We need this as naming.o has external references we cannot have +# in the tree builds. +configure_file(naming.c trivial_naming.c COPYONLY) + +set_source_files_properties(trivial_naming.c PROPERTIES COMPILE_DEFINITIONS TRIVIAL_NAMING) + +set(TAG_TREE_SOURCES tag_tree.c tag_common.c common.c makename.c trivial_naming.c dwgetopt.c dwarf_tsearchbal.c sanitized.c esb.c) + +add_executable(tag_tree_build ${TAG_TREE_SOURCES}) + +set_folder(tag_tree_build dwarfdump/generators) + +target_link_libraries(tag_tree_build PRIVATE ${dwarf-target}) + +set(TAG_ATTR_SOURCES tag_attr.c tag_common.c common.c makename.c trivial_naming.c dwgetopt.c dwarf_tsearchbal.c sanitized.c esb.c) + +add_executable(tag_attr_build ${TAG_ATTR_SOURCES}) + +set_folder(tag_attr_build dwarfdump/generators) + +target_link_libraries(tag_attr_build PRIVATE ${dwarf-target}) + +# Plain GNU C dash E does not work on a .list, +# so copy to a .c name to run +# the following four table creations. +set(TAG_LIST_FILES tag_tree.list tag_attr.list tag_attr_ext.list tag_tree_ext.list) +set(TAG_SWITCH -s -s -e -e) +set(TAG_TOOL tag_tree_build tag_attr_build tag_attr_build tag_tree_build) +foreach(i RANGE 0 3) + list(GET TAG_GENERATED ${i} generatedFile) + list(GET TAG_LIST_FILES ${i} listFile) + list(GET TAG_SWITCH ${i} tagSwitch) + list(GET TAG_TOOL ${i} tagTool) + + math(EXPR j "${i} + 1") + + set(tmpSouce tmp-t${j}) + set(tmpDest tmp-tag-build${j}.tmp) + + configure_file(${listFile} ${tmpSouce}.c COPYONLY) + + add_custom_command(OUTPUT ${generatedFile} + COMMAND ${CMAKE_C_COMPILER} -E -I${CMAKE_CURRENT_SOURCE_DIR}/../libdwarf -DCONFPREFIX=${CMAKE_INSTALL_PREFIX}/lib ${tmpSouce}.c > ${tmpDest} + COMMAND ${tagTool} ${tagSwitch} -i ${tmpDest} -o ${generatedFile} + DEPENDS ${tagTool} ${listFile}) +endforeach() + +set_source_group(TESTESB_SOURCES "Source Files" esb.c testesb.c) + +add_executable(testesb ${TESTESB_SOURCES}) + +set_folder(testesb dwarfdump/tests) + +target_include_directories(testesb PRIVATE + $) + +add_test(NAME test COMMAND testesb) + +set_source_group(GETOPTEST_SOURCES "Source Files" getopttest.c dwgetopt.c) + +add_executable(getopttest ${GETOPTEST_SOURCES}) + +set_folder(getopttest dwarfdump/tests) + +add_test(NAME getopttest COMMAND getopttest) + +add_executable(getopttestnat ${GETOPTEST_SOURCES}) + +set_folder(getopttestnat dwarfdump/tests) + +if(UNIX) + target_compile_definitions(getopttestnat PRIVATE GETOPT_FROM_SYSTEM) +endif() + +foreach(i 1 2 3 5 6 7 8) + add_test(NAME getopttestnat${i} COMMAND getopttestnat -c ${i}) +endforeach() + +set_source_group(SELFHELPERTREE_SOURCES "Source Files" helpertree.c) + +add_executable(selfhelpertree ${SELFHELPERTREE_SOURCES} $) + +set_folder(selfhelpertree dwarfdump/tests) + +target_compile_definitions(selfhelpertree PRIVATE SELFTEST) + +target_include_directories(selfhelpertree PRIVATE + $) + +add_test(NAME selfhelpertree COMMAND selfhelpertree) + +#doesn't compile +#set_source_group(SELFMC_SOURCES "Source Files" macrocheck.c $) +# +#add_executable(selfmc ${SELFMC_SOURCES}) +# +# set_folder(selfmc dwarfdump/tests) +# +#target_compile_definitions(selfmc PRIVATE SELFTEST) +# +#target_include_directories(selfmc PRIVATE +# $) +# +#add_test(NAME selfmc COMMAND selfmc) + +set_source_group(SELFESB_SOURCES "Source Files" esb.c) + +add_executable(selfesb ${SELFESB_SOURCES}) + +set_folder(selfesb dwarfdump/tests) + +target_compile_definitions(selfesb PRIVATE SELFTEST) + +target_include_directories(selfesb PRIVATE + $) + +add_test(NAME selfesb COMMAND selfesb) + +if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) + set(SUFFIX 64) +endif() +set(LIBDIR lib${SUFFIX}) +set(BINDIR bin${SUFFIX}) + +install(TARGETS dwarfdump DESTINATION + RUNTIME DESTINATION ${BINDIR} + LIBRARY DESTINATION ${LIBDIR} + ARCHIVE DESTINATION ${LIBDIR}) + +install(FILES dwarfdump.conf DESTINATION ${LIBDIR}) + +install(FILES dwarfdump.1 DESTINATION share/man/man1) diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/CODINGSTYLE b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/CODINGSTYLE new file mode 100644 index 0000000..64bbb48 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/CODINGSTYLE @@ -0,0 +1,44 @@ +This document is a brief description of the main +coding style conventions in dwarfdump. Many of them +will be obvious from the code, but over time some +accidental diffences crept in. + + +Code should be indented in multiples of 4 spaces, and +tabs should not be used to indent the source code. +Use the dicheck program to check indenting. + +The struct naming convention is 'struct my_struct_s' for the +struct defined here (meaning the name should end with _s). +It is better to not do struct typedefs of local structs. +Coders should type 'struct mystruct_s'. Readability +is much more important than brevity. + +Any data or function not referenced outside the +defining source file should be declared 'static'. + +Any duplicated code is a candidate for refactoring +into a subprogram. + +Function names should be all lower case with underbars +with the goal that statements and comments 'read well'. + +Variables should be lower-case with +underbars for readability. It's ok for a small loop +with counters to use single letter names like i or k or m. + +Structure members should have a struct-specific +2-character prefix to the name (followed by +an underbar). That makes it much +easier to grep for uses of members. + +Try to keep lines under 80 characters in length. + +Ensure every if() has {} to enclose the actions. + +Use libdwarf.h types for all the data objects you define, +though sometimes an 'unsigned' or 'int' or 'size_t' is +ok in restricted circumstances. Dwarf_Unsigned and +Dwarf_Signed are the preferred integer types for general use. + +------------ diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/COPYING b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/COPYING new file mode 100644 index 0000000..355bd60 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/COPYING @@ -0,0 +1,31 @@ + +David Anderson: December 2006 +The code in the dwarfdump directory is (if you look +in each file) covered by the GPL (not the LGPL). The +DWARFDUMPCOPYRIGHT file, though, said (before December 24, +2006) the copyright is LGPL. There is no doubt in my (David +Anderson) mind that the intent was always that dwarfdump be +GPL and the copyright markings in each file are correct. + +There are three files marked with the LGPL: tag_tree.list +tag_attr.list acconfig.h. These markings are left as is and +these are are therefore LGPL files. + +The DWARFDUMPCOPYRIGHT file now (Dec 24 2006) has both +copyrights and an explanation of where each applies. + + + +------------------------------------------- +The text present for years, thru Dec 23, 2006: +The files: + dwarfdump.c + and all the .h and .c files in this implementation of + dwarfdump are copyrighted according to the file + DWARFDUMPCOPYRIGHT. + + + +$Source: /plroot/cmplrs.src/v7.4.5m/.RCS/PL/dwarfdump/RCS/COPYING,v $ +$Revision: 1.1 $ +$Date: 2001/01/16 17:47:55 $ diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog new file mode 100644 index 0000000..4d12b2d --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog @@ -0,0 +1,234 @@ +2017-10-20 David Anderson + * print_die.c: Now handles DW_FORM_data16. +2017-10-16 David Anderson + * dwarfdump.c,globals.h,print_ranges.c,print_section_groups.c: a large group + of per-object totals/values were not free()d or zeroed for each member + of an archive. Some of the zero/free() was moved from the end of main() + to be done per-object and some were simply never completely reset before. + These problems were only visible when running dwarfdump on an archive. +2017-10-15 David Anderson + * dwarfdump.c: Added a call to destruct_abbrev_array() + per object so the archive case can work properly with -ka. + * dwgetopt.c: Unused local variable 'found' deleted. + * print_abbrevs.c: Now -ka can handle bogus large + abbreviation number + without crashing when checking abbreviations.. +2017-10-15 David Anderson + * dwgetopt.c,dwgetopt.h: Now handles simple long argument + names cases. + * getopttest.c: Added tests of long (--) argument names. +2017-10-13 David Anderson + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. +2017-10-12 David Anderson + * dwarfdump.c: Now more careful with archive + names presented by libelf and Elf_Arhdr. +2017-10-12 David Anderson + * print_section_groups.c: Added a cast on a free() call + to avoid a compiler warning. + * dwarfdump.c: On an archive (.a) dwarfdump would print + a useless warning on encountering a special / or // + member. Now just skips those, and if some other member + is not an object dwarfdump prints a more useful message + to identify the particular member. + * print_die.c: The attributes_encoding_table was not + getting reset properly in the case of reading an archive, + and that is now fixed. +2017-10-05 David Anderson + * tag_attr.list: Changed the spelling from DW_AT_ranges_base + to the final DWARF5 spelling, DW_AT_rnglists_base. +2017-10-05 David Anderson + * dwconf.c: Open the config file "r", not "rw". +2017-09-26 David Anderson + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. +2017-08-22 David Anderson + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. +2017-08-21 David Anderson + * CMakeLists.txt: Fix the TAG_TREE_SOURCES and TAG_ATTR_SOURCES + entries. + * Makefile.in: Fix a misuse of LD_LIBRARY_PATH and use + LIBDWARF_PATH as the path to libdwarf.so. + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. + * common.c: #include changes help for builds on Windows. + Rename a parameter to avoid accidental name-shadowing. + * configure.cmake: Fix ac_check_lib() uses. + * dwarfdump.c,dwconf.c,esb.c: Modify #ifdefs to ease building on Windows. + * getopttest.c: Cast/printf changes avoid warnings on 32 and 64 bit + builds. + * macrocheck.c: An extra newline makes the 'make test' output + easier to understand. + * testesb.c: The check() function is local, so call it 'static' to + avoid a compiler warning. +2017-07-24 David Anderson + * configure.in, configure.cmake, config.h.in: Renamed + LOCATION_OF_LIBELFHEADER to HAVE_LOCATION_OF_LIBELFHEADER + for consistency with config.h.in generally. + * configure: Regenerated +2017-07-24 David Anderson + * configure.in, configure.cmake: Consistent use of + LOCATION_OF_LIBELFHEADER so Windows can build libdwarf with + configure or cmake. + * configure: Regenerated +2017-07-09 David Anderson + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. +2017-05-28 David Anderson + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. +2017-05-28 David Anderson + * macrocheck.c: Trivial revision of main() declaration + to our standard format. + * print_reloc.c: We were reading one-past the end + of symtab entries(now fixed). + Now relocation sections show the Elf section index + and we print them in order as in the object file + (earlier it printed in a fixed order not related to + the object file). + Deleted the rel/rela section name arrays, + we already have the section name at hand. +2017-05-27 David Anderson + * esb.c: For selftest now indents report lines + to make it easier to see the overview pass/fail. + * Makefile.in,macrocheck.c,print_reloc.c: Makes macrocheck + self test results clearer (pass/fail) and adds a check + on the array of relocation section data in print_reloc.c. +2017-05-26 David Anderson + * section_bitmaps.h,section_bitmaps.c: Added comments. +2017-05-25 David Anderson + * common.c,tag_attr.c,tag_tree.c: Update version string. + * dwarfdump.c: Update version string. + Instead of using bitmaps for printing sections and relocations + use char arrays instead. Faster, easier to read, and much + easier to expand to the longer lists of sections. + By using fixed size arrays for this the compiler can check + for simple errors. + * print_reloc.c: Moved #defines over to section_bitmap.h + Arrays are now fixed size to give compiler the ability to + notice simple coding errors. Added the new DWARF5 sections + to lists of what is to print. We do not use zero as a section + number so we add an unused zero element to each array. + * print_reloc.h: Made idempotent with ifndef. + * section_bitmaps.c: Now uses the char array id + and indexes starting at 1 (per the #defines in section_bitmaps.h). + Revised the code in 'make selftest' to do more complete checking. + * section_bitmaps.h: Now all the REL and RELA #defines are here + so it's easy to see them all at once. Now using indexes + starting at 1, not bitfields. Faster,simpler, and for a given + dwarfdump run the switch from bitmaps will expand + static data by well under 20 bytes total. +2017-05-18 David Anderson + * dwarfdump.c: Fixed a small memory leak in special_program_name(). + Deleted four lines of test code that never got removed. +2017-05-17 David Anderson + * CMakeLists.txt: Add section_bitmaps.h,.c. + * Makefile.in: Add section_bitmaps.o, section_bitmaps.h. + Add section_bitmaps 'make selftest' rules. + * section_bitmaps.h, section_bitmaps.c: The bit field code + used to control the -E option set was out of date and + difficult to get right. Now 'make selftest' ensures that + the bits match up with the strings. + * glflags.h, glflags.c: Fixed the misnamed gf_type_flag to be + gf_types_flag. + * globals.h: Move defines to section_bitmaps.h + * common.c: Use sanitized() on incoming strings we print. + * print_aranges.c,print_debugfission.c: Names from elf now + get sanitized() for printing. + * print_section_groups.c: Improved one interface. + * print_die.c: Critical fixes so we get the section names on output + when we want them, and sanitized(). + * common.c, print_aranges.c, print_debugfission.c,print_ranges.c, + print_strings.c: Calling sanitized() to ensure printf safety. + * print_section_groups.c: Revised function interface. + Do not use May 13 interface. + * print_die.c: Crucial revision so DWARF4 debug_types prints. + * dwarfdump.c: Revised flags so the gf_section_groups_flag works. + Revised the section bitmaps code. + * print_section_groups.c: Delete a printf left in + for debugging. +2017-05-13 David Anderson + * CMakeLists.txt, Makefile.in: Mention new + print_section_groups.c or .o. + * dwarfdump.c: Add needed section names in + print_object_header() data. + Implement glflags.gf_section_groups_flag. + * print_section_groups.c: New, implementing handling of section + groups (aka COMDAT). +2017-04-20 David Anderson + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. +2017-04-17 David Anderson + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. +2017-04-16 David Anderson + * CMakeLists.txt: Added in new files glflangs.c, .h +2017-04-12 David Anderson + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. +2017-04-06 David Anderson + * Makefile.in: Add glflags.o. Instead of dozens of + boolean variables, a struct with the booleans + makes understanding them much easier. + * glflags.h, glflags.c: define and initialize all these + flags and settings. + * dwarfdump.c: Use the new glflags.h setting fields. + Add one new one for debug_names (nothing useful + implemented yet). + * globals.h: Remove the flag global extern lines. + * naming.c,print_abbrevs.c, print_aranges.c, print_die.c, + print_frames.c, print_gdbindex.c, print_lines.c, + print locs.c, print_macro.c, print_macros.c, + print_pubnames.c, print_ranges.c, print_static_funcs.c, + print_static_vars.c, print_strings.c, print_types.c, + print_weaknames.c: Using the new + flag globals as glflags.gf_ + * print_dnames.c: New for .debug_names printing. +2017-04-06 David Anderson + * dwarfdump.c, Makefile.in, globals.h: + This is a small start on dealing with DWARF5 .debug_names. +2017-04-02 David Anderson + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. +2017-04-02 David Anderson + * dwarfdump.c: If printing group 2 (DWARF5 dwo sections) + ensure that printing of those sections only possible + in group 1 is turned off. +2017-03-30 David Anderson +2017-03-30 David Anderson + * dwarfdump.1: Documenting the new -x groupnumber= option. + * dwarfdump.c: Adding groupnumber option support. + * sanitized.c: Removed trailing whitespace +2017-03-24 David Anderson + * dwarfdump.c: Now argv[0] is checked before setting the + program_name global variable. If it contains /dwarfdump.O + that part of the string is shortened to /dwarfdump. + Doing this removes a need for the regressiontests to use sed + and shortens the regressiontests runtime on a one machine from + 77 minutes to 23 minutes. +2017-03-23 David Anderson + * common.c, dwarfdump.c, tag_attr.c, tag_tree.c:Update + version string. +2017-03-21 David Anderson + * sanitized.c: Now all non-ascii bytes are changed to %xx + and a % input character is changed to %xx too + iso-8859 and for html are now sanitized using URI + %xx notation so the printf output looks sensible. + These usually represent a corrupted string in an object file. +2017-03-21 David Anderson + * print_die.c: Added casts to call args match with the + function declaration. So a fussy compiler will + be less likely to complain. + * sanitized.c: Added explicit initializers to global variables. + Moved a static var to the function that uses it. +2017-01-31 David Anderson + * esb.c(esb_force_allocation): Code was wrong all this time. + Fixed and corrected commentary. Updated copyright. +2017-01-30 David Anderson + * esb.c(esb_force_allocation): Add commentary about to clarify + the purpose of the function. +2017-01-23 David Anderson + * dwarf_tsearchbal.c(dwarf_tsearch): In memory exhausted situation the + function could leak a little bit of memory. + diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2006 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2006 new file mode 100644 index 0000000..dbedb67 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2006 @@ -0,0 +1,332 @@ +2006-12-24 David Anderson + * DWARFDUMPCOPYRIGHT: Added GPL copyright text with + explanation of the intended content. + * COPYING: added text explaining confusion of GPL vs LGPL. + Thanks to Chris Quenelle for pointing out the disconnect + between DWARFDUMPCOPYRIGHT and the source files in dwarfdump. +2006-12-21 David Anderson + * tag_tree.list: add tags to make allowed list more complete. + Omission noticed by Marcel Mettes. +2006-06-14 David Anderson + * print_frames.c: Clean up printing of augmentation data by + eliminating dangling 0x (for eh_frame). +2006-04-28 David Anderson + * dwarfdump.conf: Now has x86_64 register names. + x86_64 with help from Tom Hughes (verified + from independent sources). + Added m68k register names and refined x86 list + by looking at various information-sources. +2006-04-18 David Anderson + * *.c: Ran indent so all now follow a standard look. + * dwconf.c: Added fclose(conf_stream). +2006-04-18 David Anderson + * dwarfdump.c: Forgot to call key new functions for + handling variable-size frame data and different + frame rule initialization value. + * dwconf.c: Add a default print for CFA in case of + an omission in dwarfdump.conf. + * dwarfdump.conf: Move setup and rename the ABIs slightly. +2006-04-17 David Anderson + * dwarfdump.conf: Correct typos. Remove some register names. + * dwarfdump.c: Fix compiler warnings, fix -x option usage message. + * dwconf.h: Fix compiler warnings by changing types. + * dwconf.c: Change error checking so we check all errors, do + not stop at first error. Ran indent. Added code to check + for extra junk after operand(s). + * print_frames.c: Fix compiler warnings. + * Makefile.in: get used in install rule and creating + places to search for dwarfdump.conf +2006-04-16 David Anderson + * dwarfdump.conf: New dwarfdump configuration file. Makes using frame + information easy to read and correct for any ABI/ISA + without rebuilding dwarfdump. + * Makefile.in: Added new files dwconf.h dwconf.c + * dwconf.h dwconf.c: New files implement reading dwarfdump.conf + and help print_frames.c print frame information correctly + for ABIs specified at runtime. + * dwarfdump.1: document -x commands. + * globals.h: Minor changes to support dwarfdump.conf + * print_frames.c: Major changes to support a run-time description of + the frames info and dwarfdump.conf. + * print_frames.h: Changes to support a run-time description of + the frames info and dwarfdump.conf. + * print_sections.c: Minor tweaks to support a run-time + description of the frames info and dwarfdump.conf. + +2006-03-31 David Anderson + * Makefile.in globals.h print_sections.c: Refer to new + print_frames.h print_frames.c. + * print_frames.h print_frames.c: Extract cie, fde printing + to separate file, separating loop logic from the printing + of an entry from the loop. +2006-03-31 David Anderson + * dwarfdump.c global.h print_sections.c: Preparing for + dwarf3 frame interface. + * print_die.c: Corrects handling of DW_AT_encoding (etc) value. +2006-03-29 David Anderson + * print_sections.c: define DWARFDUMP_TURN_OFF_MIPS_REG_NAMES + at compile time + to turn off the MIPS register names printing. Instead + (aside from cfa) use a name like r4 (where the DWARF + register number follows the letter 'r'). + Indent. Initialize some local variables at declarations. +2006-03-13 David Anderson + * print_sections.c: Now gets gnu eh_augmentation data by calling + dwarf_get_cie_augmentation_data() or dwarf_get_fde_augmentation_data() + and prints it (use -v to see cie data). + Now prints DWARF3 frame information. +2006-03-08 David Anderson + * print_sections.c: Add 'break;' at line 710. + Thanks to Richard Stuckey for noticing. +2005-12-01 David Anderson + * dwarf_names.awk: use snprintf instead of sprintf for safety. +2005-12-01 David Anderson + * Makefile.in: Build attr/tag trees with + individual commands to catch build errors. + * tag_attr.c,tag_tree.c: Verify that + tables fit in the generated C code and check for + format errors in the *.list files. + * tag_attr.list, tag_tree.list: Added some valid entries. + * globals.h: add DWARF_ERROR3 macro for better diagnostics. + * print_die.c: Show both sides of questionable tag relation + in CHECK -k diagnostic output. + +2005-11-25 David Anderson + * print_die.c: DW_AT_stride_size changed to DW_AT_bit_stride, + added DW_AT_byte_stride. + * tag_attr.c,tag_tree.c: fixed array size now a #define for + readability. + * tag_attr.list: Added DWARF3 attributes, also new TAGs. + * tag_tree.list: Added DWARF3 TAGs. + +2005-11-08 David Anderson + * makename.c: remove non-standard malloc.h include, + stdlib.h suffices and is already included. + +2005-10-24 David Anderson + * tag_attr.c tag_tree.c: added DWARF3 TAGs to string array. + +2005-08-01 David Anderson + * Makefile.in: Add esb.o and test rule (test code for esb.c). + * dwarfdump.c: Remove old static buffer initialization. + * print_die.c: Use esb now, avoid crash due to long loclist + overrunning static buffer. Uses snprintf now, not sprintf. + snprintf is for safety. + * esb.h esb.c: Adding extensible string buffer (esb) code. + * testesb.c: Test code for esb.c. + * print_reloc.c: size field is now Elf64_Xword for + Elf64 as Elf64_Word is only 32 bits. + +2005-07-15 David Anderson + * dwarfdump.c: Add print of .debug_pubtypes, remove + erroneous dealloc after dwarf_formstring() call. + * globals.h: Add declarations for .debug_pubtypes print. Add + declaration for full dealloc. + * print_die.c: Remove erroneous dealloc after dwarf_formstring() call. + * print_exception_tables.c: Call dwarf_fde_cie_list_dealloc() + for complete dealloc. + * print_sections.c: Remove incorrect dealloc() call. + Add calls to new dealloc routines. Add support of .debug_pubtypes + print. +2005-07-14 David Anderson + * print_sections.c (print_line_numbers_this_cu): Use new + dwarf_srclines_dealloc() for deallocation after + dwarf_srclines() called. + +2005-04-13 David Anderson + * print_sections.c: Factors out common print code into + a new routine. Avoid indexing past end of register names + array. Adds checks and prints so that certain errors + in pubnames-like sections are printed usefully (and dwarfdump + then stops if libdwarf gave an error). + +2005-03-21 David Anderson + * dwarfdump.c: Add -F flag to + request .eh_frame section print. Changed -f flag meaning + to print .debug_frame only. -a flag no longer + prints .debug_frame by default. + * print_sections.c: avoid printing an eh_frame we don't understand. + Add new information per CU when printing line info: specifically + the line section offset. + * globals.h: Added arguments to print_frames() for -F flag. + +2005-03-18 David Anderson + * print_sections.c: Correct macro section printing. + +2004-10-28 David Anderson + * DWARFDUMPCOPYRIGHT config.h defs.h dwarfdump.c globals.h + makename.c makename.h print_die.c print_exception_tables.c + print_reloc.c print_sections.c tag_attr.c tag_attr.list + tag_tree.c tag_tree.list: Copyright update, SGI + corporate address change. + +2004-10-26 David Anderson + * acconfig.h: removed. Was old style autoconf usage. + * configure.in: Updated AC_DEFINE usage, adding args 2 & 3. + * config.guess: Updated. timestamp='2004-06-11'. + * config.sub: Updated. timestamp='2004-03-12'. + * configure config.h.in: regenerated with autoconf 2.58. + +2004-05-14 David Anderson + + * print_die.c (print_die_and_children): Change to iteration + on siblings (still recursing on children). + + +2004-03-30 David Anderson + * dwarfdump.c (main): getopt() string should contain k:g + not kg: Thanks to Peter Seiderer for pointing this out. + +2003-12-31 David Anderson + * README: Added configure example. + * Makefile.in: Removed bogus LIBS line, updated copyright date. + * acconfig.h: Added LGPL copyright to match libdwarf + Silly, but it matches libdwarf version boilerplate. + * config.guess config.sub: new versions from automake-1.6. + * config.h.in configure: Regenerated. + + +2003-10-06 David Anderson + * dwarfdump.c print_sections.c: applied indent(1). + * print_die.c: applied indent and added ; after + invocations of macros PUSH_DIE_STACK POP_DIE_STACK SPACE + as these were confusing indent a bit. + The indent control file .indent.pro contained: + -bad -bap -nbbo -br -ce -brs + -l72 -lc72 -hnl -nprs + -fca -i4 -lp -psl -npcs + + + +2003-10-02 David Anderson + * dwarfdump.c: Add -g to indicate use of older + location entry code in libdwarf. So dwarf_loclist + and dwarf_loclist_n are testable. + * globals.h: Added use_old_dwarf_loclist flag so one + can choose the old dwarf_loclist() interface. + For testing. + * print_die.c: Rearranged to avoid code duplication. + Now supports .debug_loc fully. + * print_sections.c: Prints .debug_loc now. + +2003-09-29 David Anderson + + * print_die.c: with -v, print 'loclist' start and + end addr and also a hint that DW_FORM_indirect is used. + No change for normal output (for now). + +2003-05-19 David Anderson + * dwarfdump.c call dwarf_srcfiles() to get file names + per cu and pass down to die print routines. + Removed incorrect tests for when to print ".debug_info", + leaving simpler test. + * print_die.c globals.h: print file name (from line info) + with DW_AT_decl_file, adding data from dwarf_srcfiles + to argument list of a few routines to make that possible. + * print_sections.c: moved "line number info" string print so + it prints for -v as well as normal line ouput. + +2002-10-23 Amaury Le Leyzour amaury@sgi.com + * print_sections.c (print_weaknames): Changed + DW_DLA_TYPENAME to DW_DLA_WEAK at dwarf_dealloc(). + +2002-10-22 Tom Hughes + * print_sections.c: macro printing now supported. + * dwarfdump.c: removed erroneous dwarf_dealloc() + of string returned by dwarf_errmsg(). + +2002-11-22 David Anderson + * dwarf_names.awk at_list.awk: Allow an name to have two + spellings so the historical name preserved yet the dwarf3 + version is supported. First name seen is used/reported + by dwarfdump. + * dwarf.h: DW_TAG_template_type_param(eter) + DW_TAG_template_value_param(eter) DW_AT_namelist_itm(s) + are the ones with alternate spellings now. + Added Universal Parallel C TAGs/Attributes in + user namespace. + * tag_attr.c tag_attr.list tag_tree.c tag_tree.list: + Use the DW_TAG_template_* dwarf3 spellings. + + +2002-05-08 David Anderson + * tag_attr.list dwarf.h: DW_AT_namelist_items is + wrong, changed to DW_AT_namelist_item + +2002-04-29 Stephen Clarke + * dwarfdump.c (main): #ifdef for __CYGWIN__ on open(). + +2001-06-14 David Anderson + + * print_sections.c: Calling the new libdwarf function + dwarf_get_arange_cu_header_offset() so we can print + the cu header offset for aranges. + + +2000-07-14 Fred Fish + + * configure.in (LOCATION_OF_LIBELFHEADER): Fix typo for configure + variable to be tested and enclose libelf/libelf.h in <>. + * configure: Regenerated. + +2000-07-10 Fred Fish + + * Makefile.in (install): Install dwarfdump.1 from $(srcdir). + +2000 June 12 davea@sgi.com + print_sections.c the DW_CFA_offset_extended print + did not multiply by data-alignment factor in the + -v -v detailed output. + And the offsets used %2d when the values were + unsigned int, so now %2u. + + And not all cfa prints of values had + necessarily a type to match + %llu or %lld where required. Depended on the size of Dwarf_Signed + and Dwarf_Unsigned. + So now explicitly use cast to the + right type to match the % format. +2000 April 13 davea@sgi.com + print_sections.c - 1.56 + - A single byte of zero is a perfectly legitmate null + abbreviation entry (in .debug_abbrev) + now we print those directly and avoid a warning + from dwarfdump + + print_die.c - 1.42 + - Explain what combo checker is doing and make it + more maintainable (and fix bug which would + not be hit, but was real enough (in combo checker), + using too large a number as highest tag number). + + tag_tree.list - 1.2 + - Add valid parent/child relationships so checker + does not report valid entries as bogus. + + + + +2000 Feb 24 + Jason Merrill noticed that gcc did + not like gcc -E foo.list, so incorporated his fix so + now the Makefile.in makes a link and does gcc -E _tmp.c + +2000 Jan 26 + elena.demikhovsky@intel.com noticed that 3 statements in + print_sections.c got warnings from the compiler + she was using. Simple casts (provided by her) fixed these. + +1999 July 21 + davea@sgi.com + print_sections changed to allow printing + of dwarf-ish egcs c++ .eh_frame data + + +1999 June 14 + Fred Fish fnf@ninemoons.com contributed + autoconf'ing of the libdwarf and dwarfdump source. + + + +1999 June 10 + ChangeLog started. davea@sgi.com David Anderson diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2007 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2007 new file mode 100644 index 0000000..d1230b5 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2007 @@ -0,0 +1,108 @@ +2007-12-09 DavidAnderson + * print_sections.c print_frames.c: Forgot to commit yesterday. + yesterday's commit includes renaming _dwarf_fde_section_offset + _dwarf_cie_section_offset, _dwarf_print_lines, _dwarf_ld_sort_lines + to dwarf_* form while retaining support for the now obsolete + _dwarf_* form. +2007-12-08 DavidAnderson + * config.h.in, configure.in: Latest linux libelf.h requires + _GNU_SOURCE to get off64_t defined so dwarfdump compiles. + Only define _GNU_SOURCE if libelf.h defines off64_t. + Regenerated configure. + * config.guess, config.sub: Updated to 2.61 + * acconfig.h: Deleted, removing autoconf complaint. +2007-10-15 DavidAnderson + * print_die.c (clean_up_die_esb): New function + cleans up malloc space. + * print_reloc.c (clean_up_syms_malloc_data): New function + cleans up malloc space. + * dwarfdump.c (main): Call new cleanup functions at end. + * globals.h: Declare new cleanup functions. + +2007-09-04 DavidAnderson + * print_die.c (print_attribute): For DWARF4: DW_AT_high_pc: + add qualifier to value when the value is an offset from + DW_AT_low_pc (thus not itself a address). + Update the address of the FSF. + * print_frames.h DWARFDUMPCOPYRIGHT print_sections.c + print_reloc.c dwarfdump.c tag_tree.c tag_attr.c + esb.c esb.h makename.c acconfig.h dwconf.c makename.h + dwconf.h globals.h print_frames.c: + Update the address of the FSF. + +2007-07-03 DavidAnderson + * print_sections.c (dump_block): Removed superfluous return byte from + printed characters. Removed unused variables. + * print_die.c: A little refactoring for clarity. + * globals.h: dwarfdump_print_one_locdesc() is now a + global-to-dwarfdump function. + * print_frames.c: Now (with -v) prints dwarf expression bytes + in frame expressions readably. +2007-07-02 DavidAnderson + * dwarfdump.c: Add new -R option for 'generic' register sets. + * dwarfdump.1: document -R, add new -x documentation. + * dwconf.c: Set up -R configuration. Slight revision of + register printing code. + * dwconf.h: Interface to register name printing simplified. + * print_frames.c: Use the simpler register name interface. + * dwarfdump.conf: Add new 'generic' abi for up to 1000 registers. + +2007-07-01 DavidAnderson + * print_frames.c: For DW_CFA_def_cfa_sf & DW_CFA_def_cfa_offset_sf + print a computed data alignment factor. +2007-06-29 DavidAnderson + * dwarfdump.1: Corrected spelling error. +2007-05-25 DavidAnderson + * dwconf.h dwconf.c: Changed field name to + cf_named_regs_table_size as old name was less than clear. + * dwarfdump.c: Call frame table setup with + cf_table_entry_count not cf_named_regs_table_size. The newly + renamed field makes it clearer the call was wrong. +2007-05-04 DavidAnderson + * print_die.c: printing of global offset of DIEs + with -G is now more in the style of previous output. +2007-04-18 Chris Quenelle + * Makefile.in: + - use $(srcdir) for files in source directory + - support running rules in parallel by + - use different tmp file names in different rules. + - use more accurate target for dwarf_names.{c,h} + * dwarf_names.awk: Enhance script to be able to generate either + #define-style headers or enum-style headers + * dwarfdump.c: dump most everything by default if no arguments + are given to dwarfdump. This seems to be a more useful default + than showing nothing at all. Also add a -G option to show + the (G)lobal section offset for each die within an a.out. If you + think you're seeing data corruption inside a .debug_info + section, this is a useful option to have. + * print_die.c: Support compressed integer blocks. This is an + array (DW_FORM_block) of LEB numbers used as part of a Sun + extension, DW_AT_SUN_func_offsets. Also add support for + a new dwarf enum DW_ATCF_xxxx. This is used in DW_AT_SUN_cf_kind. + Also, fix DW_AT_upper_bound so it can be a constant or a location + list. DW_AT_count and DW_AT_data_member_location should also be + fixed eventually. + * print_sections.c: Changes to support zero-padding in the middle of + section data. Change offset labels to be a little more clear. + Not sure about the get_str failure. + * tag_tree.list: DW_TAG_compile_unit can contain a DW_TAG_namespace +2007-04-10 David Anderson + * print_reloc.c dwarfdump.c print_frames.c: Unified + copyright to the SGI form. No copyright change. + +2007-04-06 David Anderson + * print_die.c (print_die_and_children): Increase static + depth of die stack. Notice if it overflows and + print error. +2007-02-23 David Anderson + * print_reloc.c: 2 lines added (long) cast in printf + and made %3ld instead of %3d to fix compiler warning. + * print_frames.c: newline was missing from the output. + Thanks to Chris Quenelle for noticing. +2007-02-20 David Anderson + * print_frame.c (print_frame_inst_bytes): Fixed + an off by one error (several places) + when printing dwarf expressions and added commentary about it. + Thanks to Julian Seward for pointing out it was off by one. + * dwarfdump.c (print_error): added fflush of stdout, stderr + where we are going to exit right away anyway. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2008 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2008 new file mode 100644 index 0000000..24a1ffa --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2008 @@ -0,0 +1,96 @@ +2008-12-30 David Anderson + * tag_attr.list: Mark DW_AT_artificial as sensible on + DW_TAG_variable. + * dwarfdump.1: Document -N option to print .debug_ranges. + * Makefile.in: add new source header files + * dwarfdump.c: Implement -N to print .debug_ranges. + * print_sections.c: Allow more flexible printing + of function names for .debug_frame section. + With -N, print .debug_ranges. + * print_die.c: Print .debug_ranges details. + * print_frames.c: Delete useless comment. + * globals.h: Allow re-use of debug_ranges formatting code. + * Makefile.in: Make the header dependency list more complete. + * makename.h: Comment tweaked. +2008-12-08 David Anderson + * print_die.c: the -M option now also prints the form + number (after the form name). And -v prints the DIE + abbreviation code, the index into the relevant abbreviation + table. + * globals.h: Removed unused global variable. + * dwarfdump.c: Removed unused global variable. + * dwarfdump.1: document -M and the new -v features. +2008-12-07 David Anderson + * print_reloc.c (print_relocinfo): Removed unused local variable. +2008-11-19 David Anderson + * globals.h: Added new boolean to support -M. + * dwarfdump.1: Mentioning the -M option. + * dwarfdump.c: Implementing -M, which has each attribute line + show the name of the form. + * print_die.c: Implementing -M option. +2008-10-12 David Anderson + * dwarfdump.conf: Adding power pc register names and table + size for use with -x abi=ppc . +2008-08-13 David Anderson + * dwarfdump.1: When no options (just object files) present + all sections print, now we say that. Renamed fields + in synopsis for readability. +2008-06-23 David Anderson + * print_reloc.c (print_reloc_information_64): Was testing + sym_data_entry_count one place where sym_data_64_entry_count + should have been tested. Thanks to Carlos Alberto Enciso + for noticing. +2008-06-17 David Anderson + * print_die.c: Add to dwarf_formstring failure message. + * README: Correct email: the old sgi.com address is no + longer correct. +2008-06-13 David Anderson + * dwconf.c: Fix an off-by-one condition where + we could index off the end of the cf_regs array in printing + a register name. +2008-04-12 David Anderson + * print_reloc.c: Verify stringtab exists and is + large enough before indexing into it to get a string + in printing relocations. + (Providing default name "" so it's evident from + the output that we used a default name string). +2008-04-09 David Anderson + * print_sections.c (get_fde_proc_name): Initialize some + local variables at declaration. The function is very slow + and needs a replacement. + * print_die.c: Fixes a typo in a comment. + * dwarfdump.c: Added -n option to suppress function name search + when printing FDEs. Current dwarfdump is n-squared at least + getting those names, this is a bandage-type-workaround when + there are so many FDEs the slowness is painful. + * globals.h: Support for -n option. + * print_frames.c: Support for -n option. +2008-04-08 David Anderson + * dwarfdump.c: Added -H option for testing + (it limits the run length). + And the support for -H in printing DIEs. + * globals.h: Added extern for -H option declaration. + * print_sections.c: Added -H option support to limit frames printing. + +2008-04-04 David Anderson + * print_die.c (tag_tree_combination, tag_attr_combination): + Ensure we do not index off the end of the -k checking arrays. + * print_sections.c: Increase the size of a local variable,. +2008-03-03 David Anderson + * dwarfdump.1: Add description of -ka option. + * print_frames.h print_sections.c testesb.c print_die.c print_reloc.c + dwarfdump.c tag_tree.c tag_attr.c esb.c esb.h makename.c dwconf.c + makename.h dwconf.h globals.h print_frames.c: Change tabs + to spaces with expand(1). +2008-03-03 David Anderson + * print_die.c: Now check that DW_AT_decl_file + and DW_AT_call_file indexes are valid and count instances of the + attribute and errors found in it. + * dwarfdump.c: With -ka and -ky now check that DW_AT_decl_file + and DW_AT_call_file indexes are valid and warn if bad. + Thanks to Carlos Alberto Enciso for the suggestion. + * globals.h: Declare new fields for the DW_AT_decl_file + DW_AT_call_file checks. +2008-02-26 David Anderson + * print_die.c (get_attr_value): Print DW_AT_call_file, + DW_AT_call_line, DW_AT_call_column nicely. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2009 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2009 new file mode 100644 index 0000000..9d9a2d5 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2009 @@ -0,0 +1,280 @@ +2009-12-30 DavidAnderson + * configure: Regenerated with autoconf 2.64. + * config.guess, config.sub: Delete these, best not + to have them. +2009-11-24 DavidAnderson + * tag_common.h: Updated 'standard tag table row' and + tag table column maximums now the DWARF4 entries are + in the .list files. Removed dos 'CR' characters at line ends. + * tag_tree.list, tag_attr.list: Added various + DWARF4 entries and added DW_TAG_enumeration_type + under DW_TAG_union_type. +2009-11-17 DavidAnderson + * dwarfdump.1: Document the -u option more fully. + * print_die.c: Check for both info_flag and + cu_name_flag to decide when to print DIEs. +2009-10-12 DavidAnderson + * dwarfdump.c: Updated dwarfdump version string to today. +2009-09-30 DavidAnderson + * dwarfdump.c: Added globals for aranges checking and + to print the resulting error count. + * print_aranges.c: Added checking that all 3 ways + of computing a cu_die_offset from an arange get + the same offset (checked with -r -ka). + * print_frames.c: DW_CFA_cfa_offset_extended_sf + corrected to DW_CFA_offset_extended_sf. +2009-09-01 DavidAnderson + * tag_tree.list: We add + DW_TAG_class_type as a valid child of a DW_TAG_union_type. +2009-08-05 DavidAnderson + * gennames.c: Change include from getopt.h to unistd.h + so the code is more universally compilable. +2009-07-24: David Anderson + * tag_attr.c: Remove duplicate include of naming.h. +2009-06-23: David Anderson + * strstrnocase.c: Corrected typo in TEST code and + added a new test. +2009-06-22: David Anderson + * Makefile.in: switched to personally written + string comparison, strstrnocase.c. + * stristr.c: deleted. + * strstrnocase.c: New code, written by me so no + license issues. + * print_die.c: Call is_strstrnocase(), the new function. + * dwarfdump.1: More fully document -S. + * globals.h: Create extern for is_strstrnocase(). +2009-06-18: David Anderson + * configure: Regenerated. + * Makefile.in: Add stristr.o + * stristr.c: public domain source added to dwarfdump + * print_die.c: Add code and arguments to support -S. + * print_lines.c: print_one_die argument list changed, added + the require argument.. + * dwarfdump.c: Added the -S option. + + * configure.in: Add test to set HAVE_REGEX for the -S option. + * dwarfdump.1: Document the -S options. + * config.h.in: Set the default HAVE_REGEX + * globals.h: Add -S globals, change the print_one_die() + prototype to support -S. + * print_aranges.c: Alter the print_one_die calls added + to support -S. +2009-06-06: David Anderson + * naming.c,naming.h: New files that implement the + ellipsis functionality of dwarfdump and defer to + libdwarf to get the names of the TAGs, attributes, FORMs, etc. + * gennames.c: This file has moved to libdwarf, no longer + present in dwarfdump. + * esb.h, esb.c: Change certain char* arguments to const char* + to avoid compiler warnings. + * print_static_vars.c,print_static_funcs.c, + print_sections.c,print_strings.c, print_locs.c, + print_lines.c, print_pubnames.c,print_ranges.c, + print_macros.c,print_types.c,tag_common.c, + print_weaknames.c, print_aranges.c: Include + changed from dwarf_names.h to naming.h + * tag_common.h: Removed the tag_name array, libdwarf + provides the TAG, ATTR, etc name strings now. + * dwarfdump.c: Updated DWARFDUMP_VERSION string. + * tag_tree.c,tag_attr.c: Include changed from dwarf_names.h to + naming.h. simplified long complicated lines, remove dbg argument + to get_TAG_name. + * print_die.c,print_abbrevs.c: Include changed from dwarf_names.h + to naming.h. + Calls to get_TAG_name (etc) no longer have a dbg argument. + * Makefile.in: We no longer build generated file names.c, + we build naming.c (hand coded, not generated). +2009-05-07: David Anderson + * dwarfdump.cc: updated DWARF_VERSION string. + * Makefile.in: dwarf_names* are now generated by C, + so 'clean' now cleans them out. +2009-05-04: David Anderson + * common.h, common.c: Extracted simple utility routines + into their own files. + * dwarf_names.awk, at_list.awk: deleted. gennames.c replaces these. + * tag_common.c, tag_common.h: Removed the simple utility + routines from these files to simplify dependencies. + * tag_attr.c, tag_tree.c: Include new common.h. + * print_frames.c: Adding address_size argument to call. + * print_frames.h: Adding new address_size argument to + get_string_from_locs() declaration. + * print_locs.c: Gets and uses CU-specific address_size. + * print_ranges.c: Adding commentary. + * print_die.c: adding DIE argument to ensure correct + address size used for the CU in question. + * Makefile.in: Now handles common.* and gennames.c changes. + * gennames.c: New code emitting string 'get name' source. + Replaces awk source. +2009-04-04: David Anderson + * Makefile.in: clean up 'clean' and 'distclean' + so that distributed files are not cleaned out by 'clean' + and all generated files (even those shipped in + distribution) are cleaned out by distclean. + * dwarfdump.c: Now calls the new + libdwarf function dwarf_set_frame_cfa_value() and other + such functions to specify all the values libdwarf needs. + * dwarfdump.conf: Sets the cfa_reg: value to + a new higher value (1436) to avoid conflict with largest + known register count. + * dwconf.h: Corrected commentary on DW_FRAME_CFA_COL3. + * dwconf.c: Now uses DW_FRAME_CFA_COL3 as default for + interface 3, rather than a directly typed number. + Sets undefined-value and same-value pseudo-register numbers. +2009-04-03: David Anderson + * dwarfdump.1: Amplified -R and -x abi= documentation. + * dwarfdump.conf: Added generic500 generic100 abis. +2009-03-29: David Anderson + * print_die.c: Moved print_infos() to here. + * dwarfdump.c: Moved print_infos() out of here. + * globals.h: Declarations changed to allow moving + print_infos(). + * dwarf_names.awk: Eliminate a pointless space before + a newline in the generated code. + * print_locs.c: Add -v section offset output to loclist printing + of the debug_loc section so the entries can be matched to + loclist printing initiated from .debug_info. +2009-03-24: David Anderson + * README: Would be nice if all could use dwarfdump2, + not this C dwarfdump. + * dwconf.c: Initialize new frame regs configure data and + parse it in the .conf file. Fixed old formatting mistakes. + * dwconf.h: Add new fields to frame regs configure struct. Make -R + be 1200 regs so that -R covers all the currently popular ABIs. + * print_die.c, print_lines.c, print_frames.c: Change %# to + 0x% so that zero prints with leading 0x consistently. + * dwarfdump.c: -R is now 1200 registers. So config function + changed and usage message needed update. + * dwarfdump.1: Change -R to 1200 and document -C. + * dwarfdump.conf: Add same_val_reg: and undefined_val_reg: + initial values where needed or interesting. + * print_macros.c: Fix old formatting mistake. +2009-03-23: David Anderson + * print_sections.h: New file for print_*.c + sources. + * dwarfdump.1: Added -C documentation. + * Makefile.in: updated 'mandir' so it works with + current configure (so now make install properly installs + the man page). + * print_sections.c: Moved get_fde_proc_name() and related + code to print_frames.c, where it is referenced. + * dwarfdump.c: No longer turn on info_flag with -f or -F. + Moved the Usage strings into a string table and loop through + to print them. + * globals.h: Removed get_fde_proc_name() declaration. + * print_frames.c: Added get_fde_proc_name() here + and removed the 'inlined:' from the abstract origin + name. +2009-03-20: David Anderson + * print_static_vars.c, print_static_funcs.c, print_strings.c, + print_locs.c, print_pubnames.c, print_lines.c, print_ranges.c, + print_abbrevs.c, print_macros.c, print_types.c, print_weaknames.c, + print_aranges.c: Moved the print_* functions from print_sections.c + into individual sourcefiles. + * Makefile.in: Now lists the new sourcefiles. + * print_sections.c: Deleted code moved to individual sourcefiles. + Added code to try to find the name from a DW_AT_abstract_origin + DIE when a subprogram DIE itself has no DW_AT_name; + * dwarfdump.c: Remove unused local variables. Use DWARFDUMP_VERSION + #define to set version string. + * tag_tree.c: Fix && || problem with parentheses. + * tag_attr.c: Fix && || problem with parentheses. + * print_frames.c: Moved the 'print_frames' function itself from + print_sections.c to here. +2009-03-17: David Anderson + * globals.h: Created predicate function + should_skip_this_cu() predicate function. Eliminating + code duplication. + * print_frames.c: Fix a hex value output to have a leading + 0x as all hex values should (when printed). + * print_sections.c: Call should_skip_this_cu(), which + replaces duplicate code. + Fix the arange print: now the hex value has a leading 0x + as all hex values should. get_proc_name() had local + variable funcnamefound initialized incorrectly, now is + set to 0 as it should be. get_nested_proc_name() + now initializes string buffers. get_fde_proc_name() + now initializes its string buffer. Surprisingly + things worked adequately before in spite of the errors. + * dwarfdump.c: Call should_skip_this_cu(). Implementation + of that new function is in this source file. +2009-03-16: David Anderson + * print_frames.c:DW_CFA_restore output had a spurious newline. + Removed 2 pointless blank lines an initialized 2 local variables. + * print_sections.c: Removed a pointless redeclaration of a function + in libdwarf.h. check_info_offset_sanity() was missing a + return statement in one place, which could lead to spurious + extra (and silly) error text. +2009-03-09: David Anderson + * print_die.c: Make a comment easier to understand. +2009-02-28: David Anderson + * Makefile.in: add tmp-*.tmp to the 'clean' rule. +2009-02-17: David Anderson + * print_sections.c,print_die.c,tag_common.c,print_frames.c: C99 + in-line declarations and // comments are not intended here, + this removes a few that were introduced accidentally. +2009-02-16: David Anderson + * Makefile.in: Removed some use of awk and + simplified some shell scripting here. + renamed temp files, no longer named with + underbars, they uniformly start with 'tmp-'. + * print_sections.c: Added the new argument required + by the updated dwarf_names.c functions argument lists. + * tag_tree_ext.list: List 'common extensions' + of tag->tag relationships. + * tag_attr_ext.list: List 'common extensions' + of tag->attr relationships. + * print_die.c: New 'common extension' tables used + for checking tag->tag and tag->attr relationships + unless turned off with -C. + * dwarf_names.awk: Removed tabs so generated names.c not so + spread out. Added argument to the generated functions so + tag_tree.c, tag_attr.c can use these generated functions nicely. + * dwarfdump.c: Adding -C option, which exposes + some 'common extensions' of dwarf uses as DWARF CHECK + (-ka) warnings. By default these extensions not reported + as warnings. + * tag_tree.c: Now generates base and extensions tables. + Code in common with tag_attr.c is in tag_common* files. + * tag_attr.c: Now generates base and extensions tables. + Code in common with tag_tree.c is in tag_common* files. + * tag_common.c, tag_common.h: New files with the common + data extracted from tag_tree.c and tag_attr.c + * globals.h: global flag added for -C. + +2009-02-14: David Anderson + * configure.in: Define --enable-nonstandardprintf + * config.h.in: new #undef HAVE_NONSTANDARD_PRINTF_64_FORMAT + * configure: Regenerated. + * config.guess, config.sub: Latest version from GNU. + * Makefile.in: Referenced configure variable to avoid + irritating message at configure time. + * README: document --enable-nonstandardprintf + * print_sections.c, print_die.c, print_reloc.c, dwarfdump.c, + dwconf.c, print_frames.c: Use libdwarf.h DW_PR_ printf macros + for for better portability. +2009-02-13: David Anderson + * print_sections.c: Ensure we are checking line table header + correctness whichever line-table-print code is being used. + Allow ARM line header table (which has a bug) to be used. + * dwarfdump.c: Print lines_result total with checking on. + * globals.h: Add lines_result global to count line botches. +2009-02-11: David Anderson + * print_sections.c, print_die.c: DWARF_CHECK_ERROR* + macros now get the count struct passed in. + * tag_tree.c, tag_attr.c: Add a comment in the output + identifying the output as generated code and + with the generation date/time inserted. + * globals.h: Accept the struct in DWARF_CHECK_ERROR* + macros so we can update the error count in the macro. +2009-01-31: David Anderson + * Makefile.in: Remove compilation of _tag_attr_table.c + and _tag_tree_table.c as those are #included in + print_die.c, not separately compiled. + * print_frames.c: A formerly-static function now called + from another file, so declare it here. + * print_sections.c: Improve the printing of the .debug_loc + section. + * print_die.c: A couple of errors were missing their error + count increment. + * tag_attr.list tag_tree.list: Some normal relationships + were left out of the tables: fixed now. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2010 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2010 new file mode 100644 index 0000000..e281cae --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2010 @@ -0,0 +1,105 @@ +2010-09-30 DavidAnderson + * dwarfdump.c: Now -a no longer implies -c because + the -c option is not guaranteed to work by the DWARF spec, + nor is -c really necessary. + * README: More tweaks on the 'install' issue. +2010-09-29 DavidAnderson + * README, Makefile.in: Amplified make install instructions. +2010-09-20 DavidAnderson + * print_die.c: If a location form is wrong report + an error but continue operating. + * dwarfdump.c: Implement print_error_and_continue(). + Fix mistakes in usage message. + * globals.h: Declare print_error_and_continue(). +2010-04-04 DavidAnderson + * dwarfdump.c: New version date. + * configure: regenerated. + * addrmap.c: Added a comment to mention that tdestroy is + GNU only, POSIX does not mention a way to delete the + tsearch tree. Hence the code does #define USE_GNU 1 + to expose the tdestroy function prototype. +2010-04-03 DavidAnderson + * print_frames.h: Added new arguments to a function to get better + function names printing. + * configure.in: Added test for tsearch functions so dwarfdump + will still compile if they are not present. + See HAVE_TSEARCH macro. + * configure: regenerated. + * Makefile.in: Now names object for addrmap.c + * addrmap.c: New file to map pc address to function names + so fde printing gets functions named properly (using tsearch). + * addrmap.h: New file to map pc address to function names + so fde printing gets functions named properly (using tsearch). + * print_lines.c: Correct the calculation of the number + of error checks. + * dwarfdump.c: Added fdes error check print. + * config.h.in: Now handles the HAVE_TSEARCH macro. + * globals.h: Added declarations for the fde error check + globals. + * print_frames.c: Now uses addrmap.h functions to do a + better job of printing function names in the frame output. +2010-03-31 DavidAnderson + * dwarfdump.1: Added some text about 'harmless' + errors. + * dwarfdump.c: Change the size of the harmless error list + to 50. Change harmless error reporting to be associated + with -k flags. + * dwconf.c: Initialize uninitialized fields to satisfy + a compiler warning. + * globals.h: Declarations added for 'harmless' error + reporting. + * print_die.c: Added commentary. + * print_frames.cc: Change harmless error reporting to be + associated with -k flags. + * print_aranges.c: Now calls dwarf_get_arange_info_b() + allowing proper printing of DWARF4 segment-sensitive + aranges. Change harmless error reporting to be + associated with -k flags. +2010-03-28 DavidAnderson + * dwarf_globals.h: Added interface to print_any_harmless_errors(). + * dwarfdump.c: Added print_any_harmless_errors() implementation + and we call it just before closing libdwarf. + * print_frames.c: Call print_any_harmless_errors after + getting cie/fde list. + * dwarfdump.conf: Add abi named 'arm' for Arm users. + * print_die.c: Initialize a local string pointer to NULL at + the point of definition. +2010-02-14 DavidAnderson + * print_die.c: Add newer DW_OP operators, remove + bogus test of DW_OP_nop as the highest valid operator. + Add table of DW_OPs to simplify testing for zero-operand + operators. + Revise so that the FORM of all attributes print with -M. + Move a local variable declaration to the front of a block + to match C 1990 rules. + String searches now also match on attribute name. + * tag_attr.list: Updated copyright. + * dwarfdump.c: Remove a switch FALL THROUGH in the 'g' case. + * tag_tree_ext.list, tag_attr_ext.list: Added GNU template + parameter tags, attributes. Updated copyright. + * tag_tree.list: Added template parameter tags. Added + entry for nested classes. Updated copyright. + * tag_common.h: Increased STD_TAG_TABLE_COLUMNS and + EXT_ATTR_TABLE_COLS. +2010-01-30 DavidAnderson + * print_die.c: Changed the spelling of one + 'DW_AT_type offset does not point to type info' error message so + one can distinguish which check lead to the message. +2010-01-26 DavidAnderson + * dwarfdump.1, dwconf.c, dwconf.h, dwarfdump.conf: The default + frame values in frame + output are now generic registers like r0 to r99 + instead of MIPS register names. + For the MIPS register names use '-x abi=mips'. + * print_frames.c: Added commentary. +2010-01-17 DavidAnderson + * print_die.c: The special case DW_AT_SUN_func_offsets + now prints identically in dwarfdump and dwarfdump2. +2010-01-03 DavidAnderson + * tag_common.c, common.h, common.c: Remove line + terminator characters. Update copyright year. + * All other files: Update copyright year. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2011 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2011 new file mode 100644 index 0000000..630d451 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2011 @@ -0,0 +1,288 @@ +2011-12-14 DavidAnderson + * print_die.c: Add support for newer DW_OP_GNU_* . +2011-12-13 DavidAnderson + * dwarfdump.c, common.c: Update version string. + * tag_attr_ext.list, tag_common.h: New information on GNU + attributes meant allowing a larger row count. +2011-12-13 DavidAnderson + * tag_common.h: A new attr in the .list means increasing + the column count. +2011-12-13 DavidAnderson + * print_lines.c: Now prints no-column as 0 not -1. + And prints the DWARF3/4 line table values when present. + * tag_attr_ext.list: Add a GNU extension. +2011-10-30 DavidAnderson + * configure.in: Removed a couple bogus lines which were + reporting strange shell errors. + * configure: Regenerated. + * dwarfdump.c: Refine the error outputs so bogus reports + do not print. Refactor the debuginfo/types prints for + better reporting of errors. + * globals.h: Refactoring meant changing one prototype here, + the print_infos() prototype. + * print_die.c: Refactor the debuginfo/types prints for + better reporting of errors. Remove an 'error' report + about DW_DLE_REF_SIG8_NOT_HANDLED. It's unclear + what we might want to do here in future, but an error + report is misleading. +2011-10-29 DavidAnderson + * dwarfdump.c, common.c: Update version strings. +2011-10-29 DavidAnderson + * dwarfdump.c: Reset the CU hints at each new section. + Set up reloc flags so debug_types gets relocated if necessary. + * globals.h: Add DEBUG_TYPES for the .debug_types section. + Add a type-unit signature pretty-printer function. + Add DW_SECTION_REL_DEBUG_TYPES so debug_types can be relocated. + * print_reloc.c: Add entries so debug_types can get relocated. + * print_die.c: Now we handle both debug_info and debug_types + sections. Moved some CU header print operations to little + helper functions to clarify the code. Refactored print_infos() + to deal with debug_types and debug_info. + Using the new libdwarf functions that allow debug_types. + * print_lines.c: Delete unused local variable and its setting code. +2011-10-26 DavidAnderson + * Makefile.in, README: Added Make settings of PREINCS POSTINCS + PRELIBS, POSTLIBS to simplify building when libdwarf or libelf + are not in the normal locations. Documented usable ways to + deal with unusual situations at build time. +2011-10-24 DavidAnderson + * common.c: Update version string. + * dwarfdump.c: Update version string. + To get '-c cu-name' to work we need to set a local flag which is now set. + * dwarfdump.1: Clearly identify the command line options where + URI style input is expected. +2011-10-23 DavidAnderson + * dwarfdump.c: Fix omission of a 'break' statement for case 'q'. +2011-10-23 DavidAnderson + * dwarfdump.1: Now command line input strings + are translated from uri-style + * dwarfdump.c: Translate input strings to from uri style to characters. + Fix indentation mistakes. + Fix constness issues on character strings. + * dwconf.c: Fix constness issues on character strings. + * dwconf.h: Fix constness issues on character strings. + * globals.h: Fix constness issues on character strings. + * makename.c: Fix constness issues on character strings. + * makename.h: Fix constness issues on character strings. + * uri.c: Fix indentation mistakes. +2011-10-22 DavidAnderson + * common.c :Update version string. + * dwarfdump.c: Update version string. Do not set ranges_flag + with -a because that is unsafe to print seperately in general. + * dwarfdump.1: Rewrite the man page for completeness and + accuracy. +2011-10-11 DavidAnderson + * common.c: Update version string. + * dwarfdump.c: Update version string and translate -S strings + from uri-style to standard strings so spaces and other standard + characters are easily represented (no quoting problems). + Update version string. + * print_die.c: For -S -W we were printing the wrong die-level. + * uri.h,uri.c: Add the translate_from_uri() function. + Fix some of the tests in uri.c to match to- and from-uri. +2011-10-09 DavidAnderson + * common.c, dwarfdump.c: Update version strings. +2011-10-09 DavidAnderson + * dwconf.c,print_die.c, print_frames.c: Fix bad indentation. +2011-10-09 DavidAnderson + * print_die.c (get_location_list): Tests for DW_DLV_ERROR + were written without {}, added in the braces. +2011-10-08 DavidAnderson + * dwarfdump.cc: If doing any relevant checking, + instantiate all three possibly-usable BucketGroup objects. + That makes it simpler to avoid a coredump when the user + provides a nonsensical option set -- at a cost of + a very small amount of memory. +2011-10-06 DavidAnderson + * dwarfdump.c: Removed a newline in a printf to match dwarfdump2. + Calls of get_attr_value() now have extra argument, so + fix them. + * dwarfdump.conf: Having 'mips' be an ABI which really reflected + the IRIX abi and IRIX compilers was a mistake. Now that + abi works for modern MIPS. + * globals.h: get_attr_value() adds an argument. + * print_die.c: Expanded the error messages in a couple type_offset_result + checks. Worked around the global nature of esb_base by + saving it locally while we recursively traverse DW_AT_type like things + looking for bad references. Added a 'verbose' argument a few places + so (at a critical point) show_form_itself won't add a form + string when we really don't want it to. + * print_static_funcs.c: Fixed an error string so it says + static funcs, not pubnames. + * print_lines.c: Ensure we only check for errors when + we request such checking. + * print_reloc.c: Ensure we don't index off the end of scn_names. + Deal with missing names and bad symbol indexes consistently. + When working with a .rela, report name as the section name + instead of calling it .rel in the relocations output. +2011-10-05 DavidAnderson + * dwarfdump.c: Increased COMPILER_TABLE_MAX for better reporting. + Provide a 'HARMLESS ERROR' title in output if there are any such. + One issue is (for relocatable objects) libdwarf attempts to continue + even if relocations fail, and a relocation failure is now + counted as a harmless error (even if it turns out to be harmful!). + When sorting compilers_detected, use the producer name to sort + when error counts are identical. If the compiler table fills up, + print a note. With -ka, no longer explicitly turn check_frames_extended + off, it is off already unless the user turned it on explicitly with + -kxe. + * print_die.c: The check for a file number (decl_file) was simply wrong. + Made some detail changes to reporting. + * print_frames.c: Added comments about the inefficiency for getting + function names when printing frames (dwarfdump2 does not suffer + the same inefficiency). + * print_locs.c: Do not use a side effect for updating the index + before printing in print_locs(). +2011-10-03 DavidAnderson + * dwarfdump.c: for -kF, add check_lines. Ensure uniformity + in the usage-text ending. + * print_lines.c: Ensure lines printing suppresses some + error reporting when appropriate. +2011-10-03 DavidAnderson + * print_die.c: Fix the formx code by removing recently-added use of llabs(). + Fix format botch, and correct small error string mistakes. Empty + esb_extra string when it is no longer valid. +2011-10-03 DavidAnderson + * dwarfdump.c: Minor formatting changes. + * print_die.c: Initialize some local varables at definition. Ensure that + we do not get a FORM name in a name string (so a test + works right). And also ensure a FORM name does not get + into a compiler-target setting. Refine the formx_print_value() + so it is more complete (like dwarfdump2). Ensure show_form_itself() + uses the argument, not a global, for the show-form test. + * naming.c: Introduce a {} pair on an 'if' + to reduce the possibility of future + errors. + * print_pubnames.c: Add error details to match dwarfdump2. + * print_ranges.c: If not printing, return immediately. + * print_reloc.c: A test was coded with = where == was needed. + * print_types.c: Move local variable definitions to the + block they are used in. +2011-09-29 DavidAnderson + * dwarfdump.c: Amplifying the -n help string. + * print_abbrev.c: Adding the standard test of the section + print option before printing the header line for the abbrevs section. + * print_die.c: Added a {} pair to avoid eventual bug. + * print_frames.c: Reformatted a comment for readability. + * print_lines.c: Added a status test for consistency with the rest + of the code. + * print_reloc.c: One of the assign-and-test removal changes + in the previous changes was wrong. +2011-09-26 DavidAnderson + * dwarfdump.c: Removed duplicate usage_text strings. + * print_reloc.c: In case we don't have ELF64 headers, + do the last-best-hope internal define in the right place + so it actually helps. For some local variables, ensure + they have values defined at the definition point. + Switch some assign-and-test into two lines. +2011-09-20 DavidAnderson + * Makefile.in: Fixed typo in comment. + * common.c: Use snprintf, not sprintf. Updated version string. + * dwarfdump.c: Correct typo and move usage_text to + a source position corresponding to that in dwarfdump.cc. + Updated version string. +2011-09-16 DavidAnderson + * dwarfdump.c, common.c: Update version string. +2011-09-15 DavidAnderson + * dwarfdump.c, common.c: Update version string. +2011-09-14 DavidAnderson + * dwarfdump.c, common.c: Update version string. +2011-09-08 DavidAnderson + * config.h, configure.in, dwconf.c, globals.h: Switch + compile dependency to configure time HAVE_STDAFX_H + instead a system-dependent ifdef. + * configure: regenerate. +2011-09-08 DavidAnderson + * print_frames.c: Ensure each tsearch tree pointer is zeroed + after emptying the tree. + * addrmap.c: Now we actually free all the records, we were + misusing tsearch a little bit. +2011-09-05 DavidAnderson + * print_frames.c: Now only check duplicate fdes if checking + frames. + * dwarfdump.conf: Updated to use address_size and includeabi. + * dwconf.h, dwconf.c: Adding configure keywords address_size + and includeabi. +2011-09-02 DavidAnderson + * common.c,dwarfdump.c: Update version string. +2011-06-07 DavidAnderson + * dwarfdump.c,common.c: Updated version string. + * dwarfdump.c: Refactor setting of do_print_dwarf + and do_check_dwarf into a function. Ensure that one of + the refactored new functions is called in every case + an option requires such call. Ensured indents ok. + * print_lines.c (print_line_numbers_this_cu): When not checking + added a check to insure we don't try to call a + checking-related function. +2011-06-07 DavidAnderson + * CODINGSTYLE: Added this new document. + * common.c: Updated version string. + * dwarfdump.c: Updated version string, fixed indentation. + * print_lines.c: Two line table checks moved from + decl_file to line_table sections of the summary report + and both now show the possibly-wrong pc. + Since one is not necessarily a bug, the wording of the + message now has 'possibly' in it. + * print_die.c: Reinitialize subprogram-relative pc high/low + seen_PU_high_address + whenever compilation unit changes, and use that field + to avoid an erroneous comparison (when checking for an error). + Fix some indentation errors introduced recently. +2011-06-06 DavidAnderson + * dwarfdump.c: Changed the missing-producer-attribute + default string used in summary/error + outputs to "" + so it is this string clearer. +2011-06-06 DavidAnderson + * print_die.c: Now we strip off quotes dwarfdump + added so -S match=main and the like work. +2011-06-06 DavidAnderson + * common.c: Updated version string. + * dwarfdump.c: Updated version string. + * print_die.c: Corrected handling of DW_AT_data_member_location. + Corrected handling of 'class constant' function + formxdata_print_value() so it does not leak memory. +2011-06-05 DavidAnderson + * dwarfdump.c: Updated version string. + Now -kd forces a summary error report, always. + Even if no errors found or even checked-for. + * common.c: Updated version string. +2011-06-05 DavidAnderson + * dwarfdump.c,print_aranges.c,print_reloc.c: A few indents + did not match the standard multiple-of-4-spaces. Corrected. +2011-06-03 DavidAnderson + * checkutil.c (ProcessBucketGroup): Deleted unused + local variables. + * common.c: Updated version string. + * dwarfdump.1: Made the -k discussion more complete and accurate. + Most option details are in the dwarfdump help/usage message, not + in dwarfdump.1, to keep the man page small. + * dwarfdump.c: Updated version string. Made more variables static + in recognition they are only touched in this file. Added {} on + some if statements to make the body clear. Parenthesized a + complex test with && || to clarify intent. Added sanity testing + of the 'current compiler' count and its use. + * globals.h: Added safe_strcpy() prototype as it is used by multiple + source files so we need a visible prototype. + * print_aranges.c: Add 'arange end' printing (it is a real DWARF + record type, so should be printed). Add a test to avoid duplicated + die printing and error-counting when it is not requested. + * print_die.c: An = in an if corrected to ==. Parenthesized a + complex test with && || to clarify intent. Deleted an unused + local variable. + * print_lines.c: Deleted unused local variables. Added {} for each + struct in an array so the initialization gets done right. + * tag_attr.c: Deleted an unused local variable. + * tag_tree.c: Deleted an unused local variable. +2011-04-23 DavidAnderson + * dwarfdump.c, common.c: Updated DWARF_VERSION string. +2011-01-04 DavidAnderson + * print_frames.h print_static_vars.c Makefile.in + print_static_funcs.c print_sections.c print_strings.c print_locs.c + print_die.c print_reloc.c print_reloc.h print_lines.c print_pubnames.c + dwarfdump.c strstrnocase.c tag_tree.c print_ranges.c print_abbrevs.c + print_macros.c configure.in tag_attr.c dwarfdump.1 naming.c + esb.c checkutil.c makename.c dwconf.c print_types.c checkutil.h + tag_tree.list print_weaknames.c globals.h common.c print_frames.c + print_aranges.c common.h: New correctness tests and new + formatting of various reports. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2012 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2012 new file mode 100644 index 0000000..e0a8789 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2012 @@ -0,0 +1,125 @@ +2012-11-29 David Anderson + * dwarfdump.c, common.c: Update version string. + * dwarfdump.c, print_die.c: Now all follow dicheck + indent rules. +2012-11-29 David Anderson + * dwarfdump.c, common.c: Update version string. +2012-11-27 David Anderson + * dwarfdump.c, common.c: Update version string. +2012-11-20 David Anderson + * dwarfdump.c, common.c: Update version string. + * print_reloc.c: Inserted missing 'const' qualifiers + fixing 3 compiler warnings. +2012-11-17 David Anderson + * configure regenerated with autoconf 2.69 + * dwarfdump.c, common.c: Update version string. +2012-11-17 David Anderson + * addrmap.c,checkutil.c,common.c,dwarfdump.c,dwconf.c, + globals.h,naming.c,print_aranges.c,print_die.c,print_frames.c, + print_locs.c,print_ranges.c,print_reloc.c,print_reloc.h, + print_strings.c,strstrnocase.c,tag_attr.c,tag_common.c, + tag_tree.c,uri.c, + tag_attr_ext.list,tag_attr.list,tag_tree_ext.list, + tag_tree.list : Update copyright year. +2012-11-15 CarlosAlbertoEnciso + * addrmap.c: Consistent layout for if statements. + * checkutil.c: Incorrect string prefix for .text + linkonce section name, + is '.text.' for the applicable linke once sections, not + simply '.text' + Added print of internal (debugging dwarfdump) data not + previously printed. + * common.c: Consistent layout for if statements. + Include "config.h". + Minor layout change for #ifdef _DEBUG. + Add HAVE_STDAFX_H check. + * dwarfdump.1: Changes for new options: -E*, -h, -ls, -kE, plus + some minor typo corrections. + * dwarfdump.c: Consistent layout for if, for statements. + Expand -E option to print the full information for + the ELF header + (32-bit and 64-bit) to include additional fields (e_ehsize, + e_phentsize, e_phnum, e_shentsize, e_shnum, e_shstrndx). Also, + depending on the additional option to -E, the index, address, + size and name for sections is printed. The additional option + follow the convention used for -o option and can include any of + the letters: hliaprfoRstxd. + -Eh print information for the ELF header + -E{liaprfoRs} print information for debug related sections + -Ex print information for .text section + -Ed same as -E{liaprfoRstx}. + -E print the ELF header and the info for all available sections. + New option: -kE, the attribute encodings are checked + to see if they can use fewer bytes when encoded using LEB128. + Expand -l option to print line information with no offsets + values (-ls). Useful for comparisons. + Expand -S option to print number of occurrences for the + searched pattern (-Sv. + Remove support for internally quoted strings. + Remove extra 'break' for case 'o' in 'process_args'. + Include the value zero for -# (internal debug level) + Fix layout for 'qsort_compare_compiler' and use compiler + name in the sort to get a stable sort. + Now that name strings are not qoted internally, + ensure that we do not expect such quotes in checking + compiler names. + * dwconf.c: Consistent layout for if statements. + * globals.h: Add externs and defines for the items + newly needed globally. + * naming.c: Consistent layout for if, for statements. + * print_aranges.c: Consistent layout for if statements. + * print_die.c: Consistent layout for if, for and switch statements. + Remove unused symbols 'seen_PU_base_address', + 'seen_PU_high_address'. Rename 'errno' to + 'dwerrno' to avoid conflict with system symbol. + Missing DWARF_CHECK_COUNT and DWARF_CHECK_ERROR + when testing self references category. + Support for counting number of occurrences of the pattern being + searched (See -S option). + Add support for new option -kE; the atrribute + encodings are checked to see if they can use + fewer bytes when encoded using LEB128. New + functions 'check_attributes_encoding', + 'print_attributes_encoding' + and new data structure 'a_attr_encoding' were created. + Include DW_TAG_template_alias in the function + 'get_attr_value' as it + refers to a type in the case of checks for type offsets. + Remove support for internally quoted strings. + Add space so DW_OP_bregx prints more readably. + * print_frames.c: Consistent layout for if statements. + * print_lines.c: Consistent layout for if statements. + Implement the ability to print line information + with no offset values (useful when comparisons are + required, as the pc values can change + but the basic line information remains the same). + Minor layout changes. + * print_locs.c: Consistent layout for if statements. + * print_ranges.c: Consistent layout for if and for statements. + * print_reloc.c: Consistent layout for if statements. + Move names for relocation types to individual + header files based on architecture (ARM, MIPS, PPC, + PPC64, X86_64). + Fix incorrect layout for 'set_relocation_table_names' function. + Use condition compilation symbols (DWARF_RELOC_MIPS, + DWARF_RELOC_PPC, DWARF_RELOC_PPC64, DWARF_RELOC_ARM, + DWARF_RELOC_X86_64)in the function + 'set_relocation_table_names' to get relocation + table information. + Add support for X86_64 architecture. + * print_reloc.h: Move definitions for relocation types + to individual header files based on architecture + (ARM, MIPS, PPC, PPC64, X86_64). + * print_strings.c: Consistent layout for if statements. + * strstrnocase.c: Consistent layout for if and for statements. + * tag_attr.c: Consistent layout for if and for statements. + * tag_attr.list: Add some missing attributes and + the complete set for DW_TAG_rvalue_reference_type; + remove a duplicated DW_AT_name. + * tag_common.c: Consistent layout for if statements. + * tag_tree.c: Consistent layout for if and for statements. + * tag_tree.list: Missing DW_TAG_union_type to allow + verification of nested unions. + * uri.c: Consistent layout for if and for statements. +2012-04-10 DavidAnderson + * dwarfdump.c, common.c: Updated version string. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2013 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2013 new file mode 100644 index 0000000..e9abad2 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2013 @@ -0,0 +1,88 @@ +2013-10-17 David Anderson + * print_types.c: Remove pointless blank line. +2013-08-15 David Anderson + * dwarfdump.c: Now calls dwarf_register_printf_callback() + so dwarf_print_lines() output is shown (if dwarfdump + wants it shown). Update version string. + * common.c: Update version string. +2013-08-13 David Anderson + * esb.c: Add 1 so the esb_append_printf has room for the NUL + byte. + * print_die.c: Clarified a comment about DW_AT_high_pc + and FORM class constant. Fixed indent error. + * dwarfdump.c: Fixed indent error. +2013-08-08 David Anderson + * print_reloc.c: Removed duplicated call to get_scndata(). +2013-08-07 David Anderson + * dwarfdump.c: Changed non-fatal error messages to write + to stdout instead of stderr. Making it much easier to + have a usable output-with-errors in case of redirection. + Updated version string. + * checkutil.c: If a certain pointer not set, just do nothing, + there is no reason to abort. + Added in a missing [ in a debug printf. + * common.c: Updated version string. +2013-07-30 David Anderson + * common.c,dwarfdump.c: updated version string. +2013-02-05 David Anderson + * dwarfdump.c: Update version string. + get_producer_name() now uses struct esb_s; + * common.c: Update version string. + * print_die.c: Check DW_AT_sibling values for sanity, + and when something quite wrong is found, print an error + and stop. + get_producer_name() now uses struct esb_s; + Added sibling_die_global_offset_ to die_stack_data_s + so we can check sibling attribute values. + get_attr_value() now uses esb_s pointer. + * globals.h: get_producer_name() now uses struct esb_s; + * print_aranges.c, print_pubnames.c:get_producer_name() + now uses struct esb_s; + * dwconf.c: The use of esb_s means we need to consider + an empty config-file-path as no path and look in default + places. We cannot just test for null pointer. +2013-02-04 David Anderson + * dwarfdump/addrmap.c: Forgot to remove the addr_map_destroy() + implementation in #ifndef HAVE_TSEARCH. Now it is removed. +2013-02-03 David Anderson + * dwarfdump/addrmap.c: Implement HAVE_TDESTROY. + tdestroy() is GNU only. Now we allow tsearch without + tdestroy even though that means leaking every tsearch + map we build. dwarfdump2 has no such leak. + * dwarfdump/config.h.in: Add HAVE_TDESTROY. + * dwarfdump/configure: Regenerate. + * dwarfdump/configure.in: Test for tdestroy() function. + * dwarfdump/print_frames.c: Zero out the map pointer. +2013-02-01 David Anderson + * print_die.c: Replaced use of makename (which did malloc) + with use of struct esb_s, avoiding a serious memory leak. + Completely removed static struct variables esb_base and + esb_extra, ensuring die string print-data is not + corrupted by recursive calls. + * dwarfdump.c, common.c: Update version string. +2013-01-26 David Anderson + * dwarfdump.c, common.c: Update version string. + * print_die.c: Print DW_OP_GNU_const_type properly using + the binary-compatibility version of Dwarf_Loc. +2013-01-25 David Anderson + * dwarfdump.c, common.c: Update version string. + * print_die.c: Print DW_OP_GNU_const_type properly. +2013-01-16 David Anderson + * dwconf.c: Changed table size to unsigned to eliminate + signed/unsigned comparison warnings. + * dwconf.h: Changed struct fields to unsigned to eliminate + signed/unsigned comparison warnings. + * esb.c: Checked for negative vfprintf return to avoid + (hopefully impossible) error from crashing the program, + and fix comparison warnings. + * print_die.c: Changed counts to unsigned to fix + signed/unsigned comparison warnings. + * print_frames.c: Changed counts to unsigned to fix + signed/unsigned comparison warnings. + * print_reloc.c: Changed table sizes to unsigned to fix + signed/unsigned comparison warnings. + * tag_tree.c, tag_attr.c: Changed table sizes to unsigned to fix + signed/unsigned comparison warnings. +2013-01-16 David Anderson + * dwarfdump.c, common.c: Update version string. + diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2014 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2014 new file mode 100644 index 0000000..2ac5560 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2014 @@ -0,0 +1,165 @@ +2014-12-31 David Anderson + * dwarfdump.c, common.c: Updated version string. +2014-12-28 David Anderson + * dwarfdump.c, common.c: Updated version string. +2014-08-15 David Anderson + * print_die.c(print_one_die_section): A c99-ism of declarations + mixed with statements was present. Moved declaration of 'res' + up a few lines. +2014-08-05 David Anderson + * print_gdbindex.c: A couple places: Fixed indents + on a comment. +2014-08-05 David Anderson + * dwarfdump.c, common.c: Updated version string. +2014-08-04 David Anderson + * dwarfdump.1: Mention -I option. + * dwarfdump.c: Add -I to help output. + * print_gdbindex.c: Add cu_list_len argument to + print_culist_array so it can pass back the culist length + for use by symboltable code. So symboltable code can + know what indexes are type units and which compilation + units. +2014-08-03 David Anderson + * dwarfdump.c: Corrected typo in comment. + * print_debugfission.c: Removed trailing whitespace. + Fixed some small mistakes in the output. + * print_die.c: Removed trailing whitespace. + Fixed the section name. It was showing .debug_types + when not wanted. +2014-08-02 David Anderson + * print_debugfission.c, print_gdbindex.c: Use the section name + strings returned by section-open + for object files that have them (like Elf). +2014-07-12 David Anderson + * print_die.c: Using a new interface to print the + actual section name, not just .debug_info or .debug_types. + dwarf_get_die_section_name(); + * dwarfdump.c: Corrected a comment relating to + .gdb_index and .debug_[ct]u_index sections + * debugfission.c: Fix indentation mistakes. +2014-07-11 David Anderson + * print_debugfission.c: Prints the offset and size tables. +2014-07-10 David Anderson + * print_debugfission.c: Prints the hash table values of + the .debug_tu_index and .debug_cu_index sections. +2014-07-09 David Anderson + * print_debugfission.c: Removed trailing whitespace + characters. +2014-07-09 David Anderson + * Makefile.n: Add print_debugfission.o to the list. + * globals.h: Add print_debugfission_index() interface. + * print_debugfission.c: New file beginning to + support print of .debug_tu_index and + .debug_cu_index sections (DWARF5). +2014-07-02 David Anderson + * dwarfdump.c: A missing comma after DW_SECTNAME_GDB_INDEX + lead to a core dump. + * print_die.c: The printf format for a warning message was + messed up. Fixed. +2014-07-01 David Anderson + * dwarfdump.c, print_gdbindex.c: Fixed indentation and trailing whitespaces. +2014-07-01 David Anderson + * print_gdbindex.c: Now prints gdb_index symboltable. +2014-06-30 David Anderson + * print_gdbindex.c: Add types printing. + Add addressarea printing. +2014-06-29 David Anderson + * print_gdbindex.c: Call latest libdwarf interfaces. + Fix the formatting a bit. +2014-06-28 David Anderson + * Makefile.in: Add print_dgbindex.o to objects list. + * dwarfdump.1: Add -I to options list (for gdb_index section). + * dwarfdump.c: Add gdbindex_flag and a call to print_gdb_index(). + * globals.h: Add DW_HDR_GDB_INDEX to flags. + * print_gdbindex.c: New file, prints .gdb_index section + if the section is present in an object. +2014-05-20 David Anderson + * dwarfdump.c, common.c: Updated version string. + * print_die.c: now the dwo_id value prints as hex. +2014-05-19 David Anderson + * dwarfdump.cc, common.cc: Updated version string. +2014-05-19 David Anderson + * print_die.c: Removed two unused local variables. +2014-05-18 David Anderson + * dwarfdump.c,print_die.c: Fixed indent errors and + removed trailing whitespace. +2014-05-14 David Anderson + * print_die.c: Complete printing of DW_FORM_GNU_str_index, + DW_FORM_GNU_addr_index, + DW_FORM_addrx, DW_FORM_constx. + * print_frames.c: Now supports DW_FORM_GNU_addr_index, + DW_FORM_addrx, DW_FORM_constx. + * dwarfdump.c: Update version string. + Trivial text realignment of argument strings + in print_error() and print_error_and_continue(). + * common.c: Update version string. +2014-05-11 David Anderson + * print_die.c: Add printing of DW_FORM_GNU_str_index, partial + of DW_FORM_GNU_addr_index. + Support for DW_OP_GNU_const_index too. + * dwarfdump.c: Trivial change to error strings so each is unique. + Update version string. + * common.c: Update version string. +2014-04-15 David Anderson + * uri.c(hexdig): was testing 0, fixed to be '0'. +2014-04-14 David Anderson + * dwarfdump.c,common.c: Update version string. +2014-04-12 David Anderson + * dwarfdump.c,common.c: Update version string. +2014-02-13 David Anderson + * dwarfdump.cc: Minor changes in the commentary relating + to the search paths for dwarfdump.conf. No code changed. +2014-02-08 David Anderson + * dwarfdump.c,common.c: Update version string. +2014-02-08 David Anderson + * Makefile.in: Having a single rule build two independent things + interacted badly with make -j 2 , so now each rule just builds + a single target (see tag*.list builds). +2014-02-02 David Anderson + * tag_attr.list,tag_attr_ext.list,tag_tree.list,tag_tree_ext.list: + Removed trailing whitespace. +2014-01-31 David Anderson + * addrmap.c: Forgot to add include of dwarf_tsearch.h here. Added. + * dwarfdump.c, common.c: Updated version string. +2014-01-30 David Anderson + * print_die.c: Add limited support for DW_FORM_GNU_ref_alt + and DW_FORM_GNU_strp_alt. +2014-01-29 David Anderson + * addrmap.c addrmap.h checkutil.c,checkutil.h, + common.c common.h,dwarf_tsearch.h,dwarfdump.c,dwconf.c, + dwconf.h,esb.c,esb.h,globals.h,makename.h,naming.c,naming.h: + Remove trailing whitespace. + * print_abbrevs.c,print_aranges.c,print_die.c,print_frames.c, + print_frames.h, + print_lines.c,print_locs.c,print_macros.c,print_pubnames.c, + print_ranges.c, + print_reloc.c,print_reloc.h,print_sections.c,print_sections.h, + print_static_funcs.c, + print_static_vars.c,print_strings.c,print_types.c, + print_weaknames.c,strstrnocase.c, + tag_attr.c,tag_common.c,tag_common.h,tag_tree.c, + testesb.c,uri.c,uri.h,uritablebuild.c: + Remove trailing whitespace. +2014-01-29 David Anderson + * dwarf_tsearchbal.c,dwarf_tsearch.h: New source files. + * print_frames.c: dwarf_tsearch now built in, we are + no longer using libc tsearch. + * addrmap.c: Now uses dwarf_tsearch. + * configure.in, config.h.in: No longer need HAVE_TSEARCH or + HAVE_TDESTROY + * configure: regenerated +2014-01-10 David Anderson + * dwarfdump.c: Change // comments to /* */ comments. + * makename.c: Delete blank line and trailing space. Add cast + so gcc -ansi compiles without complaint. + * print_die.c, uri.c: Change // comments to /* */ comments. + * tag_attr.c: Add getopt.h include so gcc -ansi compiles + without complaint. + * tag_tree.c: Add getopt.h and string.h include so gcc -ansi compiles + without complaint. Add cast so strdup call to avoid warning. + * addr_map.c: Add cast so strdup call does not cause warning gcc -ansi. +2014-01-04 David Anderson + * dwarfdump.c: Initialize a local variable to zero and + move a declaration (avoiding a c99-ism, the code + is not supposed to be using c99 features). + diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2015 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2015 new file mode 100644 index 0000000..f9b84f0 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2015 @@ -0,0 +1,434 @@ +2015-12-31 David Anderson + * configure.in: Now allows --enable-shared and --disable-nonshared + * configure: regenerated. +2015-12-19 David Anderson + * dwarfdump.c: Now we print macros alone by CU with -m + (at least for DWARF5 macro format) + * print_lines.c(print_source_intro): Minor local + variable ordering change. + * print_macro.c(print_source_intro): Minor local + variable ordering change. +2015-12-19 David Anderson + * print_macro.c: Print the actual macro offset size we will use. +2015-12-18 David Anderson + * dwarfdump.c,globals.h print_die.c,print_lines.c, + print_macro.c,print_pubnames.c,print_ranges.c: + Removed globals elf_max_address and elf_address_size + in favor of local variables and new + global function get_address_size_and_max(). +2015-12-16 David Anderson + * print_aranges.c, print_die.c: Ensure the four + error-reporting globals DIE_[CU_][global_]_offset are + set properly. +2015-12-16 David Anderson + * common.c: Update version string. + * dwarfdump.c: Update version string. Fix PRINT_CU_INFO() + to do what was intended (and not have a side effect). + * print_aranges.c: Folded a too-long line. + * print_die.c: Folded a line so both offsets listed on same line. + * print_macro.c: moved macro_context call above the print of + ".debug_macro" so if the section does not exist we print nothing. +2015-12-15 David Anderson + * print_macro.c: Much of printing DWARF5 macros now works. +2015-12-13 David Anderson + * print_macro.c: Call new function dwarf_get_macro_ops_count() and + print returned values. +2015-12-12 David Anderson + * print_macro.c: Now does -vv intro with cu_die print too. + * print_macros.c: Only print .debug_macro name if there are some. +2015-12-11 David Anderson + * naming.h,naming.c: Added get_MACRO_name(). + * print_macro.c: Now reads and prints macro5 header. +2015-12-11 David Anderson + * esb.c: esb_append now checks for NULL string pointer. + Added comment esb functions do NOT check for NULL pointers + generally. +2015-12-10 David Anderson + * esb.c: esb_get_copy() failed to account for the trailing NUL. + esb_get_copy was not being tested by SELFTEST. Fixed both issues. +2015-12-08 David Anderson + * common.c,dwarfdump.c: Update version string. + * print_frames.c: Fix trailing whitespace. + Implement an attempt at DW_CFA_METAWARE_info. +2015-12-08 David Anderson + * print_frames.c: Fix indents and remove trailing whitespace. + Add comments: Errors in DIE info just result in omitting + procedure names, no warning/errors. + * dwarfdump.c: Deleted Elf64_Ehdr *eh64 declaration + that can never be used. +2015-11-30 David Anderson + * print_frames.c: Remove trailing whitespace. +2015-11-30 David Anderson + * Makefile.in: Add print_macro.o to build list. + * dwarfdump.c: Add macro_flag flag to signal print + of DWARF5 debug_macro data. + * globals.h: Export new macro print function. + * print_die.c: Call new macro print function, skip that attr + in checking-only run.. +2015-11-28 David Anderson + * globals.h: Added DEBUG_FRAME_EH_GNU define for consistency.. + * print_frames.c: use the new dwarf_get_frame_section_name() + and dwarf_get_frame_section_name_eh_gnu() functions for + section names. + * print_lines.c: Use the new dwarf_get_line_section_name_from_die() + function for the section name. + * print_locs.c,print_macros.c,print_pubnames.c,print_static_funcs.c, + print_types.c,print_weaknames.c: Added comments. These are + places where the section is either obsolete or the section + name is rarely of any use. +2015-11-27 David Anderson + * dwarfdump.1: Mentions that with zdebug sections offsets + refer to expanded object section, not compressed section. + * print_aranges.c,print_die.c,print_lines.c,print_ranges.c, + print_strings.c: Get the real section name from libdwarf. +2015-11-26 David Anderson + * common.c,dwarfdump.c: Updated version string. + * config.h.in, configure.in, Makefile.in: Deals with + zlib when present. +2015-11-15 David Anderson + * Makefile.in: Now supports building in a clean separate directory. +2015-11-11 David Anderson + * print_abbrevs.c(dwarf_get_array_info): Initialize local variable. + * print_die.c(get_location_list): Initialize local variable.: + * dwarf_loc.h: Add declaration of _dwarf_loc_block_sanity_check(). + * dwarf_loc.c: Call new function _dwarf_loc_block_sanity_check + * dwarf_loc2.c: Implement and call new function + _dwarf_loc_block_sanity_check to avoid duplicating code. +2015-11-07 David Anderson + * dwarfdump.1: Documented -x line5=. + * dwarfdump.c: Revised -g so it no longer turns on -i. + Revised the meaning of -g to mean use old loclist interfaces + (for testing the older interfaces with dwarfdump). + * print_die.c(get_small_encoding_integer_and_name): a dwarf_dealloc + referenced err whereas *err was correct. + Revised loclist output making it look a bit like DWARF5 + even for DWARF2,3,4 output. Reads better, I think. + * print_locs.c: -l gets a 'no longer supported' message + as it was never safe to do anyway. +2015-11-01 David Anderson + * configure.in: Add -O0 to --enable-wall. + So if a coredump during debugging gdb will work really well. + * configure: Regenerated. + * print_frames.c: Ommitted a 'return' statement so + some output duplicated. Added in the missing return. +2015-11-01 David Anderson + * Makefile.in, configure.in: Implement --enable-wall for compile-time + checking. + * configure: Regenerate. + * print_die.c: Add DWARF5 DW_OPs and .debug_loc.dwo loclists are + handled. + Now uses either latest (DWARF5) + interfaces or earlier, repurposing the old -g option to select. + * print_frames.c,print_frames.h: Printing expressions + (in .debug_frame, .eh_frame) + now honors -g so DWARF5 expressions handled. + * print_lines.c: Fixed some formatting. + * print_locs.c: Changes reflecting code calling into print_frames.c +2015-10-26 David Anderson + * print_die.c: Removed debug printf.Corrected DW_OP_GNU_const_type + handling (cannot be fully reported + for certain new location operators). +2015-10-15 David Anderson + * print_die.c: Added DW_FORM_strp_sup, + same idea as DW_FORM_GNU_strp_alt. +2015-10-15 David Anderson + * dwarfdump.c: Add enum line_flag_type_e so we can test + all the srclines interfaces (4 of them). Expand -x + for that too. + * print_die.c: Support DW_FORM_GNU_strp_alt. + * print_lines.c: Update for old and new srclines + interfaces. + * globals.h: Added the enum line_flag_e variable for + recording -x line5= value. +2015-10-06 David Anderson + * dwarfdump.c: Now allow selecting alternate line table + reading code so line table routines can be tested thoroughly. + * print_lines.c: Uses one of the selected line table routine + sets. Adds new line access routine calls to test those too. + * globals.h: Declares new flag line_skeleton_flag; + * print_die.c: Moved a local declaration to where it is used. + Added a missing DW_DLV_ERROR check so in case of error + we do not leak memory. +2015-09-26 David Anderson + * dwarfdump.c, common.c: Update version string. + * print_lines.c: Added local variables for clarity + in a call, changed the dwarf_srclines_dealloc() location + to fully clean up after a two-level line table srcfiles call. +2015-09-26 David Anderson + * dwarfdump.c, common.c: Update version string. +2015-09-24 David Anderson + * dwarfdump.c, common.c: Update version string. + * print_lines.c: IA in line header hint is + really spelled IS. Fixed now. + * dwarf_elf_access.c: Added R_IA64* and R_390 relocation ifdefs + for cases where they are not in a test machines elf.h or the like. +2015-09-23 David Anderson + * print_lines.c: Removed accidental newline from output. +2015-09-22 David Anderson + * print_die.c: Removed trailing whitespace and fixed indentation mistake. + * print_lines.c: Fixed indentation and inconsistencies + in spelling line table field hints. + Leaving IA as has been for a long time + though it should be spelled IS. +2015-09-19 David Anderson + * print_lines.c: Tweaking two-level line table code, mostly + comments.. +2015-09-17 David Anderson + * print_lines.c: Adding handling of experimental two-level + line table. +2015-09-15 Carlos Alberto Enciso + * common.c: For Windows version, add a symbol with the + release date (taken from the distributed compressed archive), + to be used by print_version_details() for better + tracking of versions. + * print_die.c: The text search (-S), now follows + the DW_AT_specification + and the DW_AT_abstract_origin attributes, + to get the associated name; + this finds the declaration and definitions + DIEs for a member functions + or the abstract and concrete instance DIEs for inlined functions. + Fix some C99 issues with local variable declarations in + get_attr_value(). + * print_aranges.c: Add an extra newline in print_aranges(). +2015-09-15 David Anderson + * print_die.c: for case DW_AT_dwo_id a c99-ism has been + changed to be like C89. +2015-09-14 David Anderson + * dwarfdump.c: Remove trailing space. + * print_frames.c, globals.h: print_frame_inst_bytes() defined and used + in one file, so made a static function, removed from globals.h +2015-09-13 David Anderson + * dwarfdump.c, common.c: Update version string. +2015-09-11 David Anderson + * dwarfdump.c: Update usage message to mention + -x tied= and update version strings. + * common.c: Update version string. +2015-09-11 David Anderson + * dwarfdump.c: Fixed copy/paste errors so DebugFission + code works (see tieddbg in the source). +2015-09-11 David Anderson + * dwarfdump.c, dwarfdump.1: Added -x tied= + option so one can get .debug_addr data when referencing + a .dwp or .dwo. Tieing these together. + * print_die.c: Fixed indent errors. +2015-09-05 David Anderson + * tag_attr.list,tag_attr_ext.list,tag_tree.list: removed + trailing whitespace. +2015-07-12 David Anderson + * dwarfdump.c: Use dwoptind dwoptarg, not optind, optarg + * dwgetopt.c,dwgetopt.h,dwgetopttest.c,tag_attr.c, + tag_tree.c: Use dwoptind dwoptarg etc, + not optind, optarg, optopt op6error etc. + * print_die.c: updated commentary. +2015-05-07 David Anderson + * common.c, dwarfdump.c: Update version string. + * print_die.c: Print DW_AT_dwo_id properly as a Dwarf_Sig8 value. +2015-05-03 David Anderson + * print_die.c: Print the fission data from the + index section when we print cu header, not when printing cu DIE. + Moved cu header/cu die print code to functions, simplifying + calling code. +2015-05-01 David Anderson + * tag_attr.list: Added a DW_AT_signature and + moved a couple attributes to match the standard-document + order of attributes. +2015-03-10 David Anderson + * dwarfdump.c: Update version string. + * common.c: Update version string. + * dwgetopt.c: Was mishandling options + missing their required argument and + coredumping dwarfdump. + * getopttest.c: Added new tests to ensure + we have the dwgetopt() fixes working properly. + * Makefile.in: Added new test runs to 'make test'. + * print_die.c, print_lines.c: Removed instances + of trailing whitespace. +2015-03-09 David Anderson + * Makefile.in: added new tests of dwgetopt. + Runs not only dwgetopt but system getopt. + * dwarfdump.c: New function set_checks_off() + so if printing we don't do checks (intended + to be this way for a long time now). + Updated version string. + * common.c: Updated version string. + * print_die.c: Was not always recognizing unit DIES + DW_TAG_partial_unit or DW_TAG_type_unit where it saw + DW_TAG_compile_unit. Now does so. + * dwgetopt.c: Errors could lead to dwarfdump coredump. Fixed. + * getopttest.c: Added several new tests. Now one + can run single tests and run against either getopt or dwgetopt + (set at compile time of getopttest.c). +2015-03-03 David Anderson + * tag_attr.list: Removed DW_AT_sibling from DW_TAG_partial_unit. + DW_TAG_compile_unit. Removed DW_AT_containing_type from + DW_TAG_subprogram, DW_TAG_structure_type. + * dwarfdump.c,common.c: Update version strings. + * print_die.c: Fix indent mistakes. Add comment + in _dwarf_print_one_expr_op() that one error is + not presently realizable (FreeBSD compiler + noticed the situation). + * print_ranges.c: Fix indent mistakes. + * tag_attr.c: Remove trailing whitespace from a #include line. +2015-03-03 Carlos Alberto Enciso + * dwarfdump.c: Add allocate_range_array_info(), + release_range_array_info() calls to help fix range checking. + * globals.h: Add declarations of range checking functions. + * print_die.c: Add check_range_array_info() call. + Add record_range_array_info_entry() call. + Move all the range check code out of print_die.c. + Add handling of high_pc as an offset, not just as a value. + * print_ranges.c: Delete unneeded includes. + Add check_ranges_list() implementation moved from + print_die.c. Add new ranges check functions. + Range check error messages now appear later in the output, + though the content is identical. + * tag_attr_ext.list: Add DW_TAG_GNU_call_site and + DW_TAG_GNU_call_site_parameter tag attr combinations. + * tag_tree_ext.list: Add DW_TAG_GNU_call_site DW_TAG_call_site_parameter +2015-02-22 David Anderson + * configure.in: removed getopt.h from tests, we use + local dwgetopt now. + * dwgetopt.h: Function name is dwgetopt. Prototype named right now. + Copied from libdwarf dwgetopt.h + * configure: regenerated + * Makefile.in: build dwgetopt.o + * dwgetopt.c: Copied from libdwarf source. + * tag_attr.c,tag_tree.c: Now call dwgetopt() instead of getopt(). + +2015-02-04 David Anderson + * common.c,dwarfdump.c:Updated version string. + * print_debugfission.c: Now we are using a Dwarf_Sig8 + for fission hash so we introduce an esb_s to do + the formatting. + * tag_attr.c: Now we format a more detailed message when + we detect an insufficient static tag_attr or tag_tree + array instance. It's code only used at build time so + just giving up is fine: someone changed dwarf.h. + * tag_attr.list: Adding new TAGs and new Attrs + from DWARF5. Since the DWARF5 standard not yet final + these could change! + * tag_attr_ext.list: Added new GNU attributes. + * tag_common.h: updated DW_TAG_last and DW_AT_last + STD_TAG_TABLE_ROWS STD_ATTR_TABLE_COLUMNS values + due to dwarf.h updates. + * tag_tree.list: New entries from DWARF5. +2015-01-31 David Anderson + * DWARFDUMPCOPYRIGHT: updated to + reflect changes today. Old versions + of the copyright notices still shown here. + * common.c,dwarfdump.c,dwconf.c,esb.c,makename.c,naming.c, + print_abbrevs.c,print_aranges.c,print_die.c,print_frames.c, + print_lines.c,print_locs.c,print_macros.c,print_pubnames.c, + print_ranges.c,print_reloc.c,print_sections.c,print_static_funcs.c, + print_static_vars.c,print_strings.c,print_types.c,print_weaknames.c, + strstrnocase.c,tag_attr.c,tag_attr.list,tag_attr_ext.list, + tag_common.c,tag_tree.c,tag_tree.list,tag_tree_ext.list, + uri.c,uritablebuild.c: Removed obsolete SGI postal + address and web references. +2015-01-31 David Anderson + * common.h,dwconf.h,esb.h,globals.h,makename.h,naming.h, + print_frames.h,print_reloc.h,print_sections.h,tag_common.h,uri.h: + The address and URI for SGI is obsolete and there is no + replacement so deleted some lines from the copyright + statements. +2015-01-30 David Anderson + * common.c,dwarfdump.c: Update version string. + * globals.h: Added format_sig8_string() to global functions. + * print_debug_fission.c: Updated .debug_cu/tu_index hash signature + code to match libdwarf (Dwarf_Sig8, not Dwarf_Unsigned). + Allow for missing hash (?). + * print_die.c: Use format_sig8_string(). +2015-01-29 David Anderson + * print_die.c: Two places used C99-only variable + declaration. Moved declarations up to conform to C90. +2015-01-24 David Anderson + * dwgetopt.c,dwgetopt.h: Using NetBSD getopt source with + modifications to support :: for uniform behavior + for all users. Not all getopt are the same. Named dwgetopt(). + * dwgetopttest.c: Does tests of dwgetopt() for conformance + with dwarfdump requirements. See 'make selftest'. + * Makefile.in: Now has selftest for dwgetopt and + links dwgetopt.o into dwarfdump. + * esb.c: Now prints PASS on success and counts errors. + * dwarfdump.c: Now calls dwgetopt and includes dwgetopt.h + Added a new global so we recognize where needed + not to do some checks when checking ( + for debugfission some things not sensible). + * globals.h: Removed cu_offset (not needed) and added + suppress_checking_on_dwp flags. + * print_die.c:renamed cu_offset to be a static: dieprint_cu_offset + Reset it when finished with a CU. (-k checks got into trouble + when both .debug_info and .debug_types present). +2015-01-21 David Anderson + * common.c, dwarfdump.c: Update version string. + * print_die.c: For a DW_FORM_ref_sig8 type signature + value, if not printing the actual FORM print + so the hex value makes sense. + It is obviously not a .debug_info global offset. + Now prints debug fission (dwp) information for + each CU with such. +2015-01-18 David Anderson + * common.c, dwarfdump.c: Update version string. +2015-01-15 David Anderson + * dwarfdump.c: dump_unique_errors_table() ifdef out + of normal compiles, it is unused. Unused local variables + removed. + Update version string. + * esb.c: Moved stdarg.h include just after stdio.h include + for positioning consistency. + * globals.h: Added stdarg.h include just after stdio.h + include as we use va_list a lot and so stdarg.h + is required. + * print_debugfission.c: Remove two unused local variables. + * print_frames.c: Remove trailing whitespace. + * tag_attr.c: #include stdarg.h. Add {} to array initializers + output to avoid compiler warning. + * tag_common.c: Move stdarg.h include to just after + stdio.h for positioning consistency. + Update version string. + * tag_tree.c: Revised include order to start with + globals.h and to not duplicate includes of stdio.h etc. + Add {} to array initializers + output to avoid compiler warning. + * testesb.c: Add include of stdarg.h. +2015-01-12 David Anderson + * tag_common.c: Add comments about va_start, va_end. + * esb.c: Add comments about va_start, va_end. + Add va_end in the selftest code. + * common.c: Update version string. + * dwarfdump.c: Update version string. Add va_end() + and comments about va_end. +2015-01-08 David Anderson and Carlos Alberto Enciso + * Makefile.in: add selftest: rule, which tests esb.c + * dwarfdump.c: Add new options -O file=path, -kD -kG -ku kuf. + New checking and reporting features intended to give a + report on attribute and tag usage. + Update version string. + * common.c: Update version string. + * esb.c, esb.h: Added new interface using stdarg. + Added self-test feature. + * dwarf_makename.c: new #pragma (not Linux/Unix related). + * print_die.c: Implements collecting the new statistics + dwarfdump reports. + * print_lines.c: New statistics collected. + * tag_attr.c: New checks for the tag/attr table correctness. + * tag_attr.list: Fixes duplicated entries. + * tag_attr.list_ext: Adds APPLE attribute DW_AT_APPLE_optimized + that llvm emits. + * tag_common.c: bad_line_input() now allows stdarg calls so + its easier to emit good error messages. + * tag_common.h: bad_line_input() arg list changed a little. Stdarg now. + * tag_tree.c: New tag tree checking done. New statistics + available. + * tag_tree.list: Adds DW_TAG_unspecified_type, + DW_TAG_rvalue_reference_type, + DW_TAG_restrict_type. + * tag_tree_ext.list: Adds DW_TAG_GNU_template_template_parameter. + Fixes duplication of entries. +2015-01-05 David Anderson + * dwarfdump.c: Don't call dwarf_finish() if + the dwarf-init call failed. + * common.c,dwarfdump.c: Updated version string. +2015-01-01 David Anderson + * A new year begins. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2016 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2016 new file mode 100644 index 0000000..a7bc83b --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/ChangeLog2016 @@ -0,0 +1,508 @@ +2016-11-24 David Anderson + * common.c,dwarfdump.c,tag_attr.c,tag_tree.c: + Update version strings. +2016-11-24 David Anderson + * Makefile.in: Clean *~ +2016-11-22 David Anderson + * print_abbrevs.c: Some -k abbrev warnings did not make it clear that + they were checking against a heuristic sanity-check value + for the maximum number of attributes, not a genuine + maximum. +2016-11-22 David Anderson + * tag_attr.c: Remove bogus blank line with trailing spaces. +2016-11-11 David Anderson + * print_frames.c: Apply fix to local_dwarf_decode_s_leb128_chk so + it matches libdwarf dwarf_leb.c. A fix for certain bit + pattern provoking undefined behavior in C.. +2016-11-01 David Anderson + * tag_attr.c,tag_common.h,tag_attr_ext.list: Adding + Ada GNAT gcc attributes DW_AT_GNU_numerator, + DW_AT_GNU_denominator, DW_AT_GNU_bias in the extended + table for checking. +2016-10-21 David Anderson + * common.c,dwarfdump.c,tag_attr.c,tag_tree.c: Update + version strings. +2016-09-30 David Anderson + * configure.in: Add additional -fsanitize tests to + --enable-sanitize option. + * configure: Regenerated. + * print_die.c: Ensure << applied to unsigned + to avoid undefined operation. We were getting + officially undefined behavior. + * tag_attr_ext.list: Removed trailing whitespace from + two lines. +2016-09-30 David Anderson + * makename.c: The unused static function value_hashfunc() + has been removed. + * tag_attr.c, tag_tree.c: Changed (1<form with + in an error message. + * print_frames.c: Now checks for bogus expression block + lengths and bogus LEB values. LEB reading functions + now here and static functions. + * print_sections.c: Moved leb reading functions to print_frames.c +2016-05-07 David Anderson + * dwarfdump.c, common.c: Update version string. + * print_frames.c: For local variable added + initialization-at-definition. +2016-05-06 David Anderson + * sanitized.c: Fixed trailing whitespace and + added 'static' to local function definition. +2016-05-05 David Anderson + * Makefile.in: Added sanitized.o to objects to build. + * dwarfdump.1: Document '-x nosanitizestrings'. + * dwarfdump.c: Set internal flag based on '-x nosanitizestrings'. + * globals.h: add extern for the flag no_sanitize_string_garbage + and the sanitized() interface. + * print_die.c,print_frames.c,print_lines.c, + print_macro.c, print_macros.c : Call sanitized() on some strings. + * sanitized.c: Changes control characters int output to %xx + uri-style (by default). See '-x nosanitizestrings'. +2016-05-03 David Anderson + * dwarfdump.c: revise print_error_maybe_continue() to + print additional useful data. + * print_die.c: If dwarf_srcfiles() gets DW_DLV_NO_ENTRY + do not print a warning. Normal to have no DW_AT_stmt_list. + * print_lines.c: Fix column header 'row' changed to 'lno'. + Refine a CHECK message to say a DW_LNE_end_sequence + does not exactly match function high address. It is not + an error, just something about how the code was emitted. +2016-04-30 David Anderson + * dwarfdump.c, common.c: Update version string. +2016-04-27 David Anderson + * dwarfdump.c, common.c: Update version string. +2016-04-27 David Anderson + * dwarfdump.c: Update version string. + Remove a field from printf on error as that duplicates + the error number in the error string. +2016-04-25 David Anderson + * esb.c, dwarfdump.c: Fix a couple indent mistakes. +2016-04-25 David Anderson + * esb.h, esb.c: The typedef for 'string' is now gone, it + was never helpful.. + * dwarfdump.c: Remove 'string' use. + * dwgetopt.c: Moved test-only function to getopttest.c. + Added (void) argument to a the functions with no arguments. + * getopttest.c: Repaired failures to to renaming + to dwoptind etc and added the test-only + function from dwgetopt.c + * globals.h: Removed 'string' typedef. + * print_die.c,print_frames.c, print_lines.c, print_strings.c, + tag_attr.c, tag_tree.c: Removed use of 'string' type, use + plain old char*. +2016-04-21 Carlos Alberto Enciso + Printing using the 'esb' module was broken. It seems to work + because the default internal buffer size (240), was big enough + to receive the resulting output. + + * esb.c, esb.h: Missing prefix 'esb' for 'allocate_more'. + Initial buffer size reduced to 16. + New function 'esb_open_null_device': open 'null' device. + New function 'esb_close_null_device': close 'null' device. + New function 'esb_allocate_more_if_needed': allocate more + space if required, leaving the contents unchanged, so the + caller, does not need to worry about it. + There are 2 cases: + Windows: use the 'null' device to get the required space + UNIX: use a big buffer (512). But if the result is bigger, + the original problem will be shown. + The function 'esb_append_printf_ap', now takes care of + increasing the buffer if needed. + + * dwarfdump.c: In the case of windows, open and close the 'null' + device, in order to setup the esb module. +2016-04-21 Carlos Alberto Enciso + * globals.h: Do not define 'string' for a C++ build; it clashes with + the 'std::string'. + * print_die.c: Minor typo error. +2016-04-21 Carlos Alberto Enciso + * For a WINDOWS version, display the 32/64 bits configuration. +2016-04-21 Carlos Alberto Enciso + * Use the _WIN32 macro to identify a WINDOWS specific code. +2016-03-17 David Anderson + * print_die.c(print_one_die_section): One dieprint_cu_goffset + Dwarf_Unsigned->Dwarf_Off. +2016-03-12 David Anderson + * print_abbrevs.c(print_abbrevs): Printed output of an abbrev with code + and tag but no attributes was simply wrong. Now fixed. + Now avoids printing children flag on a null abbrev (a NUL byte + meaning no abbrev is there at all, ending a list of abbrevs). + * print_die.c: it was difficult, even with -G -v, to identify + the actual offset (in .debug_abbrev) of the abbreviations. + Now -i -G -v gives a bit more data on abbreviations. +2016-03-09 David Anderson + * dwarfdump.c,globals.h,print_aranges.c,print_die.c,print_frames.c, + print_lines.c,print_macro.c,print_pubnames.c: + Remove the global dieprint_cu_offset, use local vars and pass around instead. + Ensure the traverse() logic when checking type references do not evaluate + references to other sections. Many argument lists got an additional argument or two. +2016-03-07 David Anderson + * dwarfdump.c: Update version string. Added CU_low_address so + CU_base_address is properly used only for the DWARF + CU 'base address' notion. Print CU_low_address in PRINT_CU_INFO(). + * common.c: Update version string + * globals.h: New macro DROP_ERROR_INSTANCE(d,r,e) improves consistency + where we need to drop a Dwarf_Error instance. + * print_die.c: Support for CU_low_address. Use DROP_ERROR_INSTANCE + where appropriate. + * print_frames.c: Use DROP_ERROR_INSTANCE + where appropriate. +2016-03-03 Carlos Alberto-Enciso + * dwarfdump.c: Missing '_' just for consistency. + Print any harmless errors only the required in command line + * globals.h: Unused declaration. + * print_die.c: When displaying a DW_AT_type offset error, uses the standard + 0xdddddddd format. Wrap to 80 columns, a long line. +2016-02-17 Carlos Alberto-Enciso + * dwarfdump/tag_attr_ext.list,dwarfdump/tag_common.h, + dwarfdump/tag_tree_ext.list: Tighten up the list limits + and add commentary about the list limits. +2016-02-14 DavidAnderson + * dwarfdump.c,common.c: Updated version strings. + * print_die.c,print_strings.c: fixed indent errors. +2016-02-14 Carlos Alberto-Enciso + * tag_attr_ext.list, tag_tree_ext.list: Adding + DW_TAG_GNU_template_parameter_pack,DW_TAG_GNU_formal_parameter_pack. + * tag_tree.c: Printed wrong name from tag-tree table in + a comment. + * tag_common.h: Ext tag table rows count was higher than needed. + Ext attr table rows increased to 11. +2016-02-13 David Anderson + * dwarfdump.c,globals.h,print_aranges.c,print_die.c, + print_frames.c,print_lines.c,print_locs.c,print_macro.c, + print_pubnames.c,print_reloc.ckprint_static_funcs.c, + print_static_vars.c,print_strings.c,print_types.c, + print_weaknames.c: Removed global Dwarf_Error err + and provided local Dwarf_Error as needed. +2016-02-13 David Anderson + * configure.in: Add -Wshadow to --enable-shared. Add else and + cross-compile [] to the AC_TRY_RUN + * configure: Regenerate. + * dwarf_tsearchbal.c: Delete shadowed variable p, we use + the original instead. + * dwarfdump.c: Rename variables to avoid confusing + duplicated names (found by -Wshadow). #if 0 the + unused function old_get_cu_name(), which should get deleted. + * globals.h: Fixed prototypes, #if 0 prototype of + the unused function old_get_cu_name(). + * print_abbrevs.c, print_aranges.c,print_debugfission.c, + print_die.c,print_frames.c, print_gdbindex.c, print_lines.c, + print_pubnames.c, print_ranges.c, print_sections.c, + tag_attr.c, tag_tree.c: Add local Dwarf_Error and + rename variables to avoid shadowing confusion. +2016-02-10 David Anderson + * globals.h: Change enum val from std to singledw5. + Some compilation environments reserve 'std'. + * dwarfdump.c,print_lines.c: Use the new spelling. +2016-02-10 David Anderson + * common.c,dwarfdump.c: Update version string. +2016-02-07 David Anderson + * common.c,dwarfdump.c: Update version string. +2016-02-06 David Anderson + * print_die.c,tag_attr.c,tag_tree.c: Remove trailing whitespace. +2016-02-06 David Anderson + * warningcontrol.h: Defines UNUSEDARG macro as needed. + * common.c,dwarf_tsearchbal.c,dwarfdump.c,globals.h, + macrocheck.c: Now use UNUSEDARG macro so known-unused + args do not cause spurious warnings. + * configure.in: Sets HAVE_UNUSED_ATTRIBUTE if the compiler + in use supports __attribute ((unused)). So we can have + lots of warnings turned on without seeing the warnings + we wish to ignore for now. + * configure,config.h.in: Regenerated. +2016-02-06 David Anderson + * print_frames.c: Was printing cie index, not fde index, + in the fde output. Now prints more sensibly. + Now tests do_print_dwarf, the flag it should have been using, + to decide whether to print. +2016-02-02 David Anderson + * dwarfdump.c: Get section sizes so we can do a better + sanity check on ofsets (ie, call dwarf_get_section_max_offsets_c()). + Check DWARF2 macros for sanity just as we do DWARF5 + macros. Read DWARF2 macros per-cu, not as a standalone + section. Add global data section_high_offsets_global, + a struct with all known section sizes. + * macrocheck.c: New section size argument for more complete + size analysis. + * globals.h: Declarations for section_high_offsets_global. + * macrocheck.h: Update prototype of print_macro_statistics(). + * print_die.c: Drop section-as-a-whole macro reporting for + macinfo in favor of reporting per CU. + * print_macros.c: Allow for print and check runs (not both + at once). +2016-01-28 David Anderson + * dwarfdump.c,common.c: Update version string. + * print_die.c: Changed the most frequent global die + offset values to print as GOFF=0x... + for uniformity with -G and space saving from the + string 'global die offset'. +2016-01-27 David Anderson + * print_die.c: Added a helpertree find call on typedieoffset + which is really a better check for known signed/unsigned. +2016-01-26 David Anderson + * dwarfdump.c,common.c: Update version string. +2016-01-26 David Anderson + * Makefile.in: Added helpertree.h, and .c. + * dwarfdump.c: Added include helpertree.h + * print_die.c: Now attempts (harder) to + figure out if a constant is really signed or insigned + when printing it. Fixes annoyance with printing attributes + longer than 27 characters. + Unifies a number of printf-style calls into functions, reducing + the number of statically visible calls to sprintf. + Attempts to remember whether some things are explicitly + typed as signed or unsigned. + * helpertree.h, helpertree.c: New. Simple use of tsearch + to memo-ize signedness. +2016-01-20 + * configure.in: Added more compiler optiosn to --enable-wall + * configure: Regenerated + * dwarf_tsearchbal.c: Fixed warnings. + * dwarfdump.c: Fixed warnings. + * dwconf.c: Fixed warnings. + * dwconf.h: Fixed warnings. + * esb.c: Fixed warnings. + * globals.h: Fixed warnings. + * print_debugfission.c: Fixed warnings. + * print_die.c: Fixed warnings. + * print_frames.c: Fixed warnings. + * print_sections.c: Fixed warnings. +2016-01-20 + * macrocheck.c: Remove trailing whitespace. + * print_lines.c: Only print line context record + if we do_print_dwarf is non-zero. The directory index + was printing as 0 in the line_context record. Was a typo + in the printf, now fixed. +2016-01-20 + * configure.in: Now --enable-wall adds -Wdeclaration-after-statement + etc. + * configure: Regenerated. + * dwarfdump.c: Now all functions have visible prototypes, no (). + * dwconf.c: Now local func declared static. + * dwgetopt.c: Added include dwgetopt.h. Unused function + #if 0 so invisible. + * globals.h: Now all functions have prototypes, no (). + * macrocheck.c: Removed unused locals. Fixed a + dwarf_twalk call to *tree (not just tree). + * naming.c: Added include naming.h. + * print_gdbindex.c: Made local function static. + * tag_attr.c,tag_common.c: Made local function static. +2016-01-19 David Anderson + * dwarf_tsearchbal.c: Deleted the unused function rotatex(). + * dwarfdump.c: Remove duplicate trailing ; + * esb.c(esb_append): Straighten out the logic + and avoid doing append if the to-be-appended + string is empty. + * globals.h Add ifdef __cplusplus for extern "C". + * esb.h,naming.h: Idempotent #ifndef and __cplusplus extern "C" added. + * print_frames.c: Ensure local var starts at zero. + Move statement to below declarations. + * print_lines.c: Ensure declarations before executable statements. +2016-01-19 David Anderson + * print_frames.c: Fix trailing whitespace and indentation. +2016-01-19 David Anderson + * print_die.c,tag_tree.c: Change statement ;; by removing + second semicolon. +2016-01-17 David Anderson + * common.c: Update version string + * dwarfdump.c: Made reset_overall_CU_error_data() a global. + We now try to show CU name etc on case there is an error + reading frame data. Update version strin. + Added DEBUG_FRAME DEBUG_FRAME_EH to the PRINT_CU_INFO() tests. + New function: load_CU_error_data(). + * print_frames.c: Now uses a local Dwarf_Error + in a few places (CU names for frames) instead + of the global 'err' so we do not get the errors + mixed up. + We now try to show CU name etc on case there is an error + reading frame data. +2016-01-14 David Anderson + * common.c: Update version string. + * dwarfdump.c: Update version string. Include macrocheck.h. + Delete one accidental blank line. + * dwarf_tsearchbal.c: Added comment about compiler warning. + * dwarf_macrocheck.c: Added missing return statement. + Removed trailing whitespace. Fixed broken qsort_compare() + * macrocheck.h: Fixed trailing whitespace. + * print_abbrevs.c: Generalized an attribute count warning + a bit (see GENERAL_MAX_ATTRIB_COUNT). Fixed the code + handling the abbrev_array to be correct and a bit simpler. + Added new abbreviations tests. + * print_die.c: Include macrocheck.h. Fix trailing whitespace. +2016-01-12 David Anderson + * common.c: Update version string. + * dwarfdump.c: Update version string. + * print_abbrevs.c: If an abbreviation number is a bit + goofy, accomodate it so we do not write to + memory we did not allocate. It will + be caught a bit later in the run as an invalid DIE + or abbreviation. + * print_die.c: When we switch sections inside a DIE print + save and restore current_section_id to get the best + reporting on errors/checks. +2016-01-12 David Anderson + * common.c,dwarfdump.c: Update version string. +2016-01-12 David Anderson + * Makefile.in: Adding macrocheck.h, and .c. Adding + selftest of macrocheck.c. + * dwarfdump.c: Now handles imported DWARF5 macros + and adds support for -kw for macro section checking. + * globals.h: Adding check_macros flag and macro_check_tree declaration + and print_macros_5style_this_cu() declaration.. + * print_die.c: Now prints imported macros using + print_macros_5style_this_cu(). + * print_macro.c: Now deals with imported macro units using + macrocheck.c and .h. Fixed bug for DW_MACRO_define/undef + where we did improper string validity check. + diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/DWARFDUMPCOPYRIGHT b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/DWARFDUMPCOPYRIGHT new file mode 100644 index 0000000..b4af4a5 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/DWARFDUMPCOPYRIGHT @@ -0,0 +1,93 @@ + +========The dwarfdump copyright======= + +The full text of the GPL version 2 is provided in the file GPL.txt. + +See the end of this file for January 2015 changes. + +Nearly all the files in this directory have contained a GPL +copyright, not an LGPL copyright, for years. The following +is an example of that copyright as used in the dwarfdump +source, and is what SGI always intended (in David +Anderson's opinion) to have present in +the DWARFDUMPCOPYRIGHT file. (tag_tree.list tag_attr.list +acconfig.h have long been marked LGPL and therefore the LGPL +copyright, not GPL, applies to those three files.) This GPL +copyright text added here to DWARFDUMPCOPYRIGHT Dec 4, 2006 + + Copyright (C) 2000,2002,2004,2005 Silicon Graphics, Inc. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it would be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Further, this software is distributed without any warranty that it is + free of the rightful claim of any third person regarding infringement + or the like. Any license provided herein, whether implied or + otherwise, applies only to this software file. Patent licenses, if + any, provided herein do not apply to combinations of this program with + other software, or any other product whatsoever. + + You should have received a copy of the GNU General Public License along + with this program; if not, write the Free Software Foundation, Inc., 51 + Franklin Street - Fifth Floor, Boston MA 02110-1301, USA. + + Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, + Mountain View, CA 94043, or: + + http://www.sgi.com + + For further information regarding this notice, see: + + http://oss.sgi.com/projects/GenInfo/NoticeExplan + + +The following was the entire content of this file before +December 24 2006, Being the LGPL text this is in conflict +with the individual source files and I (David Anderson) +believe the source file copyright was intended for dwarfdump +not the LGPL source directly following this note. However the +3 files tag_tree.list tag_attr.list acconfig.h have long been +marked LGPL and the following copyright applies to those three. + + Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2.1 of the GNU Lesser General Public License + as published by the Free Software Foundation. + + This program is distributed in the hope that it would be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Further, this software is distributed without any warranty that it is + free of the rightful claim of any third person regarding infringement + or the like. Any license provided herein, whether implied or + otherwise, applies only to this software file. Patent licenses, if + any, provided herein do not apply to combinations of this program with + other software, or any other product whatsoever. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, + USA. + + Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, + Mountain View, CA 94043, or: + + http://www.sgi.com + + For further information regarding this notice, see: + + http://oss.sgi.com/projects/GenInfo/NoticeExplan + + +As of 31 January 2015 the lines +with http://www.sgi.com and oss.sgi.com have been removed. +sgi.com is readily found on the web and oss.sgi.com +no longer exists. No one from SGI still contributes +to dwarfdump. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/GPL.txt b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/GPL.txt new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/GPL.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/Makefile.in b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/Makefile.in new file mode 100644 index 0000000..41dd2c3 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/Makefile.in @@ -0,0 +1,256 @@ +# Makefile for dwarfdump +# This is made very simple so it should work with +# any 'make'. +# The Makefile does assume that libdwarf is at ../libdwarf +# from the dwarfdump2 source directory. +# + +srcdir = @srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = $(exec_prefix)/bin +libdir = $(exec_prefix)/lib +mandir = $(exec_prefix)/share/man +man1dir = $(mandir)/man1 + + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +DATAROOT = @datarootdir@ +SHELL = /bin/sh +CC = @CC@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +RM = rm +RANLIB = @RANLIB@ +DEFS = @DEFS@ +# ../libdwarf gets us to local headers and a libdwarf +# archive, usually, so we assume it. +dwfwall = @dwfwall@ +dwfsanitize = @dwfsanitize@ +dwfzlib = @dwfzlib@ +LIBDWARF_PATH = ../libdwarf +DIRINC = $(srcdir)/../libdwarf +LIBS = @LIBS@ -L../libdwarf -ldwarf -lelf $(dwfzlib) +INCLUDES = -I. -I$(srcdir) -I../libdwarf -I$(srcdir)/../libdwarf +CFLAGS = $(PREINCS) @CPPFLAGS@ @CFLAGS@ $(INCLUDES) $(dwfwall) $(dwfsanitize) -DCONFPREFIX=${libdir} $(POSTINCS) +LDFLAGS = $(PRELIBS) @LDFLAGS@ $(LIBS) $(dwfsanitize) $(POSTLIBS) +#VG = valgrind --leak-check=full --show-leak-kinds=all +VG = + + +INSTALL = cp + +binprefix = + +FINALOBJECTS = \ + addrmap.o \ + checkutil.o \ + dwarfdump.o \ + dwconf.o \ + esb.o \ + glflags.o \ + helpertree.o \ + macrocheck.o \ + print_abbrevs.o \ + print_aranges.o \ + print_debugfission.o \ + print_die.o \ + print_dnames.o \ + print_frames.o \ + print_gdbindex.o \ + print_lines.o \ + print_locs.o \ + print_macro.o \ + print_macros.o \ + print_pubnames.o \ + print_ranges.o \ + print_reloc.o \ + print_sections.o \ + print_section_groups.o \ + print_static_funcs.o \ + print_static_vars.o \ + print_strings.o \ + print_types.o \ + print_weaknames.o \ + sanitized.o \ + section_bitmaps.o \ + strstrnocase.o \ + uri.o +GEN_HFILES = common.o \ + tmp-tt-table.c \ + tmp-ta-table.c \ + tmp-ta-ext-table.c \ + tmp-tt-ext-table.c + +all: dwarfdump + +HEADERS = $(srcdir)/checkutil.h \ + $(srcdir)/common.h \ + $(srcdir)/dwconf.h \ + $(srcdir)/dwgetopt.h \ + $(srcdir)/esb.h \ + $(srcdir)/globals.h \ + $(srcdir)/macrocheck.h \ + $(srcdir)/makename.h \ + $(srcdir)/dwarf_tsearch.h \ + $(srcdir)/print_frames.h \ + $(srcdir)/section_bitmaps.h \ + $(srcdir)/uri.h + +$(FINALOBJECTS): $(GEN_HFILES) $(HEADERS) $(srcdir)/naming.c + +default: $(TARGETS) + +dwarfdump: $(FINALOBJECTS) dwarf_tsearchbal.o makename.o naming.o common.o dwgetopt.o + $(CC) $(CFLAGS) -o $@ $(FINALOBJECTS) common.o makename.o naming.o dwgetopt.o dwarf_tsearchbal.o $(LDFLAGS) + +dwgetopt.o: $(srcdir)/dwgetopt.h $(srcdir)/dwgetopt.c + $(CC) $(CFLAGS) -c $(srcdir)/dwgetopt.c + +dwarf_tsearchbal.o: $(srcdir)/dwarf_tsearch.h $(srcdir)/dwarf_tsearchbal.c + $(CC) $(CFLAGS) -c $(srcdir)/dwarf_tsearchbal.c + +makename.o: $(srcdir)/makename.h $(srcdir)/makename.c + $(CC) $(CFLAGS) -c $(srcdir)/makename.c + +common.o: $(srcdir)/common.c $(srcdir)/common.h + $(CC) $(CFLAGS) -c $(srcdir)/common.c + +naming.o: $(srcdir)/naming.c $(srcdir)/naming.h + $(CC) $(CFLAGS) -c $(srcdir)/naming.c + +# We need this as naming.o has external references we cannot have +# in the tree builds. +trivial_naming.o: $(srcdir)/naming.c + $(CC) $(CFLAGS) -DTRIVIAL_NAMING -c $(srcdir)/naming.c -o trivial_naming.o + +tag_tree_build: $(srcdir)/tag_tree.c $(DIRINC)/dwarf.h $(HEADERS) tag_common.o makename.o common.o trivial_naming.o dwgetopt.o dwarf_tsearchbal.o + LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(LIBDWARF_PATH) $(CC) $(CFLAGS) $(srcdir)/tag_tree.c tag_common.o common.o makename.o dwarf_tsearchbal.o trivial_naming.o dwgetopt.o $(LDFLAGS) -o tag_tree_build + +tag_attr_build: $(srcdir)/tag_attr.c $(DIRINC)/dwarf.h $(HEADERS) tag_common.o makename.o common.o trivial_naming.o dwgetopt.o dwarf_tsearchbal.o + $(CC) $(CFLAGS) $(srcdir)/tag_attr.c tag_common.o common.o makename.o trivial_naming.o dwarf_tsearchbal.o dwgetopt.o $(LDFLAGS) -o tag_attr_build + +# Plain GNU C dash E does not work on a .list, +# so copy to a .c name to run +# the following four table creations. +tmp-tt-table.c: $(srcdir)/tag_tree.list tag_tree_build + -rm -f tmp-t1.c + cp $(srcdir)/tag_tree.list tmp-t1.c + $(CC) $(CFLAGS) -E tmp-t1.c > ./tmp-tag-tree-build1.tmp + LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(LIBDWARF_PATH) ./tag_tree_build -s -i tmp-tag-tree-build1.tmp -o tmp-tt-table.c + +tmp-tt-ext-table.c: $(srcdir)/tag_tree_ext.list tag_tree_build + -rm -f tmp-t4.c + cp $(srcdir)/tag_tree_ext.list tmp-t4.c + $(CC) $(CFLAGS) -E tmp-t4.c > ./tmp-tag-tree-build4.tmp + LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(LIBDWARF_PATH) ./tag_tree_build -e -i tmp-tag-tree-build4.tmp -o tmp-tt-ext-table.c + +tmp-ta-table.c: $(srcdir)/tag_attr.list tag_attr_build + -rm -f tmp-t2.c + cp $(srcdir)/tag_attr.list tmp-t2.c + $(CC) $(CFLAGS) -E tmp-t2.c > ./tmp-tag-attr-build2.tmp + LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(LIBDWARF_PATH) ./tag_attr_build -s -i tmp-tag-attr-build2.tmp -o tmp-ta-table.c + +tmp-ta-ext-table.c: $(srcdir)/tag_attr_ext.list tag_attr_build + -rm -f tmp-t3.c + cp $(srcdir)/tag_attr_ext.list tmp-t3.c + $(CC) $(CFLAGS) -E tmp-t3.c > ./tmp-tag-attr-build3.tmp + LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(LIBDWARF_PATH) ./tag_attr_build -e -i tmp-tag-attr-build3.tmp -o tmp-ta-ext-table.c + + +test: esb.o dwgetopt.o + echo "ESB test" + $(CC) $(CFLAGS) -o test $(srcdir)/testesb.c esb.o + $(VG) ./test + -rm -f ./test + echo "dwgetopt test" + $(CC) $(CFLAGS) -o getopttest $(srcdir)/getopttest.c dwgetopt.o + $(VG) ./getopttest + -rm -f ./getopttest + echo "Now use system getopt to validate our tests" + $(CC) $(CFLAGS) -DGETOPT_FROM_SYSTEM -o getopttestnat $(srcdir)/getopttest.c dwgetopt.o + ./getopttestnat -c 1 + ./getopttestnat -c 2 + ./getopttestnat -c 3 + ./getopttestnat -c 5 + ./getopttestnat -c 6 + ./getopttestnat -c 7 + ./getopttestnat -c 8 + -rm -f ./getopttestnat + -rm -f ./selfesb + -rm -f ./selfmc + -rm -f ./selfmakename + -rm -f ./selfsection_bitmaps + -rm -f ./selfprint_reloc + $(CC) -g -c $(INCLUDES) $(srcdir)/esb.c + $(CC) -g -c $(INCLUDES) $(srcdir)/dwarf_tsearchbal.c + $(CC) -g -DSELFTEST $(INCLUDES) $(srcdir)/makename.c dwarf_tsearchbal.o -o selfmakename + $(CC) -DSELFTEST $(INCLUDES) -g $(srcdir)/helpertree.c esb.o dwarf_tsearchbal.o -o selfhelpertree + ./selfhelpertree + rm -f ./selfhelpertree + ./selfmakename + rm -f ./selfmakename + $(CC) -DSELFTEST $(INCLUDES) -g $(srcdir)/macrocheck.c esb.o dwarf_tsearchbal.o -o selfmc + ./selfmc + rm -f ./selfmc + $(CC) -DSELFTEST -g $(srcdir)/esb.c -o selfesb + ./selfesb + rm -f ./selfesb + $(CC) -DSELFTEST -I../libdwarf -g section_bitmaps.c -o selfsection_bitmaps + ./selfsection_bitmaps + rm -f ./selfsection_bitmaps + $(CC) -DSELFTEST -I../libdwarf -g print_reloc.c esb.o -o selfprint_reloc + ./selfprint_reloc + rm -f ./selfprint_reloc + +# This simply assumes that a default INSTALL (cp) command +# 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 + +uninstall: + -rm -f $(bindir)/dwarfdump + -rm -f $(man1dir)/dwarfdump.1 + -rm -f $(libdir)/dwarfdump.conf + +clean: + rm -f *.o dwarfdump + rm -f _tag_attr_table.c + rm -f _tag_attr_ext_table.c + rm -f _tag_tree_table.c + rm -f _tag_tree_ext_table.c + -rm -f tag_attr_build*.tmp + -rm -f tag_tree_build*.tmp + rm -f tag_tree_build + rm -f tag_attr_build + -rm -f _*.c _*.h + -rm -f tmp-*.c tmp-*.h tmp-*.tmp + rm -f gennames + rm -f dwarf_names_new.c + rm -f dwarf_names_new.h + rm -f dwarf_names_enum.h + rm -f dwarf_names.h + rm -f dwarf_names.c + rm -f a.out + rm -f getopttest + rm -f getopttestnat + rm -f selfhelpertree + rm -f selfmc + rm -f *~ + +distclean: clean + rm -f config.log config.h config.cache config.status + rm -rf autom4te.cache + rm -rf Makefile + +shar: + @echo "shar not set up yet" +dist: + @echo "dist not set up yet" diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/NEWS b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/NEWS new file mode 100644 index 0000000..ee4af2b --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/NEWS @@ -0,0 +1,262 @@ +May 17, 2017 + Now dwarfdump understands both split-dwarf and COMDAT sections + (it calls the section-groups 'Groups') + so it is possible to properly print all such. A traditional + DWARF2,3,4,5 consumer can ignore section groups. + To print in more complicate situations the -x groupnumber=3 + (3 as an example) lets you choose a specific group/comdat to print. + Dwarfdump prints out a section-groupnumber table when appropriate + a making it easy to know what groups are present. +March 24, 2017 + dwarfdump: Now argv[0] is checked before setting the program_name + global variable. If it contains '/dwarfdump.O' that part of + the string is shortened to '/dwarfdump'. + Doing this removes a need for the regressiontests to use sed + and shortens the regressiontests runtime on one machine from + 77 minutes to 23 minutes. +September 20, 2016 + dwarfdump now frees all memory it used when it terminates normally. + No malloc space left behind. + It gets a clean report from + valgrind --leak-check=full --show-leak-kinds=all +May 5, 2016 + By default dwarfdump sanitizes strings, so if a corrupted + DWARF file has non-printable bytes in a string they are + each turned into %xx (% followed by + two hex digits for a single string character). + This is safe for terminals to print and shows the actual value. + The '-x nosanitizestrings' option turns off this feature so bytes + are shown as printf and your system show them. + The same format as uri style, but only using % on characters + that may have bad effects if printed to a terminal (not, + for example, space or tab characters). + Nor are normal '%' in a string altered (in uri such would be + turned to %25 or to %%). +February 25, 2015 + Copied dwgetopt.c dwgetopt.h from libdwarf so dwarfdump can + use dwgetopt() and still build without necessarily + having the libdwarfsource easily available. + Some environments do not have a getopt() so copying + dwgetopt.h,.h here ensures we have this functionality + for everyone. +January 08, 2015 + dwarfdump does new checking. See options -kD -kG -ku -kuf. + In addition, dwarfdump output can be written to a file without + using redirection by using the new -O file= + option. +January 29, 2014 + Now using dwarf_tsearch() so tsearch is available on every platform. +November 17, 2012 + Added new checking options. + To get good relocation-handling dwarfdump now expects to read + headers from libdwarf with the relocation numbers. That means + building dwarfdump separate from the libdwarf source is no + longer as useful as it was. It is best to build libdwarf + and dwarfdump together for decent handling of relocatable + objects. +December 13, 2011 + Now prints missing line table column number as 0 (now + matching the DWARF spec), the previous + practice of printing -1 was always wrong. + And prints the DWARF3/4 new line table fields (when present). +October 29, 2011 + Added support for printing .debug_types (type unit) data. +October 26, 2011 + Added new features to Makefile.in and documented in README + how to build dwarfdump with headers or libraries in + non-standard places. +October 23, 2011 + By default the various places with string option values + and file paths all use URI transformation on input and + if the transformation does anything at all dwarfdump reports + the input and transformed strings. This makes it easy + to deal with strings and expressions and file paths + that are difficult to express in a shell (or that getopt + mangles). Options -q and -U give you control over this process. +October 07, 2011 + The -x abi=mips frame register abi in dwarfdump.conf is now + usable with modern MIPS objects as well as old IRIX objects. + There are other mips-* frame register setups described + in dwarfdump.conf for anyone testing that nothing new has + been added that conflicts with old IRIX/MIPS frame generation. +June 04, 2011 + Error checking is now distinct from section printing, making + error checking (the -k options) much easier to work with on + large objects. + So compiler-created errors can be found, the error reporting + now prints context information. +March 29, 2011 + Added many new correctness tests. Changed the format of + various items (line data prints in a more compact form, numbers + are more uniformly hexadecimal fixed length where that makes sense). + All the source files are uniformly indented to a multiple of 4 + characters and all intent-tabs in the source have been removed. + Major logic changes involved changing error-reporting to be + more detailed and adding new tests for incorrect DWARF. + Now reports error summary by the compiler name, not just overall. +January 26, 2010 + Changed the default frame-data register names from MIPS to + a generic set of registers. + Try '-x abi=mips' to get the traditional old MIPS register + naming. +June 22, 2009 + Added the -S option to dwarfdump. +June 10, 2009 + Moved the gennames.c code to libdwarf. +May 4, 2009 + Replaced awk source-generation of certain functions + with new gennames.c code. + Now we can print an object with an address_size that + varies by compilation unit. +April 4, 2009 + Corrected aspects of the frame-printing by ensuring we pass + all the information libdwarf needs for fully consistent behavior. + Three newly defined libdwarf calls calls made to ensure + that better behavior (specifically having dwarfdump consistently + recognize when registers are the cfa, undefined-value or same-value + pseudo registers). Updated dwarfdump.conf to set these same + things consistently. +Mar 22, 2009 + The -f and -F flags no longer also imply -i (it just + did not make sense to tie them (cannot recall why + it might have been tied before). +Mar 20, 2009 + Moved print_* functions from print_sections.c to individual + source files. Hopefully making the code a bit easier + to read. +Feb 16, 2009 + Added the -C option. It is a sort of 'pedantic' option + as it turns on warnings about certain commonly used + non-standard tag->tag and tag->attr relationships. + Added the tag_attr_ext.list tag_tree_ext.list files which + define the 'common use' extensions. +Feb 14, 2009 + Added configure option --enable-nonstandardprintf + which makes it easy to get printf of Dwarf_Unsigned (etc) + types correct even for non-standard compilers. +December 30, 2008 + Now we print the .debug_ranges section (with -N) + and the data for DW_AT_ranges (with -i). +December 8, 2008 + The -M option now causes printing of FORM details. + And -v adds details about abbreviation 'indexes' into + an abbreviation table (.debug_abbrev) + providing more detail for folks debugging or + improving their understanding of DWARF data. +April 9, 2008 + Added -H to limit the number of compilation-units/FDEs + dwarfdump prints in one run. Added -n to eliminate function-name + printing in .debug_frame output (with a large-enough debug_info + section function-name printing is too slow). The function name + printing will be fixed in another release. +December 8, 2007 + Had to add an ugly configure conditional as libelf has + unconditional use of off64_t in recent libelf.h +July 3, 2007 + Now with -v dwarf expression blocks in frame operations + are printed expanded out. +July 2, 2007 + Added a new abi -x abi=general usable for any cpu with + up to 1000 registers. +May 7, 2007 + Sun Microsystems contributes new dwarf.h extensions and a new -G option + to dwarfdump -i (so one can see the 'global' offset to DIEs). + Thanks to Chris Quenelle of Sun. +April 17, 2006 + New -x name= -x abi= and configuration file + enable sensible printing of a wide range of .debug_frame eh_frame + correctly without recompiling dwarfdump or touching libdwarf.h or + dwarf.h. +March 29, 2005 + Now handles DWARF3. For non-MIPS objects, the list of register + names in print_sections.c is not appropriate, #define + DWARFDUMP_TURN_OFF_MIPS_REG_NAMES to turn off the MIPS names. +December 1, 2005 + Added new DWARF3 TAGs and ATtributes to the -k lists, + clarified the -k reporting, and made the build more robust + in the face of errors in the *.list relationship-spec-files. + +August 1, 2005 + Now print_die.c deals with long loclists without a coredump. + Added esb.h esb.c (and testesb.c for testing) to encapsulate + getting space for possibly-long strings. + Now print_die.c uses snprintf() not sprintf (hopefully this + will not inconvenience anyone, snprintf() has been available + on most systems for years now). + Altered print of location lists a little bit - for better appearance. + +July 15, 2005 + Now completely frees all allocated memory. Various + routines were not calling dealloc() code and + new libdwarf dealloc routines are now used where those + are needed. + + Now prints DWARF3 .debug_pubtypes section (with -a or -y). + The .debug_pubtypes section and SGI-specific .debug_typenames + are equivalent so they are treated alike. + +Mar 21, 2005 + The -f flag now prints only .debug_frame data. The .eh_frame section + (GNU exceptions data) now prints with -F (not -a). + Printing gcc 3.3 or 3.4 .eh_frame with zR augmentation + does not work at this time, so do not use -F + to print such an object. + The line section print now prints a CU-DIE offset for each such DIEs + line information. This makes it much easier to correctly associate + -l (or -v -l) output with -v -v -l when debugging a faulty + linetable in an executable. + With -v -v -l (two -v) the output of line info continues to be a + completely different format than zero or one -v, the two-v + form showing the detailed line table opcodes. + With g++ 3.3.3 one sees bad line addresses at times as the + DW_LNE_set_address address for header files do not always + get their relocations applied. I am told this is fixed in 3.4.x. + + +Mar 18, 2005 + In correcting printing of macro information the format + of the macro (-m) output has changed substantially. + Much more complete now. Still could use enhancement. + +Oct 28, 2004 + Updated contact address in copyright: SGI moved 1/4 mile + to a new address: 1500 Crittenden Lane. + +Oct 02, 2003 + Now fully supports .debug_loc section. + +June 14, 2001 + Now calling a new function dwarf_get_arange_cu_header_offset() + in libdwarf and printing the returned cu header offset for + aranges entries. Making it easier to track down internal + errors in the dwarf2 data. Also added small other + consistency checks, printing a message and exit()ing on + error. + +April 14, 2000 + The libdwarf copyright has changed to + version 2.1 of the GNU Lesser General Public License. + Anyone holding a version of libdwarf that was published + before this new copyright + is allowed to use + the copyright published in that earlier libdwarf source + on the earlier source + or to use + this new copyright on the earlier source, + at their option. + +July 21, 1999 + Added gnu extensions to the frame information printer + and handling for egcs eh_frame printing. + libdwarf changes mean this now can print little-endian + object dwarf on a big-endian system and vice-versa. + +December, 1998 + added dwarfdump to the dwarf public source distribution. + +June, 1994 + libdwarf consumer interface changed completely so updated to match. + +May, 1993 + Initial version of dwarfdump for dwarf version 2 + written at sgi. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/README b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/README new file mode 100644 index 0000000..515e2b6 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/README @@ -0,0 +1,82 @@ +I would prefer you try using ../dwarfdump2, not this source. +If you must use this for some reason, could you let me know why? +Thanks. + +To build dwarfdump, first build libdwarf in the neighboring +directory then type + ./configure + make + +Installation is a bit primitive. + sudo make install +may or may not work. +Some or all of the following might be required on Unix or Linux or MacOS: + sudo mkdir -p /usr/local/share/man/man1/ + sudo mkdir -p /usr/local/lib + sudo mkdir -p /usr/local/bin +Then retry the 'sudo make install' and (if necessary) try + sudo chmod a+x /usr/local/bin/dwarfdump + sudo chmod a+r /usr/local/share/man/man1/dwarfdump.1 + sudo chmod a+r /usr/local/lib/dwarfdump.conf +You don't really need the dwarfdump.1 man page, +but you might as well have it. If the man page is not visible +with 'man dwarfdump' try 'man manpath' for hints. + +If you don't need others using dwarfdump on your computer, +just + cp dwarfdump $HOME/bin/dwarfdump +(by convention many people put personal executables in $HOME/bin +and fix up $PATH to refer there) which suffices as 'installation'. +Also + cp dwarfdump.conf $HOME + +To use dwarf or libdwarf, you may want to install dwarf.h +and libdwarf.h somewhere convenient. +You can just copy those two headers to /usr/local/include by hand +(or anywhere, really, that you have permission to copy to) +(you may need to use -I/usr/local/include on compile lines +to reference them there, but see below on configure and make). + +Notice that dwarf_names.c and dwarf_names.h are supplied by +the release though the Makefile can and may rebuild them. +Some users find it difficult to get a reliable awk(1) program, +so for them these prebuilt versions may be useful. + +If your headers or libelf/libdwarf are not in the expected places, +use the make command line to add flags and include directories. +For example + ./configure + PREINCS="-I /usr/local/include" POSTINCS="-I /home/x/include" make +PREINCS content is inserted before CFLAGS as make(1) is running. +POSTINCS content is added after the CFLAGS value. + +To set LDFLAGS, +do so at configure time, for example: + ./configure LDFLAGS="-L /some/dir" +And/or use PRELIBS and/or POSTLIBS at 'make' time similar to the use +of PREINCS and POSTINCS. + +If the libdwarf directory +has both libdwarf.so and libdwarf.a, the libdwarf.so +will be picked up and + "./tag_tree_build: error while loading shared libraries: + libdwarf.so: cannot open shared object file: + No such file or directory" +will probably result. +Either: remove libdwarf.so and rebuild or set +the environment variable LD_LIBRARY_PATH to the directory +containing the .so or use LDFLAGS to set rpath (see just below). +It is perhaps simpler to ensure that the libdwarf directory +only has an archive, not a shared-library. +But sometimes one wants a shared library. +In that case +one can set ld's -rpath on the gcc command line like this: + LDFLAGS="-Wl,-rpath=/some/path/libdir" +so the shared library can be found at run time automatically. + +The same problem may arise with libelf, and the same approach +will solve the problem. + + + +David Anderson. davea42 at earthlink dot net. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/addrmap.c b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/addrmap.c new file mode 100644 index 0000000..c3b0e2d --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/addrmap.c @@ -0,0 +1,123 @@ +/* + Copyright 2010-2012 David Anderson. All rights reserved. + Portions Copyright 2012 SN Systems Ltd. All rights reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it would be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Further, this software is distributed without any warranty that it is + free of the rightful claim of any third person regarding infringement + or the like. Any license provided herein, whether implied or + otherwise, applies only to this software file. Patent licenses, if + any, provided herein do not apply to combinations of this program with + other software, or any other product whatsoever. + + You should have received a copy of the GNU General Public License along + with this program; if not, write the Free Software Foundation, Inc., 51 + Franklin Street - Fifth Floor, Boston MA 02110-1301, USA. + +*/ + +/* If memory full we do not exit, we just keep going as if + all were well. */ + +#include "globals.h" +#include +#include "addrmap.h" +#include "dwarf_tsearch.h" + + +static struct Addr_Map_Entry * +addr_map_create_entry(Dwarf_Unsigned k,char *name) +{ + struct Addr_Map_Entry *mp = + (struct Addr_Map_Entry *)malloc(sizeof(struct Addr_Map_Entry)); + if (!mp) { + return 0; + } + mp->mp_key = k; + if (name) { + mp->mp_name = (char *)strdup(name); + } else { + mp->mp_name = 0; + } + return mp; +} +static void +addr_map_free_func(void *mx) +{ + struct Addr_Map_Entry *m = mx; + if (!m) { + return; + } + free(m->mp_name); + m->mp_name = 0; + free(m); + return; +} + +static int +addr_map_compare_func(const void *l, const void *r) +{ + const struct Addr_Map_Entry *ml = l; + const struct Addr_Map_Entry *mr = r; + if (ml->mp_key < mr->mp_key) { + return -1; + } + if (ml->mp_key > mr->mp_key) { + return 1; + } + return 0; +} +struct Addr_Map_Entry * +addr_map_insert( Dwarf_Unsigned addr,char *name,void **tree1) +{ + void *retval = 0; + struct Addr_Map_Entry *re = 0; + struct Addr_Map_Entry *e; + e = addr_map_create_entry(addr,name); + /* tsearch records e's contents unless e + is already present . We must not free it till + destroy time if it got added to tree1. */ + retval = dwarf_tsearch(e,tree1, addr_map_compare_func); + if (retval) { + re = *(struct Addr_Map_Entry **)retval; + if (re != e) { + /* We returned an existing record, e not needed. */ + addr_map_free_func(e); + } else { + /* Record e got added to tree1, do not free record e. */ + } + } + return re; +} +struct Addr_Map_Entry * +addr_map_find(Dwarf_Unsigned addr,void **tree1) +{ + void *retval = 0; + struct Addr_Map_Entry *re = 0; + struct Addr_Map_Entry *e = 0; + + e = addr_map_create_entry(addr,NULL); + retval = dwarf_tfind(e,tree1, addr_map_compare_func); + if (retval) { + re = *(struct Addr_Map_Entry **)retval; + } + /* The one we created here must be deleted, it is dead. + We look at the returned one instead. */ + addr_map_free_func(e); + return re; +} + + +void +addr_map_destroy(void *map) +{ + /* tdestroy is not part of Posix, it is a GNU libc function. */ + dwarf_tdestroy(map,addr_map_free_func); +} diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/addrmap.h b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/addrmap.h new file mode 100644 index 0000000..b4617c1 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/addrmap.h @@ -0,0 +1,33 @@ +/* + Copyright 2010 David Anderson. All rights reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it would be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Further, this software is distributed without any warranty that it is + free of the rightful claim of any third person regarding infringement + or the like. Any license provided herein, whether implied or + otherwise, applies only to this software file. Patent licenses, if + any, provided herein do not apply to combinations of this program with + other software, or any other product whatsoever. + + You should have received a copy of the GNU General Public License along + with this program; if not, write the Free Software Foundation, Inc., 51 + Franklin Street - Fifth Floor, Boston MA 02110-1301, USA. + +*/ + +struct Addr_Map_Entry { + Dwarf_Unsigned mp_key; + char * mp_name; +}; + +struct Addr_Map_Entry * addr_map_insert(Dwarf_Unsigned addr, + char *name, void **map); +struct Addr_Map_Entry * addr_map_find(Dwarf_Unsigned addr, void **map); +void addr_map_destroy(void *map); diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/checkutil.c b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/checkutil.c new file mode 100644 index 0000000..b7c2c41 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/checkutil.c @@ -0,0 +1,572 @@ +/* + Copyright (C) 2011 SN Systems Ltd. All Rights Reserved. + Portions Copyright (C) 2011-2012 David Anderson. All Rights Reserved. + Portions Copyright 2012 SN Systems Ltd. All rights reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it would be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Further, this software is distributed without any warranty that it is + free of the rightful claim of any third person regarding infringement + or the like. Any license provided herein, whether implied or + otherwise, applies only to this software file. Patent licenses, if + any, provided herein do not apply to combinations of this program with + other software, or any other product whatsoever. + + You should have received a copy of the GNU General Public License along + with this program; if not, write the Free Software Foundation, Inc., 51 + Franklin Street - Fifth Floor, Boston MA 02110-1301, USA. + +*/ +/* + + These simple list-processing functions are in support + of checking DWARF for compiler-errors of various sorts. + + +*/ + +#include "globals.h" +#include + +/* Private function */ +static void DumpFullBucketGroup(Bucket_Group *pBucketGroup); +static int FindDataIndexInBucket(Bucket_Group *pBucketGroup, + Bucket_Data *pBucketData); +static void PrintBucketData(Bucket_Group *pBucketGroup, + Bucket_Data *pBucketData); +static void ProcessBucketGroup(Bucket_Group *pBucketGroup, + void (*pFunction)(Bucket_Group *pBucketGroup,Bucket_Data *pBucketData)); + +Bucket_Group * +AllocateBucketGroup(int kind) +{ + Bucket_Group *pBucketGroup = (Bucket_Group *)calloc(1,sizeof(Bucket_Group)); + pBucketGroup->kind = kind; + return pBucketGroup; +} + +void +ReleaseBucketGroup(Bucket_Group *pBucketGroup) +{ + Bucket *pBucket = 0; + Bucket *pNext = 0; + + assert(pBucketGroup); + for (pBucket = pBucketGroup->pHead; pBucket; /*pBucket = pBucket->pNext*/) { + pNext = pBucket->pNext; + free(pBucket); + pBucket = pNext; + } + pBucketGroup->pHead = NULL; + pBucketGroup->pTail = NULL; + free(pBucketGroup); +} + +void +ResetBucketGroup(Bucket_Group *pBucketGroup) +{ + Bucket *pBucket = 0; + + assert(pBucketGroup); + for (pBucket = pBucketGroup->pHead; pBucket; pBucket = pBucket->pNext) { + pBucket->nEntries = 0; + } + ResetSentinelBucketGroup(pBucketGroup); +} + +/* Reset sentinels in a Bucket Group. */ +void +ResetSentinelBucketGroup(Bucket_Group *pBucketGroup) +{ + /* Sanity checks */ + assert(pBucketGroup); + pBucketGroup->pFirst = NULL; + pBucketGroup->pLast = NULL; +} + +void PrintBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Bool bFull) +{ + if (pBucketGroup) { + if (bFull) { + DumpFullBucketGroup(pBucketGroup); + } else { + if (pBucketGroup->pFirst && pBucketGroup->pLast) { + printf("\nBegin Traversing, First = 0x%08" DW_PR_DUx + ", Last = 0x%08" DW_PR_DUx "\n", + pBucketGroup->pFirst->key,pBucketGroup->pLast->key); + ProcessBucketGroup(pBucketGroup,PrintBucketData); + } + } + } +} + +static void +PrintBucketData(Bucket_Group *pBucketGroup,Bucket_Data *pBucketData) +{ + int nCount = 0; + assert(pBucketGroup); + assert(pBucketData); + + nCount = FindDataIndexInBucket(pBucketGroup,pBucketData); + printf("[%06d] Key = 0x%08" DW_PR_DUx ", Base = 0x%08" DW_PR_DUx + ", Low = 0x%08" DW_PR_DUx ", High = 0x%08" DW_PR_DUx + ", Flag = %d, Name = '%s'\n", + ++nCount, + pBucketData->key, + pBucketData->base, + pBucketData->low, + pBucketData->high, + pBucketData->bFlag, + pBucketData->name); +} + +static void +DumpFullBucketGroup(Bucket_Group *pBucketGroup) +{ + int nBucketNo = 1; + int nIndex = 0; + int nCount = 0; + Bucket *pBucket = 0; + Bucket_Data *pBucketData = 0; + + assert(pBucketGroup); + printf("\nBucket Group at 0x%lx [lower 0x%lx upper 0x%lx]\n", + (unsigned long)pBucketGroup, + (unsigned long)pBucketGroup->lower, + (unsigned long)pBucketGroup->upper); + for (pBucket = pBucketGroup->pHead; pBucket && pBucket->nEntries; + pBucket = pBucket->pNext) { + + printf("LowPC & HighPC records for bucket %d, at 0x%08lx\n", + nBucketNo++,(unsigned long)pBucket); + for (nIndex = 0; nIndex < pBucket->nEntries; ++nIndex) { + pBucketData = &pBucket->Entries[nIndex]; + printf("[%06d] Key = 0x%08" DW_PR_DUx ", Base = 0x%08" DW_PR_DUx + ", Low = 0x%08" DW_PR_DUx ", High = 0x%08" DW_PR_DUx + ", Flag = %d, Name = '%s'\n", + ++nCount, + pBucketData->key, + pBucketData->base, + pBucketData->low, + pBucketData->high, + pBucketData->bFlag, + pBucketData->name); + } + } +} + +/* Insert entry into Bucket Group. + We make no check for duplicate information. */ +void +AddEntryIntoBucketGroup(Bucket_Group *pBucketGroup, + Dwarf_Addr key,Dwarf_Addr base, + Dwarf_Addr low,Dwarf_Addr high, + const char *name, + Dwarf_Bool bFlag) +{ + Bucket *pBucket = 0; + Bucket_Data data; + + data.bFlag = bFlag; + data.name = name; + data.key = key; + data.base = base; + data.low = low; + data.high = high; + + assert(pBucketGroup); + if (!pBucketGroup->pHead) { + /* Allocate first bucket */ + pBucket = (Bucket *)calloc(1,sizeof(Bucket)); + pBucketGroup->pHead = pBucket; + pBucketGroup->pTail = pBucket; + pBucket->nEntries = 1; + pBucket->Entries[0] = data; + return; + } + + pBucket = pBucketGroup->pTail; + + /* Check if we have a previous allocated set of + buckets (have been cleared */ + if (pBucket->nEntries) { + if (pBucket->nEntries < BUCKET_SIZE) { + pBucket->Entries[pBucket->nEntries++] = data; + } else { + /* Allocate new bucket */ + pBucket = (Bucket *)calloc(1,sizeof(Bucket)); + pBucketGroup->pTail->pNext = pBucket; + pBucketGroup->pTail = pBucket; + pBucket->nEntries = 1; + pBucket->Entries[0] = data; + } + } else { + /* We have an allocated bucket with zero entries; search for the + first available bucket to be used as the current + insertion point */ + for (pBucket = pBucketGroup->pHead; pBucket; + pBucket = pBucket->pNext) { + + if (pBucket->nEntries < BUCKET_SIZE) { + pBucket->Entries[pBucket->nEntries++] = data; + break; + } + } + } +} + +/* For Groups where entries are individually deleted, this does + that work. */ +Dwarf_Bool +DeleteKeyInBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr key) +{ + int nIndex = 0; + Bucket *pBucket = 0; + Bucket_Data *pBucketData = 0; + + /* Sanity checks */ + assert(pBucketGroup); + + /* For now do a linear search */ + for (pBucket = pBucketGroup->pHead; pBucket && pBucket->nEntries; + pBucket = pBucket->pNext) { + + for (nIndex = 0; nIndex < pBucket->nEntries; ++nIndex) { + pBucketData = &pBucket->Entries[nIndex]; + if (pBucketData->key == key) { + Bucket_Data data = {FALSE,NULL,0,0,0,0}; + int nStart; + for (nStart = nIndex + 1; nStart < pBucket->nEntries; + ++nStart) { + + pBucket->Entries[nIndex] = pBucket->Entries[nStart]; + ++nIndex; + } + pBucket->Entries[nIndex] = data; + --pBucket->nEntries; + return TRUE; + } + } + } + return FALSE; +} + +/* Search to see if the address is in the range between + low and high addresses in some Bucked Data record. + This matches == if high is exact match (which usually means + one-past-true-high). */ +Dwarf_Bool +FindAddressInBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr address) +{ + int nIndex = 0; + Bucket *pBucket = 0; + Bucket_Data *pBucketData = 0; + + assert(pBucketGroup); + /* For now do a linear search */ + for (pBucket = pBucketGroup->pHead; pBucket && pBucket->nEntries; + pBucket = pBucket->pNext) { + + for (nIndex = 0; nIndex < pBucket->nEntries; ++nIndex) { + pBucketData = &pBucket->Entries[nIndex]; + if (address >= pBucketData->low && + address <= pBucketData->high) { + return TRUE; + } + } + } + return FALSE; +} + +/* Search an entry (Bucket Data) in the Bucket Set */ +Bucket_Data *FindDataInBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr key) +{ + int mid = 0; + int low = 0; + int high = 0; + Bucket *pBucket = 0; + Bucket_Data *pBucketData = 0; + + assert(pBucketGroup); + + for (pBucket = pBucketGroup->pHead; pBucket; pBucket = pBucket->pNext) { + /* Get lower and upper references */ + if (pBucket->nEntries) { + low = 0; + high = pBucket->nEntries; + while (low < high) { + mid = low + (high - low) / 2; + if (pBucket->Entries[mid].key < key) { + low = mid + 1; + } else { + high = mid; + } + } + if ((low < pBucket->nEntries) && + (pBucket->Entries[low].key == key)) { + + pBucketData = &pBucket->Entries[low]; + /* Update sentinels to allow traversing the table */ + if (!pBucketGroup->pFirst) { + pBucketGroup->pFirst = pBucketData; + } + pBucketGroup->pLast = pBucketData; + return pBucketData; + } + } + } + return (Bucket_Data *)NULL; +} + +/* Find the Bucket that contains a given Bucket Data + and return its local index. Else return -1. */ +static int +FindDataIndexInBucket(Bucket_Group *pBucketGroup,Bucket_Data *pBucketData) +{ + Bucket *pBucket = 0; + Bucket_Data *pLower = 0; + Bucket_Data *pUpper = 0; + + /* Sanity checks */ + assert(pBucketGroup); + assert(pBucketData); + + /* Use sentinels if any. */ + if (pBucketGroup->pFirst && pBucketGroup->pLast && + pBucketData >= pBucketGroup->pFirst && + pBucketData <= pBucketGroup->pLast) { + + /* Find bucket that contains the first sentinel */ + for (pBucket = pBucketGroup->pHead; pBucket && pBucket->nEntries; + pBucket = pBucket->pNext) { + + pLower = &pBucket->Entries[0]; + pUpper = &pBucket->Entries[pBucket->nEntries - 1]; + + /* Check if the first sentinel is in this bucket. */ + if (pBucketGroup->pFirst >= pLower && + pBucketGroup->pFirst <= pUpper) { + /* We have found the bucket, return the index. */ + return pBucketData - pBucketGroup->pFirst; + } + } + } else { + /* Find bucket that contains the entry */ + for (pBucket = pBucketGroup->pHead; pBucket && pBucket->nEntries; + pBucket = pBucket->pNext) { + + pLower = &pBucket->Entries[0]; + pUpper = &pBucket->Entries[pBucket->nEntries - 1]; + + /* Check if the first sentinel is in this bucket */ + if (pBucketData >= pLower && pBucketData <= pUpper) { + /* We have found the bucket, return the index */ + return pBucketData - pLower; + } + } + } + /* Invalid data; just return index indicating not-found */ + return -1; +} + +/* Search an entry (Bucket Data) in the Bucket Group. + The key is an offset, a DIE offset + within Visited info. */ +Bucket_Data *FindKeyInBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr key) +{ + int nIndex = 0; + Bucket *pBucket = 0; + Bucket_Data *pBucketData = 0; + + /* Sanity checks */ + assert(pBucketGroup); + + /* For now do a linear search */ + for (pBucket = pBucketGroup->pHead; pBucket && pBucket->nEntries; + pBucket = pBucket->pNext) { + for (nIndex = 0; nIndex < pBucket->nEntries; ++nIndex) { + pBucketData = &pBucket->Entries[nIndex]; + if (pBucketData->key == key) { + return pBucketData; + } + } + } + return (Bucket_Data *)NULL; +} + +/* Search an entry (Bucket Data) in the Bucket Set by name. + Used to find link-once section names. */ +Bucket_Data * +FindNameInBucketGroup(Bucket_Group *pBucketGroup,char *name) +{ + int nIndex = 0; + Bucket *pBucket = 0; + Bucket_Data *pBucketData = 0; + + assert(pBucketGroup); + /* For now do a linear search. */ + for (pBucket = pBucketGroup->pHead; pBucket && pBucket->nEntries; + pBucket = pBucket->pNext) { + for (nIndex = 0; nIndex < pBucket->nEntries; ++nIndex) { + pBucketData = &pBucket->Entries[nIndex]; + if (!strcmp(pBucketData->name,name)) { + return pBucketData; + } + } + } + return (Bucket_Data *)NULL; +} + +/* Check if an address valid or not. That is, + check if it is in the lower -> upper range of a bucket. + It checks <= and >= so the lower end + and one-past on the upper end matches. +*/ +Dwarf_Bool +IsValidInBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr address) +{ + Bucket *pBucket = 0; + Bucket_Data *pBucketData = 0; + int nIndex = 0; + + assert(pBucketGroup); + /* Check the address is within the allowed limits */ + if (address >= pBucketGroup->lower && + address <= pBucketGroup->upper) { + for (pBucket = pBucketGroup->pHead; + pBucket && pBucket->nEntries; + pBucket = pBucket->pNext) { + for (nIndex = 0; nIndex < pBucket->nEntries; ++nIndex) { + pBucketData = &pBucket->Entries[nIndex]; + if (address >= pBucketData->low && + address <= pBucketData->high) { + return TRUE; + } + } + } + } + return FALSE; +} + +/* Reset limits for values in the Bucket Set */ +void +ResetLimitsBucketSet(Bucket_Group *pBucketGroup) +{ + assert(pBucketGroup); + pBucketGroup->lower = 0; + pBucketGroup->upper = 0; +} + +/* Limits are set only for ranges, so only in pRangesInfo. */ +void +SetLimitsBucketGroup(Bucket_Group *pBucketGroup, + Dwarf_Addr lower,Dwarf_Addr upper) +{ + assert(pBucketGroup); + if (lower < upper) { + pBucketGroup->lower = lower; + pBucketGroup->upper = upper; + } +} + +/* Traverse Bucket Set and execute a supplied function */ +static void +ProcessBucketGroup(Bucket_Group *pBucketGroup, + void (*pFunction)(Bucket_Group *pBucketGroup,Bucket_Data *pBucketData)) +{ + int nIndex = 0; + int nStart = 0; + Bucket *pBucket = 0; + Bucket_Data *pBucketData = 0; + Bucket_Data *pLower = 0; + Bucket_Data *pUpper = 0; + Dwarf_Bool bFound = FALSE; + + /* Sanity checks */ + assert(pBucketGroup); + + /* No sentinels present; do nothing */ + if (!pBucketGroup->pFirst || !pBucketGroup->pLast) { + return; + } + + /* Find bucket that contains the first sentinel */ + for (pBucket = pBucketGroup->pHead; pBucket && pBucket->nEntries; + pBucket = pBucket->pNext) { + + pLower = &pBucket->Entries[0]; + pUpper = &pBucket->Entries[pBucket->nEntries - 1]; + + /* Check if the first sentinel is in this bucket */ + if (pBucketGroup->pFirst >= pLower && pBucketGroup->pFirst <= pUpper) { + /* Low sentinel is in this bucket */ + bFound = TRUE; + break; + } + } + + /* Invalid sentinel; do nothing */ + if (!bFound) { + return; + } + + /* Calculate index for first sentinel */ + nStart = pBucketGroup->pFirst - pLower; + + /* Start traversing from found bucket */ + for (; pBucket && pBucket->nEntries; pBucket = pBucket->pNext) { + for (nIndex = nStart; nIndex < pBucket->nEntries; ++nIndex) { + pBucketData = &pBucket->Entries[nIndex]; + if (pBucketData > pBucketGroup->pLast) { + return; + } + /* Call the user supplied function */ + if (pFunction) { + pFunction(pBucketGroup,pBucketData); + } + } + /* For next bucket start with first entry */ + nStart = 0; + } +} + +/* Check if a given (lopc,hipc) are valid for a linkonce. + We pass in the linkonce (instead of + referencing the global pLinkonceInfo) as that means + searches for pLinkonceInfo find all the uses, + making understanding of the code a tiny bit easier. + The section name created is supposed to be the appropriate + linkonce section name. +*/ +Dwarf_Bool IsValidInLinkonce(Bucket_Group *pLo, + const char *name,Dwarf_Addr lopc,Dwarf_Addr hipc) +{ +#define SECTION_NAME_LEN 2048 /* Guessing a sensible length */ + static char section_name[SECTION_NAME_LEN]; + Bucket_Data *pBucketData = 0; + /* Since text is quite uniformly just this name, no need to get it + from elsewhere, though it will not work for non-elf. */ + const char *lo_text = ".text."; + + /* Build the name that represents the linkonce section (.text). + This is not defined in DWARF so not correct for all + compilers. */ + snprintf(section_name,sizeof(section_name),"%s%s",lo_text,name); + + pBucketData = FindNameInBucketGroup(pLo,section_name); + if (pBucketData) { + if (lopc >= pBucketData->low && lopc <= pBucketData->high) { + if (hipc >= pBucketData->low && hipc <= pBucketData->high) { + return TRUE; + } + } + } + return FALSE; +} + diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/checkutil.h b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/checkutil.h new file mode 100644 index 0000000..70961cb --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/checkutil.h @@ -0,0 +1,98 @@ +/* + Copyright (C) 2011 SN Systems Ltd. All Rights Reserved. + Portions Copyright (C) 2011 David Anderson. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it would be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Further, this software is distributed without any warranty that it is + free of the rightful claim of any third person regarding infringement + or the like. Any license provided herein, whether implied or + otherwise, applies only to this software file. Patent licenses, if + any, provided herein do not apply to combinations of this program with + other software, or any other product whatsoever. + + You should have received a copy of the GNU General Public License along + with this program; if not, write the Free Software Foundation, Inc., 51 + Franklin Street - Fifth Floor, Boston MA 02110-1301, USA. + +*/ + +#ifndef CHECKUTIL_H +#define CHECKUTIL_H + +/* Map information. + Depending on the specific functions used various + fields here are either used or ignored. + +*/ +typedef struct { + Dwarf_Bool bFlag; /* General flag */ + const char *name; /* Generic name */ + Dwarf_Addr key; /* Used for binary search, the key + is either a pc address or a DIE offset + depending on which bucket table is in use. */ + Dwarf_Addr base; /* Used for base address */ + Dwarf_Addr low; /* Used for Low PC */ + Dwarf_Addr high; /* Used for High PC */ +} Bucket_Data; + +/* This groups Bucket_Data records into + a 'bucket' so that a single malloc creates + BUCKET_SIZE entries. The intent is to reduce + overhead (as compared to having next/previous + pointers in each Bucket_Data and mallocing + each Bucket_Data individually. +*/ + +#define BUCKET_SIZE 2040 +typedef struct bucket { + int nEntries; + Bucket_Data Entries[BUCKET_SIZE]; + struct bucket *pNext; +} Bucket; + +/* This Forms the head record of a list of Buckets. +*/ +typedef struct { + int kind; /* Kind of bucket */ + Dwarf_Addr lower; /* Lower value for data */ + Dwarf_Addr upper; /* Upper value for data */ + Bucket_Data *pFirst; /* First sentinel */ + Bucket_Data *pLast; /* Last sentinel */ + Bucket *pHead; /* First bucket in set */ + Bucket *pTail; /* Last bucket in set */ +} Bucket_Group; + +Bucket_Group *AllocateBucketGroup(int kind); +void ReleaseBucketGroup(Bucket_Group *pBucketGroup); +void ResetBucketGroup(Bucket_Group *pBucketGroup); +void ResetSentinelBucketGroup(Bucket_Group *pBucketGroup); + +void PrintBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Bool bFull); + +void AddEntryIntoBucketGroup(Bucket_Group *pBucketGroup, + Dwarf_Addr key,Dwarf_Addr base,Dwarf_Addr low,Dwarf_Addr high, + const char *name, Dwarf_Bool bFlag); + +Dwarf_Bool DeleteKeyInBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr key); + +Dwarf_Bool FindAddressInBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr address); +Bucket_Data *FindDataInBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr key); +Bucket_Data *FindKeyInBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr key); +Bucket_Data *FindNameInBucketGroup(Bucket_Group *pBucketGroup,char *name); + +Dwarf_Bool IsValidInBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr pc); + +void ResetLimitsBucketSet(Bucket_Group *pBucketGroup); +void SetLimitsBucketGroup(Bucket_Group *pBucketGroup,Dwarf_Addr lower,Dwarf_Addr upper); +Dwarf_Bool IsValidInLinkonce(Bucket_Group *pLo, + const char *name,Dwarf_Addr lopc,Dwarf_Addr hipc); + + +#endif /* CHECKUTIL_H */ diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/common.c b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/common.c new file mode 100644 index 0000000..7023fca --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/common.c @@ -0,0 +1,92 @@ +/* + Copyright (C) 2008-2010 SN Systems. All Rights Reserved. + Portions Copyright (C) 2008-2017 David Anderson. All Rights Reserved. + Portions Copyright (C) 2011-2012 SN Systems Ltd. . All Rights Reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it would be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Further, this software is distributed without any warranty that it is + free of the rightful claim of any third person regarding infringement + or the like. Any license provided herein, whether implied or + otherwise, applies only to this software file. Patent licenses, if + any, provided herein do not apply to combinations of this program with + other software, or any other product whatsoever. + + You should have received a copy of the GNU General Public License along + with this program; if not, write the Free Software Foundation, Inc., 51 + Franklin Street - Fifth Floor, Boston MA 02110-1301, USA. +*/ + +/* These do little except on Windows */ + +#include "common.h" +#include "config.h" +#include "globals.h" +#include "warningcontrol.h" +#include +/* Windows specific header files */ +#ifdef HAVE_STDAFX_H +#include "stdafx.h" +#endif /* HAVE_STDAFX_H */ + +#define DW_VERSION_DATE_STR " 2017-10-13 19:09:46-07:00 " +#define RELEASE_DATE "20160307" + +/* The Linux/Unix version does not want a version string to print + unless -V is on the command line. */ +void +print_version_details(UNUSEDARG const char * name,int alwaysprint) +{ +#ifdef _WIN32 +#ifdef _DEBUG + char *acType = "Debug"; +#else + char *acType = "Release"; +#endif /* _DEBUG */ +#ifdef _WIN64 + char *bits = "64"; +#else + char *bits = "32"; +#endif /* _WIN64 */ + static char acVersion[64]; + snprintf(acVersion,sizeof(acVersion), + "[%s %s %s Win%s (%s)]",__DATE__,__TIME__,acType,bits,RELEASE_DATE); + printf("%s %s\n",sanitized(name),acVersion); +#else /* !_WIN32 */ + if (alwaysprint) { + printf("%s\n",DW_VERSION_DATE_STR); + } +#endif /* _WIN32 */ +} + + +void +print_args(UNUSEDARG int argc, UNUSEDARG char *argv[]) +{ +#ifdef _WIN32 + int index = 1; + printf("Arguments: "); + for (index = 1; index < argc; ++index) { + printf("%s ",sanitized(argv[index])); + } + printf("\n"); +#endif /* _WIN32 */ +} + +void +print_usage_message(const char *program_name_in, const char **text) +{ + unsigned i = 0; +#ifndef _WIN32 + fprintf(stderr,"Usage: %s \n", program_name_in); +#endif /* _WIN32 */ + for (i = 0; *text[i]; ++i) { + fprintf(stderr,"%s\n", text[i]); + } +} diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/common.h b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/common.h new file mode 100644 index 0000000..a80f389 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/common.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2009-2010 SN Systems. All Rights Reserved. + Portions Copyright (C) 2009-2010 David Anderson. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it would be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Further, this software is distributed without any warranty that it is + free of the rightful claim of any third person regarding infringement + or the like. Any license provided herein, whether implied or + otherwise, applies only to this software file. Patent licenses, if + any, provided herein do not apply to combinations of this program with + other software, or any other product whatsoever. + + You should have received a copy of the GNU General Public License along + with this program; if not, write the Free Software Foundation, Inc., 51 + Franklin Street - Fifth Floor, Boston MA 02110-1301, USA. +*/ + +#ifndef COMMON_INCLUDED_H +#define COMMON_INCLUDED_H + +void print_args(int argc, char *argv[]); +void print_version_details(const char *name, int alwaysprint); +void print_usage_message(const char *program_name, const char **text); + +#endif /* COMMON_INCLUDED_H */ diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/config.h.in b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/config.h.in new file mode 100644 index 0000000..ace9840 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/config.h.in @@ -0,0 +1,103 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if the elf64_getehdr function is in libelf.a. */ +#undef HAVE_ELF64_GETEHDR + +/* Define to 1 if the Elf64_Rel structure has r_info field. */ +#undef HAVE_ELF64_R_INFO + +/* Define to 1 if you have the header file. */ +#undef HAVE_ELF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBELF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBELF_LIBELF_H + +/* Define 1 if off64 is defined via libelf with GNU_SOURCE. */ +#undef HAVE_LIBELF_OFF64_OK + +/* Define to header that first defines elf. */ +#undef HAVE_LOCATION_OF_LIBELFHEADER + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define 1 if need nonstandard printf format for 64bit */ +#undef HAVE_NONSTANDARD_PRINTF_64_FORMAT + +/* Define 1 if plain libelf builds. */ +#undef HAVE_RAW_LIBELF_OK + +/* Define 1 if regex seems to be defined */ +#undef HAVE_REGEX + +/* Define to 1 if you have the header file. */ +#undef HAVE_SGIDEFS_H + +/* Define 1 if we have the Windows specific header stdafx.h */ +#undef HAVE_STDAFX_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define 1 if __attribute__ ((unused)) compiles ok. */ +#undef HAVE_UNUSED_ATTRIBUTE + +/* Define 1 if zlib (decompression library) seems available. */ +#undef HAVE_ZLIB + +/* See if __uint32_t is predefined in the compiler. */ +#undef HAVE___UINT32_T + +/* Define 1 if sys/types.h defines __uint32_t. */ +#undef HAVE___UINT32_T_IN_SYS_TYPES_H + +/* See if __uint64_t is predefined in the compiler. */ +#undef HAVE___UINT64_T + +/* Define 1 if sys/types.h defines __uint64_t. */ +#undef HAVE___UINT64_T_IN_SYS_TYPES_H + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/config.h.in.cmake b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/config.h.in.cmake new file mode 100644 index 0000000..a8fcce4 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/config.h.in.cmake @@ -0,0 +1,109 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if the elf32_getehdr function is in libelf.a. */ +#cmakedefine HAVE_ELF32_GETEHDR 1 + +/* Define to 1 if the elf64_getehdr function is in libelf.a. */ +#cmakedefine HAVE_ELF64_GETEHDR 1 + +/* Define to 1 if the Elf64_Rel structure has r_info field. */ +#cmakedefine HAVE_ELF64_R_INFO 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ELF_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LIBELF_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LIBELF_LIBELF_H 1 + +/* Define 1 if off64 is defined via libelf with GNU_SOURCE. */ +#cmakedefine HAVE_LIBELF_OFF64_OK 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H 1 + +/* Define 1 if need nonstandard printf format for 64bit */ +#cmakedefine HAVE_NONSTANDARD_PRINTF_64_FORMAT 1 + +/* Define 1 if plain libelf builds. */ +#cmakedefine HAVE_RAW_LIBELF_OK 1 + +/* Define 1 if regex seems to be defined */ +#cmakedefine HAVE_REGEX 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SGIDEFS_H 1 + +/* Define 1 if we have the Windows specific header stdafx.h */ +#cmakedefine HAVE_STDAFX_H 1 + +/* Define 1 if we have the Windows header Windows.h */ +#cmakedefine HAVE_WINDOWS_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H 1 + +/* Define 1 if __attribute__ ((unused)) compiles ok. */ +#cmakedefine HAVE_UNUSED_ATTRIBUTE 1 + +/* Define 1 if zlib (decompression library) seems available. */ +#cmakedefine HAVE_ZLIB 1 + +/* See if __uint32_t is predefined in the compiler. */ +#cmakedefine HAVE___UINT32_T 1 + +/* Define 1 if sys/types.h defines __uint32_t. */ +#cmakedefine HAVE___UINT32_T_IN_SYS_TYPES_H 1 + +/* See if __uint64_t is predefined in the compiler. */ +#cmakedefine HAVE___UINT64_T 1 + +/* Define 1 if sys/types.h defines __uint64_t. */ +#cmakedefine HAVE___UINT64_T_IN_SYS_TYPES_H 1 + +/* Define to header that first defines elf. */ +#cmakedefine LOCATION_OF_LIBELFHEADER @LOCATION_OF_LIBELFHEADER@ + +/* Define to the address where bug reports for this package should be sent. */ +#cmakedefine PACKAGE_BUGREPORT @PACKAGE_BUGREPORT@ + +/* Define to the full name of this package. */ +#cmakedefine PACKAGE_NAME @PACKAGE_NAME@ + +/* Define to the full name and version of this package. */ +#cmakedefine PACKAGE_STRING @PACKAGE_STRING@ + +/* Define to the one symbol short name of this package. */ +#cmakedefine PACKAGE_TARNAME @PACKAGE_TARNAME@ + +/* Define to the home page for this package. */ +#cmakedefine PACKAGE_URL @PACKAGE_URL@ + +/* Define to the version of this package. */ +#cmakedefine PACKAGE_VERSION @PACKAGE_VERSION@ + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine STDC_HEADERS 1 diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/configure b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/configure new file mode 100755 index 0000000..d3add1a --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/configure @@ -0,0 +1,5271 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="dwarfdump.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +LIBOBJS +dwfzlib +dwfsanitize +dwfwall +build_nonshared +AR +RANLIB +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_shared +enable_nonshared +enable_wall +enable_sanitize +enable_nonstandardprintf +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-shared build shared library libdwarf.so and use it if + present + --disable-nonshared do not build archive library libdwarf.a + --enable-wall Add -Wall (default is none) + --enable-sanitize Add -fsanitize (default is not to) + --enable-nonstandardprintf + Use a special printf format for 64bit (default is + NO) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_config_headers="$ac_config_headers config.h" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +if test $ac_cv_c_compiler_gnu = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } +if ${ac_cv_prog_gcc_traditional+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in elf.h unistd.h libelf.h libelf/libelf.h sgidefs.h sys/types.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where is basic elf data" >&5 +$as_echo_n "checking where is basic elf data... " >&6; } +if test "$ac_cv_header_elf_h" = yes; then + +$as_echo "#define HAVE_LOCATION_OF_LIBELFHEADER " >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } +elif test "$ac_cv_header_libelf_h" = yes; then + +$as_echo "#define HAVE_LOCATION_OF_LIBELFHEADER " >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } +elif test "$ac_cv_header_libelf_libelf_h" = yes; then + +$as_echo "#define HAVE_LOCATION_OF_LIBELFHEADER " >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: NO standard ELF HEADERS found" >&5 +$as_echo "NO standard ELF HEADERS found" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf64_getehdr in -lelf" >&5 +$as_echo_n "checking for elf64_getehdr in -lelf... " >&6; } +if ${ac_cv_lib_elf_elf64_getehdr+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lelf $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char elf64_getehdr (); +int +main () +{ +return elf64_getehdr (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_elf_elf64_getehdr=yes +else + ac_cv_lib_elf_elf64_getehdr=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_elf64_getehdr" >&5 +$as_echo "$ac_cv_lib_elf_elf64_getehdr" >&6; } +if test "x$ac_cv_lib_elf_elf64_getehdr" = xyes; then : + +$as_echo "#define HAVE_ELF64_GETEHDR 1" >>confdefs.h + +fi + + +shrd='' +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; +fi + +if test "x$enable_shared" = "xyes"; then : + + shrd='--enable-shared' +fi + +nonshrd='' +build_nonshared=none.a + +# Check whether --enable-nonshared was given. +if test "${enable_nonshared+set}" = set; then : + enableval=$enable_nonshared; +fi + +if test "x$enable_nonshared" = "xno"; then : + + nonshrd='--disable-shared' + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compile with -Wall" >&5 +$as_echo_n "checking compile with -Wall... " >&6; } + +# Check whether --enable-wall was given. +if test "${enable_wall+set}" = set; then : + enableval=$enable_wall; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + dwfwall="-Wall -O0 -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wextra -Wcomment -Wformat -Wpedantic -Wuninitialized -Wno-long-long -Wshadow" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build -fsanitize-address" >&5 +$as_echo_n "checking build -fsanitize-address... " >&6; } +# Check whether --enable-sanitize was given. +if test "${enable_sanitize+set}" = set; then : + enableval=$enable_sanitize; dwfsanitize="-fsanitize=address -fsanitize=leak -fsanitize=undefined" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + +fi + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "stdafx.h" +int +main () +{ + int p; p = 27; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE_STDAFX_H 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include HAVE_LOCATION_OF_LIBELFHEADER +int +main () +{ +Elf64_Rel *p; int i; i = p->r_info; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE_ELF64_R_INFO 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +__uint32_t p; p = 3; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE___UINT32_T 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +__uint64_t p; p = 3; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE___UINT64_T 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + __uint32_t p; p = 3; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE___UINT32_T_IN_SYS_TYPES_H 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + __uint64_t p; p = 3; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE___UINT64_T_IN_SYS_TYPES_H 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ + int i; + regex_t r; + int cflags = REG_EXTENDED; + const char *s = "abc"; + i = regcomp(&r,s,cflags); + regfree(&r); + ; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE_REGEX 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking checking if __attribute__ unused compiles ok" >&5 +$as_echo_n "checking checking if __attribute__ unused compiles ok... " >&6; } +if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + static unsigned foo( unsigned x, __attribute__ ((unused)) int y) + { unsigned x2 = x + 1; + return x2; + } + int main(void) { + unsigned y = 0; + y = foo(12,y); + return 0; + } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +$as_echo "#define HAVE_UNUSED_ATTRIBUTE 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking checking zlib present " >&5 +$as_echo_n "checking checking zlib present ... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "zlib.h" +int +main () +{ + + Bytef dest[100]; + uLongf destlen = 100; + Bytef *src = 0; + uLong srclen = 3; + int res = uncompress(dest,&destlen,src,srclen); + if (res == Z_OK) { + /* ALL IS WELL */ + } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE_ZLIB 1" >>confdefs.h + + dwfzlib=-lz + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +# Check whether --enable-nonstandardprintf was given. +if test "${enable_nonstandardprintf+set}" = set; then : + enableval=$enable_nonstandardprintf; +$as_echo "#define HAVE_NONSTANDARD_PRINTF_64_FORMAT 1" >>confdefs.h + +fi + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ + int p; p = 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE_RAW_LIBELF_OK 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking is off64_t type supported" >&5 +$as_echo_n "checking is off64_t type supported... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _GNU_SOURCE +#include + +int +main () +{ + off64_t p; p = 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +$as_echo "#define HAVE_LIBELF_OFF64_OK 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/configure.cmake b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/configure.cmake new file mode 100644 index 0000000..40a236b --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/configure.cmake @@ -0,0 +1,134 @@ +include(AutoconfHelper) + +ac_init() +ac_check_headers(elf.h libelf.h libelf/libelf.h sgidefs.h sys/types.h stdafx.h Windows.h) +ac_check_lib(${LIBELF_LIBRARIES} elf elf32_getehdr) +ac_check_lib(${LIBELF_LIBRARIES} elf elf64_getehdr) + +# Find out where the elf header is. +if(HAVE_ELF_H) + set(HAVE_LOCATION_OF_LIBELFHEADER "") +elseif(HAVE_LIBELF_H) + set(HAVE_LOCATION_OF_LIBELFHEADER "") +elseif(HAVE_LIBELF_LIBELF_H) + set(HAVE_LOCATION_OF_LIBELFHEADER "") +endif() + +ac_try_compile(" +#include ${HAVE_LOCATION_OF_LIBELFHEADER} +int main() +{ + Elf64_Rel *p; int i; i = p->r_info; + return 0; +}" +HAVE_ELF64_R_INFO) + +ac_try_compile(" +int main() +{ + __uint32_t p; + p = 3; + return 0; +}" +HAVE___UINT32_T) + +ac_try_compile(" +int main() +{ + __uint64_t p; + p = 3; + return 0; +}" +HAVE___UINT64_T) + +ac_try_compile(" +#include +int main() +{ + __uint32_t p; + p = 3; + return 0; +}" +HAVE___UINT32_T_IN_SYS_TYPES_H) + +ac_try_compile(" +#include +int main() +{ + __uint64_t p; + p = 3; + return 0; +}" +HAVE___UINT64_T_IN_SYS_TYPES_H) + +ac_try_compile([=[ +#include +#include +int main() +{ + int i; + regex_t r; + int cflags = REG_EXTENDED; + const char *s = "abc"; + i = regcomp(&r,s,cflags); + regfree(&r); + return 0; +}]=] +HAVE_REGEX) + +ac_try_compile(" +static unsigned foo( unsigned x, __attribute__ ((unused)) int y) +{ + unsigned x2 = x + 1; + return x2; +} + +int main(void) { + unsigned y = 0; + y = foo(12,y); + return 0; +}" +HAVE_UNUSED_ATTRIBUTE) +message("Checking if __attribute__ unused compiles ok... ${HAVE_UNUSED_ATTRIBUTE}") + +ac_try_compile([=[ +#include "zlib.h" +int main() +{ + Bytef dest[100]; + uLongf destlen = 100; + Bytef *src = 0; + uLong srclen = 3; + int res = uncompress(dest,&destlen,src,srclen); + if (res == Z_OK) { + /* ALL IS WELL */ + } + return 0; +}]=] +HAVE_ZLIB) +message(STATUS "Checking zlib.h usability... ${HAVE_ZLIB}") +if(HAVE_ZLIB) + set(dwfzlib "z") +endif() + +ac_try_compile(" +#include +int main() +{ + int p; p = 0; + return 0; +}" +HAVE_RAW_LIBELF_OK) + +ac_try_compile(" +#define _GNU_SOURCE +#include +int main() +{ + off64_t p; p = 0; + return 0; +}" +HAVE_LIBELF_OFF64_OK) +message(STATUS "Checking is off64_t type supported... ${HAVE_LIBELF_OFF64_OK}") + +configure_file(config.h.in.cmake config.h) diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/configure.in b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/configure.in new file mode 100644 index 0000000..405fb88 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/configure.in @@ -0,0 +1,168 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(dwarfdump.c) +AC_CONFIG_HEADER(config.h) + +AC_PROG_CC +AC_GCC_TRADITIONAL +AC_PROG_INSTALL +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(AR, ar) +dnl AC_ARFLAGS + +AC_CHECK_HEADERS(elf.h unistd.h libelf.h libelf/libelf.h sgidefs.h sys/types.h) + +dnl Windows seems to have libelf.h with the normal elf.h +dnl data embedded. No literal elf.h is present. +dnl Get a best estimate of elf header data location. +AC_MSG_CHECKING(where is basic elf data) +if test "$ac_cv_header_elf_h" = yes; then + AC_DEFINE(HAVE_LOCATION_OF_LIBELFHEADER,[], [Define to header that first defines elf]) + AC_MSG_RESULT() +elif test "$ac_cv_header_libelf_h" = yes; then + AC_DEFINE(HAVE_LOCATION_OF_LIBELFHEADER, [], + [Define to header that first defines elf.]) + AC_MSG_RESULT() +elif test "$ac_cv_header_libelf_libelf_h" = yes; then + AC_DEFINE(HAVE_LOCATION_OF_LIBELFHEADER,[], + [Define to header that first defines elf.]) + AC_MSG_RESULT() +else + AC_MSG_RESULT(NO standard ELF HEADERS found) +fi + +AC_CHECK_LIB(elf,elf64_getehdr, + AC_DEFINE(HAVE_ELF64_GETEHDR,1, + [Define to 1 if the elf64_getehdr function is in libelf.a.])) + +dnl default-disabled shared +dnl we allow the argument but the result is ignored. +shrd='' +AC_ARG_ENABLE(shared,AC_HELP_STRING([--enable-shared], + [build shared library libdwarf.so and use it if present])) +AS_IF([ test "x$enable_shared" = "xyes"], [ + shrd='--enable-shared']) + +nonshrd='' +dnl default-enabled nonshared +dnl we allow the argument but the result is ignored. +AC_SUBST(build_nonshared,[none.a]) +AC_ARG_ENABLE(nonshared,AC_HELP_STRING([--disable-nonshared], + [do not build archive library libdwarf.a])) +AS_IF([ test "x$enable_nonshared" = "xno"], [ + nonshrd='--disable-shared' +]) + + +dnl This adds compiler options for gcc to get as complete +dnl diagnostics as seems to make sense (subject to change...). +AC_MSG_CHECKING(compile with -Wall) +AC_SUBST(dwfwall,[]) +AC_ARG_ENABLE(wall,AC_HELP_STRING([--enable-wall], + [Add -Wall (default is none)]), + [ AC_MSG_RESULT(yes) + AC_SUBST(dwfwall,["-Wall -O0 -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wextra -Wcomment -Wformat -Wpedantic -Wuninitialized -Wno-long-long -Wshadow"]) ], + [ AC_SUBST(dwfwall,[]) + AC_MSG_RESULT(no) ]) + +dnl This adds compiler option -fsanitize=address etc (gcc compiler run-time checks)) +AC_SUBST(dwfsanitize,[]) +AC_MSG_CHECKING(build -fsanitize-address) +AC_ARG_ENABLE(sanitize,AC_HELP_STRING([--enable-sanitize], + [Add -fsanitize (default is not to)]), + [ AC_SUBST(dwfsanitize,["-fsanitize=address -fsanitize=leak -fsanitize=undefined"]) + AC_MSG_RESULT(yes) ], + [ AC_SUBST(dwfsanitize,[]) + AC_MSG_RESULT(no) + ] + ) + +AC_TRY_COMPILE([#include "stdafx.h"],[ int p; p = 27;] , + AC_DEFINE(HAVE_STDAFX_H,1, + [Define 1 if we have the Windows specific header stdafx.h])) + +AC_TRY_COMPILE([#include HAVE_LOCATION_OF_LIBELFHEADER], Elf64_Rel *p; int i; i = p->r_info; ,AC_DEFINE(HAVE_ELF64_R_INFO,1, + [Define to 1 if the Elf64_Rel structure has r_info field.])) +AC_TRY_COMPILE([], __uint32_t p; p = 3; ,AC_DEFINE(HAVE___UINT32_T, + 1,[See if __uint32_t is predefined in the compiler. ])) +AC_TRY_COMPILE([], __uint64_t p; p = 3; ,AC_DEFINE(HAVE___UINT64_T, + 1,[See if __uint64_t is predefined in the compiler. ])) +AC_TRY_COMPILE([#include ],[ __uint32_t p; p = 3;] , + AC_DEFINE(HAVE___UINT32_T_IN_SYS_TYPES_H,1, + [Define 1 if sys/types.h defines __uint32_t.])) +AC_TRY_COMPILE([#include ],[ __uint64_t p; p = 3;] , + AC_DEFINE(HAVE___UINT64_T_IN_SYS_TYPES_H,1, + [Define 1 if sys/types.h defines __uint64_t.])) + +AC_TRY_COMPILE([#include + #include ],[ int i; + regex_t r; + int cflags = REG_EXTENDED; + const char *s = "abc"; + i = regcomp(&r,s,cflags); + regfree(&r); + ]; , + AC_DEFINE(HAVE_REGEX,1, + [Define 1 if regex seems to be defined])) + +AC_MSG_CHECKING(checking if __attribute__ unused compiles ok) +AC_TRY_RUN([ + static unsigned foo( unsigned x, __attribute__ ((unused)) int y) + { unsigned x2 = x + 1; + return x2; + } + int main(void) { + unsigned y = 0; + y = foo(12,y); + return 0; + } +] , + [AC_DEFINE(HAVE_UNUSED_ATTRIBUTE,1, + [Define 1 if __attribute__ ((unused)) compiles ok.]) + AC_MSG_RESULT(yes) ], + [AC_MSG_RESULT(no) ]) + +AC_SUBST(dwfzlib,[]) +AC_MSG_CHECKING(checking zlib present ) +AC_TRY_COMPILE([#include "zlib.h"],[ + Bytef dest[100]; + uLongf destlen = 100; + Bytef *src = 0; + uLong srclen = 3; + int res = uncompress(dest,&destlen,src,srclen); + if (res == Z_OK) { + /* ALL IS WELL */ + } + ] , + [AC_DEFINE(HAVE_ZLIB,1, + [Define 1 if zlib (decompression library) seems available.]) + AC_SUBST(dwfzlib,[-lz]) + AC_MSG_RESULT(yes) + ], + [AC_MSG_RESULT(no)]) + + +dnl this is ignored in dwarfdump. +AC_ARG_ENABLE(nonstandardprintf,AC_HELP_STRING([--enable-nonstandardprintf], + [Use a special printf format for 64bit (default is NO)]), + [ AC_DEFINE([HAVE_NONSTANDARD_PRINTF_64_FORMAT],[1], + [Define 1 if need nonstandard printf format for 64bit] )], + [ ]) + +AC_TRY_COMPILE([ +#include +],[ int p; p = 0; ] , + AC_DEFINE(HAVE_RAW_LIBELF_OK,1, + [Define 1 if plain libelf builds.])) + +AC_MSG_CHECKING(is off64_t type supported) +AC_TRY_COMPILE([ +#define _GNU_SOURCE +#include +],[ off64_t p; p = 0;] , + [AC_DEFINE(HAVE_LIBELF_OFF64_OK,1, + [Define 1 if off64 is defined via libelf with GNU_SOURCE.]) + AC_MSG_RESULT(yes)], + [ AC_MSG_RESULT(no) ]) + + +AC_OUTPUT(Makefile) diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarf_tsearch.h b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarf_tsearch.h new file mode 100644 index 0000000..c1665b4 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarf_tsearch.h @@ -0,0 +1,111 @@ +/* Copyright (c) 2013, David Anderson +All rights reserved. + +Redistribution and use in source and binary forms, with +or without modification, are permitted provided that the +following conditions are met: + + Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +/* The following interfaces follow tsearch (See the Single + Unix Specification) but the implementation is + written without reference to the source code + of any version of tsearch. Only uses + of tsearch were examined, not tsearch source code. + + See http://reality.sgiweb.org/davea/tsearch.html + for information about tsearch. + + We are matching the standard functional + interface here, but to avoid interfering with + libc implementations or code using libc + implementations, we change all the names. + +*/ + +/* The DW_VISIT values passed back to you through + the callback function in dwarf_twalk(); +*/ +typedef enum +{ + dwarf_preorder, + dwarf_postorder, + dwarf_endorder, + dwarf_leaf +} +DW_VISIT; + +/* void * return values are actually + void **key so you must dereference these + once to get a key you passed in. + +*/ + + +void *dwarf_tsearch(const void * /*key*/, void ** /*rootp*/, + int (* /*compar*/)(const void *, const void *)); + +void *dwarf_tfind(const void * /*key*/, void *const * /*rootp*/, + int (* /*compar*/)(const void *, const void *)); + +/* + dwarf_tdelete() returns NULL if it cannot delete anything + or if the tree is now empty (if empty, *rootp + is set NULL by dwarf_tdelete()). + If the delete succeeds and the tree is non-empty returns + a pointer to the parent node of the deleted item, + unless the deleted item was at the root, in which + case the returned pointer relates to the new root. +*/ +void *dwarf_tdelete(const void * /*key*/, void ** /*rootp*/, + int (* /*compar*/)(const void *, const void *)); + +void dwarf_twalk(const void * /*root*/, + void (* /*action*/)(const void * /*nodep*/, + const DW_VISIT /*which*/, + const int /*depth*/)); + +/* dwarf_tdestroy() cannot set the root pointer NULL, you must do + so on return from dwarf_tdestroy(). */ +void dwarf_tdestroy(void * /*root*/, + void (* /*free_node*/)(void * /*nodep*/)); + + +/* Prints a simple tree representation to stdout. For debugging. +*/ +void dwarf_tdump(const void*root, + char *(* /*keyprint*/)(const void *), + const char *msg); + +/* Returns NULL and does nothing + unless the implemenation used uses a hash tree. */ +void * dwarf_initialize_search_hash( void **treeptr, + unsigned long(*hashfunc)(const void *key), + unsigned long size_estimate); + + + + diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarf_tsearchbal.c b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarf_tsearchbal.c new file mode 100644 index 0000000..6924052 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarf_tsearchbal.c @@ -0,0 +1,1003 @@ +/* Copyright (c) 2013-2017, David Anderson +All rights reserved. + +Redistribution and use in source and binary forms, with +or without modification, are permitted provided that the +following conditions are met: + + Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + + +/* The interfaces follow tsearch (See the Single + Unix Specification) but the implementation is + written without reference to the source of any + version of tsearch. + + See http://www.prevanders.net/tsearch.html + for information and an example of use. + + Based on Knuth, chapter 6.2.2 + And based on chapter 6.2.3 Balanced Trees (sometimes + call AVL trees) Algorithm A and the sketch on deletion. + + The wikipedia page on AVL trees is also quite useful. + + A Key equation is: + bal-factor-node-k = + height-left-subtree - height-right-subtree + We don't know the absolute height, but we do know the + balance factor of the pointed-to subtrees (-1,0, or 1). + And we always know if we are adding or deleting a node. + + +*/ + + + +#include "config.h" +#include "dwarf_incl.h" +#include "stdlib.h" /* for free() */ +#include /* for printf */ +#include "dwarf_tsearch.h" + +#define IMPLEMENTD15 1 + +#ifdef DW_CHECK_CONSISTENCY +struct ts_entry; +void dwarf_check_balance(struct ts_entry *head,int finalprefix); +#endif + +/* head is a special link. rlink points to root node. + head-> llink is a tree depth value. Using a pointer. + root = head->rlink. + The keypointer and balance fields of the head node + are not used. + Might be sensible to use the head + balance field as a tree depth instead of using llink. +*/ + +struct ts_entry { + /* Keyptr points to a pointer to a record the user saved, the + user record contains the user's key itself + and perhaps more. */ + const void *keyptr; + int balance; /* Knuth 6.2.3 algorithm A */ + struct ts_entry * llink; + struct ts_entry * rlink; +}; + +static void printlevel(int level) +{ + int len = 0; + int targetlen = 4 + level; + int shownlen = 0; + char number[10]; + len = snprintf(number,sizeof(number),"<%d>",level); + printf("%s",number); + shownlen = len; + while(shownlen < targetlen) { + putchar(' '); + ++shownlen; + } +} + +/* Not needed for this set of functions. */ +void * +dwarf_initialize_search_hash( void **treeptr, + UNUSEDARG unsigned long(*hashfunc)(const void *key), + UNUSEDARG unsigned long size_estimate) +{ + return *treeptr; +} + +/* For debugging, mainly. + We print the tree with the head node unnumbered + and the root node called level 0. + In Knuth algorithms where we have p[k] when + k is zero k refers to the head node. Handy + as then the root node is not special at all. + But here it just looks better as shown, perhaps. + + The ordering here is so that if you turned an output + page with the left side at the top + then the tree sort of just shows up nicely in + what most think of as a normal way. +*/ +static void +tdump_inner(struct ts_entry *t, + char *(keyprint)(const void *), + const char *descr, int level) +{ + char * keyv = ""; + if(!t) { + return; + } + tdump_inner(t->rlink,keyprint,"right",level+1); + + printlevel(level); + if(t->keyptr) { + keyv = keyprint(t->keyptr); + } + printf("0x%08lx <%s %s> %s\n", + (unsigned long)t, + (unsigned long)t->keyptr, + t->keyptr?"key ":"null", + keyv, + t->balance, + (unsigned long)t->llink,(unsigned long)t->rlink, + descr); + tdump_inner(t->llink,keyprint,"left ",level+1); +} +#ifdef DW_CHECK_CONSISTENCY +/* Checking that a tree (or sub tree) is in balance. + Only meaningful for balanced trees. + Returns the depth. +*/ +int +dwarf_check_balance_inner(struct ts_entry *t,int level,int maxdepth,int *founderror,const char *prefix) +{ + int l = 0; + int r = 0; + if(level > maxdepth) { + printf("%s Likely internal erroneous link loop, got to depth %d.\n", + prefix,level); + exit(1); + } + if(!t) { + return 0; + } + if(!t->llink && !t->rlink) { + if (t->balance != 0) { + printf("%s: Balance at 0x%lx should be 0 is %d.\n", + prefix,(unsigned long)t,t->balance); + (*founderror)++; + } + return 1; + } + l = dwarf_check_balance_inner(t->llink,level+1,maxdepth,founderror,prefix); + r = dwarf_check_balance_inner(t->rlink,level+1,maxdepth,founderror,prefix); + if (l ==r && t->balance != 0) { + printf("%s Balance at 0x%lx d should be 0 is %d.\n", + prefix,(unsigned long)t,t->balance); + (*founderror)++; + return l+1; + } + if(l > r) { + if( (l-r) != 1) { + printf("%s depth mismatch at 0x%lx l %d r %d.\n", + prefix,(unsigned long)t,l,r); + (*founderror)++; + } + if (t->balance != -1) { + printf("%s Balance at 0x%lx should be -1 is %d.\n", + prefix,(unsigned long)t,t->balance); + (*founderror)++; + } + return l+1; + } + if(r != l) { + if( (r-l) != 1) { + printf("%s depth mismatch at 0x%lx r %d l %d.\n", + prefix,(unsigned long)t,r,l); + (*founderror)++; + } + if (t->balance != 1) { + printf("%s Balance at 0x%lx should be 1 is %d.\n", + prefix,(unsigned long)t,t->balance); + (*founderror)++; + } + } else { + if (t->balance != 0) { + printf("%s Balance at 0x%lx should be 0 is %d.\n", + prefix,(unsigned long)t,t->balance); + (*founderror)++; + } + } + return r+1; +} + +void +dwarf_check_balance(struct ts_entry *head,int finalprefix) +{ + const char *prefix = 0; + int maxdepth = 0; + int headdepth = 0; + int errcount = 0; + int depth = 0; + struct ts_entry*root = 0; + if(finalprefix) { + prefix = "BalanceError:"; + } else { + prefix = "BalanceWarn:"; + } + + if(!head) { + printf("%s check balance null tree ptr\n",prefix); + return; + } + root = head->rlink; + headdepth = head->llink - (struct ts_entry *)0; + if(!root) { + printf("%s check balance null tree ptr\n",prefix); + return; + } + + maxdepth = headdepth+10; + /* Counting in levels, not level number of top level. */ + headdepth++; + depth = dwarf_check_balance_inner(root,depth,maxdepth,&errcount,prefix); + if (depth != headdepth) { + printf("%s Head node says depth %d, it is really %d\n", + prefix, + headdepth,depth); + ++errcount; + } + if(errcount) { + printf("%s error count %d\n",prefix,errcount); + } + return; +} +#endif + +/* Dumping the tree to stdout. */ +void +dwarf_tdump(const void*headp_in, + char *(*keyprint)(const void *), + const char *msg) +{ + struct ts_entry *head = (struct ts_entry *)headp_in; + struct ts_entry *root = 0; + int headdepth = 0; + if(!head) { + printf("dumptree null tree ptr : %s\n",msg); + return; + } + headdepth = head->llink - (struct ts_entry *)0; + printf("dumptree head ptr : 0x%08lx tree-depth %d: %s\n", + (unsigned long)head, + headdepth, + msg); + root = head->rlink; + if(!root) { + printf("Empty tree\n"); + return; + } + tdump_inner(root,keyprint,"top",0); +} +static void +setlink(struct ts_entry*t,int a,struct ts_entry *x) +{ + if(a < 0) { + t->llink = x; + } else { + t->rlink = x; + } +} +static struct ts_entry* +getlink(struct ts_entry*t,int a) +{ + if(a < 0) { + return(t->llink); + } + return(t->rlink); +} + +static struct ts_entry * +allocate_ts_entry(const void *key) +{ + struct ts_entry *e = (struct ts_entry *) + malloc(sizeof(struct ts_entry)); + if(!e) { + return NULL; + } + e->keyptr = key; + e->balance = 0; + e->llink = 0; + e->rlink = 0; + return e; +} + +/* Knuth step T5, the insert. */ +static struct ts_entry * +tsearch_insert_k(const void *key,int kc, + struct ts_entry *p) +{ + struct ts_entry *q = allocate_ts_entry(key); + if (!q) { + /* out of memory */ + return NULL; + } + setlink(p,kc,q); + /* Non-NULL means inserted. */ + return q; +} + +/* Knuth step T5. */ +static struct ts_entry * +tsearch_inner_do_insert(const void *key, + int kc, + int * inserted, + struct ts_entry* p) +{ + struct ts_entry *q = 0; + q = tsearch_insert_k(key,kc,p); + if(q) { + *inserted = 1; + } + return q; +} + + +/* Algorithm A of Knuth 6.2.3, balanced tree. + key is pointer to a user data area containing the key + and possibly more. + + We could recurse on this routine, but instead we + iterate (like Knuth does, but using for(;;) instead + of go-to. + + */ +static struct ts_entry * +tsearch_inner( const void *key, struct ts_entry* head, + int (*compar)(const void *, const void *), + int*inserted, + UNUSEDARG struct ts_entry **nullme, + UNUSEDARG int * comparres) +{ + /* t points to parent of p */ + struct ts_entry *t = head; + /* p moves down tree, p starts as root. */ + struct ts_entry *p = head->rlink; + /* s points where rebalancing may be needed. */ + struct ts_entry *s = p; + struct ts_entry *r = 0; + struct ts_entry *q = 0; + + int a = 0; + int kc = 0; + for(;;) { + /* A2. */ + kc = compar(key,p->keyptr); + if(kc) { + /* A3 and A4 handled here. */ + q = getlink(p,kc); + if(!q) { + /* Does step A5. */ + q = tsearch_inner_do_insert(key,kc,inserted,p); + if (!q) { + /* Out of memory. */ + return q; + } + break; /* to A5. */ + } + if(q->balance) { + t = p; + s = q; + } + p = q; + continue; + } + /* K = KEY(P) in Knuth. */ + /* kc == 0, we found the entry we search for. */ + return p; + } + /* A5: work already done. */ + + /* A6: */ + { + /* Balance factors on nodes betwen S and Q need to be + changed from zero to +-1 */ + int kc2 = compar(key,s->keyptr); + if (kc2 < 0) { + a = -1; + } else { + a = 1; + } + r = p = getlink(s,a); + while (p != q) { + int kc3 = compar(key,p->keyptr); + if(kc3 < 0) { + p->balance = -1; + p = p->llink; + } else if (kc3 > 0) { + p->balance = 1; + p = p->rlink; + } else { + /* ASSERT: p == q */ + break; + } + } + } + + /* A7: */ + { + if(! s->balance) { + /* Tree has grown higher. */ + s->balance = a; + /* Counting in pointers, not integers. Ugh. */ + head->llink = head->llink + 1; + return q; + } + if(s->balance == -a) { + /* Tree is more balanced */ + s->balance = 0; + return q; + } + if (s->balance == a) { + /* Rebalance. */ + if(r->balance == a) { + /* single rotation, step A8. */ + p = r; + setlink(s,a,getlink(r,-a)); + setlink(r,-a,s); + s->balance = 0; + r->balance = 0; + } else if (r->balance == -a) { + /* double rotation, step A9. */ + p = getlink(r,-a); + setlink(r,-a,getlink(p,a)); + setlink(p,a,r); + setlink(s,a,getlink(p,-a)); + setlink(p,-a,s); + if(p->balance == a) { + s->balance = -a; + r->balance = 0; + } else if (p->balance == 0) { + s->balance = 0; + r->balance = 0; + } else if (p->balance == -a) { + s->balance = 0; + r->balance = a; + } + p->balance = 0; + } else { + fprintf(stderr,"Impossible balanced tree situation!\n"); + /* Impossible. Cannot be here. */ + exit(1); + } + } else { + fprintf(stderr,"Impossible balanced tree situation!!\n"); + /* Impossible. Cannot be here. */ + exit(1); + } + } + + /* A10: */ + if (s == t->rlink) { + t->rlink = p; + } else { + t->llink = p; + } +#ifdef DW_CHECK_CONSISTENCY + dwarf_check_balance(head,1); +#endif + return q; +} +/* Search and, if missing, insert. */ +void * +dwarf_tsearch(const void *key, void **headin, + int (*compar)(const void *, const void *)) +{ + struct ts_entry **headp = (struct ts_entry **)headin; + struct ts_entry *head = 0; + struct ts_entry *r = 0; + int inserted = 0; + /* kcomparv should be ignored */ + int kcomparv = 0; + /* nullme won't be set. */ + struct ts_entry *nullme = 0; + + if (!headp) { + return NULL; + } + head = *headp; + if (!head) { + struct ts_entry *root = 0; + head = allocate_ts_entry(0); + if(!head) { + return NULL; + } + root = allocate_ts_entry(key); + if(!root) { + free(head); + return NULL; + } + head->rlink = root; + /* head->llink is used for the depth, as a count */ + /* head points to the special head node ... */ + *headin = head; + return (void *)(&(root->keyptr)); + } + r = tsearch_inner(key,head,compar,&inserted,&nullme,&kcomparv); + if (!r) { + return NULL; + } + return (void *)&(r->keyptr); +} + + +/* Search without insert. */ +void * +dwarf_tfind(const void *key, void *const*rootp, + int (*compar)(const void *, const void *)) +{ + struct ts_entry **phead = (struct ts_entry **)rootp; + struct ts_entry *head = 0; + struct ts_entry *p = 0; + if (!phead) { + return NULL; + } + head = *phead; + if (!head) { + return NULL; + } + p = head->rlink; + while(p) { + int kc = compar(key,p->keyptr); + if(!kc) { + return (void *)(&(p->keyptr)); + } + p = getlink(p,kc); + } + return NULL; +} + + + + +/* Used for an array of records used in the deletion code. + k == 0 for the special head node which is never matched by + input. + k == 1 etc. +*/ +struct pkrecord { + struct ts_entry *pk; + int ak; /* Is -1 or +1 */ +}; + +/* Here we rearrange the tree so the node p to be deleted + is a node with a null left link. With that done + we can fix pkarray and then we can use the pkarray + to rebalance. + It's a bit long, so we refactor out the code from + where it is called. + The rearrangement is Algorithm 6.2.2D in Knuth. + PRECONDITION: p,p->rlink, pp non-null. + RETURNS: new high index of pkarray. +*/ + +static unsigned +rearrange_tree_so_p_llink_null( struct pkrecord * pkarray, + unsigned k, + UNUSEDARG struct ts_entry *head, + struct ts_entry *r, + struct ts_entry *p, + UNUSEDARG int pak, + UNUSEDARG struct ts_entry *pp, + int ppak) +{ + struct ts_entry *s = 0; + unsigned k2 = 0; /* indexing pkarray */ + int pbalance = p->balance; + + /* Step D3 */ + /* Since we are going to modify the tree by + movement of a node down the tree a ways, + we need to build pkarray with the (not yet + found) new next node, in pkarray[k], not + p. + The deletion will be of p, but by then + p will be moved in the tree so it has a null left link. + P's possibly-non-null right link + */ + k2 = k; + k2++; + r = p->rlink; + pkarray[k2].pk = r; + pkarray[k2].ak = -1; + s = r->llink; + /* Move down and left to get a null llink. */ + while (s->llink) { + k2++; + r = s; + s = r->llink; + pkarray[k2].pk = r; + pkarray[k2].ak = -1; + } + /* Now we move S up in place (in the tree) + of the node P we will delete. + and p replaces s. + Finally winding up with a newly shaped balanced tree. + */ + { + struct ts_entry *tmp = 0; + int sbalance = s->balance; + s->llink = p->llink; + r->llink = p; + p->llink = 0; + tmp = p->rlink; + p->rlink = s->rlink; + s->rlink = tmp; + setlink(pp,ppak,s); + s->balance = pbalance; + p->balance = sbalance; + /* Now the tree is rearranged and still in balance. */ + + /* Replace the previous k position entry with S. + We trace the right link off of the moved S node. */ + pkarray[k].pk = s; + pkarray[k].ak = 1; + + r->llink = p->rlink; + /* Now p is out of the tree and we start + the rebalance at r. pkarray Index k2. */ + } + /* Step D4 */ + free(p); + return k2; +} + +/* Returns deleted node parent unless the head changed. + Returns NULL if wanted node not found or the tree + is now empty or the head node changed. + Sets *did_delete if it found and deleted a node. + Sets *tree_empty if there are no more user nodes present. +*/ +static struct ts_entry * +tdelete_inner(const void *key, + struct ts_entry *head, + int (*compar)(const void *, const void *), + int *tree_empty, + int *did_delete + ) +{ + struct ts_entry *p = 0; + struct ts_entry *pp = 0; + struct pkrecord * pkarray = 0; + int depth = head->llink - (struct ts_entry *)0; + unsigned k = 0; + + /* Allocate extra, head is on the stack we create + here and the depth might increase. */ + depth = depth + 4; + pkarray = calloc(sizeof(struct pkrecord),depth); + if(!pkarray) { + /* Malloc fails, we could abort... */ + return NULL; + } + k = 0; + pkarray[k].pk=head; + pkarray[k].ak=1; + p = head->rlink; + while(p) { + int kc = 0; + k++; + kc = compar(key,p->keyptr); + pkarray[k].pk = p; + pkarray[k].ak = kc; + if(!kc) { + break; + } + p = getlink(p,kc); + } + if(!p) { + /* Node to delete never found. */ + free(pkarray); + return NULL; + } + + { + struct ts_entry *t = 0; + struct ts_entry *r = 0; + int pak = 0; + int ppak = 0; + + p = pkarray[k].pk; + pak = pkarray[k].ak; + pp = pkarray[k-1].pk; + ppak = pkarray[k-1].ak; + + /* Found a match. p to be deleted. */ + t = p; + *did_delete = 1; + if(!t->rlink) { + if(k == 1 && !t->llink) { + *tree_empty = 1; + /* upper level will fix up head node. */ + free(t); + free(pkarray); + return NULL; + } + /* t->llink might be NULL. */ + setlink(pp,ppak,t->llink); + /* ASSERT: t->llink NULL or t->llink + has no children, balance zero and balance + of t->llink not changing. */ + k--; + /* Step D4. */ + free(t); + goto balance; + } +#ifdef IMPLEMENTD15 + /* Step D1.5 */ + if(!t->llink) { + setlink(pp,ppak,t->rlink); + /* we change the left link off ak */ + k--; + /* Step D4. */ + free(t); + goto balance; + } +#endif /* IMPLEMENTD15 */ + /* Step D2 */ + r = t->rlink; + if (!r->llink) { + /* We decrease the height of the right tree. */ + r->llink = t->llink; + setlink(pp,ppak,r); + pkarray[k].pk = r; + pkarray[k].ak = 1; + /* The following essential line not mentioned + in Knuth AFAICT. */ + r->balance = t->balance; + /* Step D4. */ + free(t); + goto balance; + } + /* Step D3, we rearrange the tree + and pkarray so the balance step can work. + step D2 is insufficient so not done. */ + k = rearrange_tree_so_p_llink_null(pkarray,k, + head,r, + p,pak,pp,ppak); + goto balance; + } + /* Now use pkarray decide if rebalancing + needed and, if needed, to rebalance. + k here matches l-1 in Knuth. */ + balance: + { + unsigned k2 = k; + /* We do not want a test in the for() itself. */ + for( ; 1 ; k2--) { + struct ts_entry *pk = 0; + int ak = 0; + int bk = 0; + if (k2 == 0) { + /* decreased in height */ + head->llink--; + goto cleanup; + } + pk = pkarray[k2].pk; + if (!pk) { + /* Nothing here to work with. Move up. */ + continue; + } + ak = pkarray[k2].ak; + bk = pk->balance; + if(bk == ak) { + pk->balance = 0; + continue; + } + if(bk == 0) { + pk->balance = -ak; + goto cleanup; + } + /* ASSERT: bk == -ak. We + will use bk == adel here (just below). */ + /* Rebalancing required. Here we use (1) and (2) + in 6.2.3 to adjust the nodes */ + { + /* Rebalance. We use s for what + is called A in Knuth Case 1, Case 2 + page 461. r For what is called B. + So the link movement logic looks similar + to the tsearch insert case.*/ + struct ts_entry *r = 0; + struct ts_entry *s = 0; + struct ts_entry *pa = 0; + int pak = 0; + int adel = -ak; + + s = pk; + r = getlink(s,adel); + pa = pkarray[k2-1].pk; + pak = pkarray[k2-1].ak; + if(r->balance == adel) { + /* case 1. */ + setlink(s,adel,getlink(r,-adel)); + setlink(r,-adel,s); + + /* A10 in tsearch. */ + setlink(pa,pak,r); + s->balance = 0; + r->balance = 0; + continue; + } else if (r->balance == -adel) { + /* case 2 */ + /* x plays the role of p in step A9 */ + struct ts_entry*x = getlink(r,-adel); + setlink(r,-adel,getlink(x,adel)); + setlink(x,adel,r); + setlink(s,adel,getlink(x,-adel)); + setlink(x,-adel,s); + + /* A10 in tsearch. */ + setlink(pa,pak,x); + if(x->balance == adel) { + s->balance = -adel; + r->balance = 0; + } else if (x->balance == 0) { + s->balance = 0; + r->balance = 0; + } else if (x->balance == -adel) { + s->balance = 0; + r->balance = adel; + } + x->balance = 0; + continue; + } else { + /* r->balance == 0 case 3 + we do a single rotation and + we are done. */ + setlink(s,adel,getlink(r,-adel)); + setlink(r,-adel,s); + setlink(pa,pak,r); + r->balance = -adel; + /*s->balance = r->balance = 0; */ + goto cleanup; + } + } + } + } + cleanup: + free(pkarray); +#ifdef DW_CHECK_CONSISTENCY + dwarf_check_balance(head,1); +#endif + return pp; +} + +void * +dwarf_tdelete(const void *key, void **rootp, + int (*compar)(const void *, const void *)) +{ + struct ts_entry **phead = (struct ts_entry **)rootp; + struct ts_entry *head = 0; + /* If a leaf is found, we have to null a parent link + or the root */ + struct ts_entry * parentp = 0; + int tree_empty = 0; + int did_delete = 0; + + if (!phead) { + return NULL; + } + head = *phead; + if (!head) { + return NULL; + } + if (!head->rlink) { + return NULL; + } + parentp = tdelete_inner(key,head,compar,&tree_empty,&did_delete); + if(tree_empty) { + head->rlink = 0; + head->llink = 0; + free(head); + *phead = 0; + return NULL; + } + /* ASSERT: head->rlink non-null. */ + if(did_delete) { + if (!parentp) { + parentp = head->rlink; + } + return (void *)(&(parentp->keyptr)); + } + /* Not deleted */ + return NULL; +} + +static void +dwarf_twalk_inner(struct ts_entry *p, + void (*action)(const void *nodep, const DW_VISIT which, const int depth), + unsigned level) +{ + if (!p->llink && !p->rlink) { + action((const void *)(&(p->keyptr)),dwarf_leaf,level); + return; + } + action((const void *)(&(p->keyptr)),dwarf_preorder,level); + if(p->llink) { + dwarf_twalk_inner(p->llink,action,level+1); + } + action((const void *)(&(p->keyptr)),dwarf_postorder,level); + if(p->rlink) { + dwarf_twalk_inner(p->rlink,action,level+1); + } + action((const void *)(&(p->keyptr)),dwarf_endorder,level); +} + + +void +dwarf_twalk(const void *rootp, + void (*action)(const void *nodep, const DW_VISIT which, const int depth)) +{ + struct ts_entry *head = (struct ts_entry *)rootp; + struct ts_entry *root = 0; + if(!head) { + return; + } + root = head->rlink; + if(!root) { + return; + } + /* Get to actual tree. */ + dwarf_twalk_inner(root,action,0); +} + +static void +dwarf_tdestroy_inner(struct ts_entry*p, + void (*free_node)(void *nodep), + int depth) +{ + if(p->llink) { + dwarf_tdestroy_inner(p->llink,free_node,depth+1); + p->llink = 0; + } + if(p->rlink) { + dwarf_tdestroy_inner(p->rlink,free_node,depth+1); + p->rlink = 0; + } + free_node((void *)p->keyptr); + free(p); +} + +/* Walk the tree, freeing all space in the tree + and calling the user's callback function on each node. + + It is up to the caller to zero out anything pointing to + head (ie, that has the value rootp holds) after this + returns. +*/ +void +dwarf_tdestroy(void *rootp, void (*free_node)(void *nodep)) +{ + struct ts_entry *head = (struct ts_entry *)rootp; + struct ts_entry *root = 0; + if(!head) { + return; + } + root = head->rlink; + if(root) { + dwarf_tdestroy_inner(root,free_node,0); + } + free(head); +} + + + diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarfdump.1 b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarfdump.1 new file mode 100644 index 0000000..4e2ad65 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarfdump.1 @@ -0,0 +1,665 @@ +.TH DWARFDUMP +.SH NAME +dwarfdump \- dumps DWARF debug information of an ELF object +.SH SYNOPSIS +.B dwarfdump [options] \f2objectfilename\fP +.SH DESCRIPTION +The +.B dwarfdump +command prints or checks DWARF sections as requested by specific options. +With no options (but with the required \f2objectfilename\fP ) +all sections print (but some sections cannot be printed independently +safely, so those are only printed at offsets where the .debug_info section +refers to those sections). +.PP +As of June 2011 the printing options and the checking options +are mutually exclusive (if checking options are selected +the section details are not printed). When errors are encountered +dwarfdump does attempt to print sufficient context so that +one can understand exactly where the error is in the DWARF. +This change makes checking really large object files +much easier. +.PP +The format is intended to be human readable. +If a script is to parse the output, the +.B \-d +option is useful. +.PP +Not all sections actually exist in any given object file. +.PP +The format may change from release to release, so it is +unwise to depend too heavily on the format. +.PP +Frame information (.debug_frame and .eh_frame) is heavily +dependent on the ABI/ISA of the object file. +By default we use a generic set of register names +handling up to 100 registers named r0-100. +The '-R' option uses a built-in generic register name set +handling up to 1200 registers named r0-r1199. +The '-x abi=' +description below shows how to name an abi and use that to guide +the -f or -F processing. +Unless the cpu for the object file being dumped has many registers, +do not use -R or -x abi=generic as those can be needlessly +slow dumping frame sections. Instead, use the correct +abi (if it exists in dwarfdump.conf) or a generic such +as -x abi=generic100 or -x abi=generic500. +To get MIPS/IRIX register names names and call the old version 2 libdwarf +frame interface use the option '-x abi=mips'. +Without '-R' or '-x abi=' dwarfdump ignores +the dwarfdump.conf file and uses compiled-in generic set of +register names. +If no '-x name=' is given, dwarfdump +looks for "./dwarfdump.conf", "$HOME/.dwarfdump.conf", "/lib/dwarfdump.conf" and takes the first it finds. +If one or more '-x name=' is given the last of these is +used and all other such files are ignored. +.PP +If '-x nosanitizestrings' is given then unprintable characters +are not translated to '%xx' (two digit hex +preceded by the '%' character) (with +this option bogus characters +in strings could cause terminal windows to behave oddly). +.PP +Some -k (checking) options print so-called harmless errors. +These are compiler errors that do not cause any +known problem and are only detected inside libdwarf itself. +These are difficult to properly report in dwarfdump and +any error strings may not appear close to the time the +error was encountered. +.PP +If zlib compression was used on the DWARF sections +in the object file being read the +real section names such as .zdebug_info etc will be reported by +dwarfdump. +When dwarfdump says something is at offset 55 +of .zdebug_info (or the like) keep in mind that +the offset applies to the +uncompressed section (in memory), +not the .zdebug_ compressed section +in \f2objectfilename\fP. +.SH URI STYLE INPUT STRINGS +.PP +The and the options taking name strings look for URIs and +translate the URI strings to characters by default +(see -x, -c, -S, -u). +So any single % character is treated as if the following two +characters are hex digits representing the underlying true character. +Various characters are meaningful to shells (such as bash or sh) +and to getopt (such as the space character) +If the URI translation does anything it prints the before and after +of the URI translation on standard output, so inspection of the first +lines of output will show if URI did anything. +The actual options themselves are assumed to be non-URI. +So in the option '-cS&T' the -c portion must be non-URI, but the +& character might cause input issues so '-cS%26T' could be used instead. +To actually input a single % character (in a name, for example), +double it to %% on the command line. +.PP +Options -U (turning off URI interpretation) and -q (making finding +URI sequences silent) give finer control of URI interpretation. +PP +As an example, to get a string'a b' make the string 'a%20b' +(here the quote (') is for exposition not part of the string, though +quote is certainly problematic in a name). +Instead of escaping " quotes in the string, type %25, as in + 'a "b' should be typed 'a%20%25b' +Any characters can be typed in URI style, not just characters +which are problematic to the shell or getopt. +We strongly suggest you not type URI-style characters where +such are not needed or use +the % character itself in command line strings unless you must. +.SH PRINTING OPTIONS +.TP +.B \-a +Print each section as independently as possible. Sections that +can safely be printed independently (like .debug_abbrev) +have relevant info printed in the report (sometimes dependent +on -v). + +.TP +.B \-b +Print the .debug_abbrev section. Because the DWARF specifications +do not rule out garbage data areas in .debug_abbrev (if they are not +referenced from .debug_info) any garbage bytes can result in +this print failing. + +.TP +.B \-c +Print locations lists. + +.TP +.B \-E +Print ELF header information and index, address and size for all sections. +.TP +.B \-Eh +Effectively does nothing (use another tool to print +the Elf file header). +.TP +.B \-El +Print index, address and size for the .debug_line section. +.TP +.B \-Ei +Print index, address and size for the .debug_info section. +.TP +.B \-Ea +Print index, address and size for the .debug_abbrev section. +.TP +.B \-Ep +Print index, address and size for the .debug_pubnames section. +.TP +.B \-Er +Print index, address and size for the .debug_aranges section. +.TP +.B \-Ef +Print index, address and size for the .debug_frame section. +.TP +.B \-Eo +Print index, address and size for the .debug_loc section. +.TP +.B \-ER +Print index, address and size for the .debug_ranges section. +.TP +.B \-Es +Print index, address and size for the .debug_string section. +.TP +.B \-Et +Print index, address and size for the .debug_pubtypes section. +.TP +.B \-Ex +Print index, address and size for the .text section. +.TP +.B \-Ed +Print index, address and size for the .text and .debug_* sections. + +.TP +.B \-f +Print the .debug_frame section. +.TP +.B \-F +Print the .eh_frame section. + +.TP +.B \-h +Print IRIX exception tables (unsupported). + +.TP +.B \-i +Print the .debug_info section. + +.TP +.B \-I +Print the .gdb_index, .debug_cu_index, .debug_tu_index sections +if any exist. + +.TP +.B \-l +Print the .debug_info section and the associated line section data. +.TP +.B \-ls +Print the .debug_info section and the associated line section data, but omits +the address. Useful when a comparison is required. + +.TP +.B \-m +Print the .debug_macinfo section. + +.TP +.B \-N +Print .debug_ranges section. Because the DWARF specifications +do not rule out garbage data areas in .debug_ranges (if they are not +referenced from .debug_info) any garbage bytes can result in +this print failing. + +.TP +.B \-p +Print the .debug_pubnames section. + +.TP +.B \-r +Print the .debug_aranges section. +.TP +.B \-s +Print .debug_string section. + +.TP +.B \-ta +Print the IRIX only sections .debug_static_funcs and .debug_static_vars. + +.TP +.B \-tf +Print the IRIX only section .debug_static_funcs. +.TP +.B \-tv +Print the IRIX only section .debug_static_vars. + +.TP +.B \-w +Print the IRIX-only .debug_weaknames section. + +.TP +.B \-y +Print the .debug_pubtypes section (and .debug_typenames, +an SGI IRIX-only section). + +.PP +Having dwarfdump print relocations may help establish whether +dwarfdump understands any relocations that might exist. + +.TP +.B \-o +Print all relocation records as well as we can manage. +.TP +.B \-oi +Print .rel*debug_info relocations. +.TP +.B \-ol +Print .rel*debug_line relocation. +.TP +.B \-op +Print .rel*debug_pubnames relocation. +.TP +.B \-oa +Has no effect. +.TP +.B \-or +Print .rel*debug_aranges relocations. +.TP +.B \-of +Print .rel*debug_frame relocations. +.TP +.B \-oo +Print .rel*debug_loc relocations. +.TP +.B \-oR +Print .rel*debug_ranges relocations. + +.TP +.B \-g +Normally used only for testing libdwarf, this tells dwarfdump to +use an older dwarf_loclist() interface +function (a function that cannot handle all +DWARF4 or DWARF5 +location lists). +Before November 2015 it implied -i, now you should use +-i -g to also get .debug_info printed. +.TP +.B \-V +Print a dwarfdump date/version string and stop. + +.SH CHECKING OPTIONS +.TP +.B \-cg +Restricts checking to compilers whose +producer string starts with 'GNU' +and turns off -cs. + +.TP +.B \-cs +Restricts checking to compilers whose +producer string starts with 'SN' +and turns off -cg. +.TP +.B \-cname +Restricts checking to compilers whose +producer string contains 'name' (not case sensitive). +The 'name' is read as a URI string. + +.TP +.B \-ka +Turns on all checking options except -kxe (-kxe might +be slow enough one mignt not want to use it routinely.) + +.TP +.B \-kb +Checks for certain abbreviations section errors when reading DIEs. +.TP +.B \-kc +Checks for errors in constants in debug_info. +.TP +.B \-kd +Turns on full reporting of error totals per producer. +(the default shows less detail). +.TP +.B \-kD +Turns on reporting of duplicated attributes. +Duplicated attributes on a single DW_TAG are +improper DWARF, but at least one compiler +emitted such. +.TP +.B \-ke +Turns on reading pubnames and checking for fde errors. +.TP +.B \-kE +Checks the integer encoding representation in debug_info, +computing whether these integer values +could fit in fewer bytes if represented in LEB128. + +.TP +.B \-kf +Turns on checking for FDE errors. +.TP +.B \-kF +Turns on checking for line table errors. +.TP +.B \-kg +Turns on checking for unused gaps in .debug_info (these +gaps are not an error, just a waste of space). +.TP +.B \-kG +Print only unique errors. Error lines are simpified +(hex numbers removed, for example) and when +a given message string would otherwise appear +again it is suppressed. +.TP +.B \-ki +Causes a summary of checking results per compiler (producer) +to be printed at the end. +.TP +.B \-kl +Turns on locations list checking. +.TP +.B \-km +Turns on checking of ranges. +.TP +.B \-kM +Turns on checking of aranges. +.TP +.B \-kr +Turns on DIE tag-attr combinations checking. +.TP +.B \-kR +Turns on reading DIEs and checking for forward declarations +rom DW_AT_specification attributes. +(which are not an error but can be a source of inefficiency +for debuggers). +.TP +.B \-ks +Turns on extra reporting for some DIE errors checking detects. +.TP +.B \-kS +Turns on checking DIE references for circular references. +.TP +.B \-kt +Turns on tag-tag combinations checking. +.TP +.B \-ku +Print tag-tree and tag-attribute usage (basic format). +.TP +.B \-kuf +Print tag-tree and tag-attribute usage (full format). +For standard TAGs and ATtributes this presents an overview +of how they were used. +.TP +.B \-kx +Turns on check_frames. +.TP +.B \-kxe +Turns off basic check_frames and turns on extended frame checking. +.TP +.B \-ky +Turns on type_offset, decl_file checking, + +.SH OPTION MODIFIERS + +.TP +.B \-C +Normally when checking for tag-tag or tag-attribute combinations +both the standard combinations and some common extensions are allowed. +With -C the extensions are taken out of the allowed class of combinations. + +.TP +.B \-d +When printing DIEs, put all the attributes for each DIE on the same (long) +line as the TAG. This makes searching for DIE information +(as with grep) much simpler as the entire DIE is on one line. + +.TP +.B \-D +Turns off the display of section offsets and attribute values in printed output. +So the .debug_info output is just TAGs and Attributes. +For pubnames (and the like) it removes offsets from the output. +For locations lists it removes offsets from the output, but that +is useless since the attribute values don't show so neither does +the location data. + +.TP +.B \-e +Turns on truncation of attribute and tag names. For example +DW_TAG_foo becomes foo. Not compatible with +checking, only useful for printing DIEs. + +.TP +.B \-G +When printing, add global offsets to the offsets printed. + +.TP +.B \-H number +When printing or checking .debug_info, this terminates +the search after 'number' compilation units. When printing +frame information this terminates the FDE reporting +after 'number' FDEs and the CIE reporting (which occurs if one adds -v) +after 'number' CIEs. Example '-H 1' + +.TP +.B \-M +When printing, this means one want to have the FORM show for each attribute. +If a -v is also added (or more than one) then details of any form indirection +are also shown. + +.TP +.B \-n +When printing frames, this turns off the search for function names. +In a really large object the search can take more time than +one wants to wait, so this avoids the search. +.TP +.B \-O file= +The will be used as the file name for output instead +of writing to stdout (stdout is the default). +.TP +.B \-Q +Suppresses section data printing (set automatically with a checking option). + +.TP +.B \-R +When printing frames for ABIs with lots of registers, this allows +up to 1200 registers to be named (like R999) without choosing an ABI +with, for example '-x abi=ppc' + +.TP +.B \-v +Increases the detail shown when printing. +In some sections, using more -v options +will increase the detail (one to three are useful) or may +change the report to show, for example, the actual +line-data-commands instead of the resultant line-table. + +.SH SELECTIVE ENTRY PRINTING + +.PP +These -S options stand alone and basic print information about the compilation +unit and DIE where the string(s) appear. +At most one of each of the following is effective (so for example +one can only have one 'match', but one can +have a 'match', an 'any', and a 'regex'). +Any -S causes the .debug_info section to be inspected. +No checking options or printing options should be supplied with -S. + +If v is added to the -S option, the number of occurrences is printed. +(see below for an example). + +.TP +.B \-S match=string +When printing DIEs +for each tag value or attribute name that matches 'string' exactly +print the compilation unit information and its section offset. +Any CU with no match is not printed. +The 'string' is read as a URI string. +.TP +.B \-S any=string +When printing DIEs +for each tag value or attribute name that contains 'string' +somewhere in the tag or attribute (case insensitive) +print the compilation unit information and its section offset. +Any CU with no match is not printed. +The 'string' is read as a URI string. +.TP +.B \-S regex=string +When printing DIEs +for each tag value or attribute name where the 'string' reqular +expression matches print the compilation unit information +and its section offset. +Any CU with no match is not printed. +The 'string' is read as a URI string. + +.PP +The string cannot have spaces or other characters which are +meaningful to getopt(3) and the shell will strip off quotes and +other characters. +So the string is assumed to be in URI style and is translated. +In other words, to match 'a b' make the -S string 'a%20b' +Instead of escaping " quotes in the string, type %25, as in + 'a "b' should be typed 'a%20%25b' +(the ' are for exposition here, not part of the strings). +Any characters can be typed in URI style, not just characters +which are problematic to the shell or getopt. +.PP +The -S any= and -S regex= options are only usable +if the library functions required are found at configure time. +.PP +The -W option is a modifier to the -S option, and +increases the amount of output -W prints. +An example v modifier to the -S option is shown below. +And we show the -W in context with a -S option. + +.TP +.B \-S vmatch=string1 +Prints information about the +DIEs that -S matches and prints the count of occurrences + +.TP +.B \-S match=string1 -W +Prints the parent tree and the children tree for the +DIEs that -S matches. + +.TP +.B \-S match=string2 -Wp +Prints the parent tree for the DIEs that -S matches. + +.TP +.B \-S match=string3 -Wc +Prints the parent tree for the DIEs that -S matches. + +.SH OTHER OPTIONS + +.TP +.B \-# number +This option controls internal debugging output, +higher numbers mean more debug actions. See the source code. + + +.TP +.B \-x name=/p/a/t/h.conf +The file path given is the name of a file assumed to be +a dwarfdump.conf-like file. +The file path is read as a URI string. + +.TP +.B \-x abi=ppc +Selects the abi (from a dwarfdump.conf file) to be used in +printing frame information (here using ppc as an example). +The abi is read as a URI string. + +.TP +.B \-x groupnumber= +For an object file with both DWARF5 split dwarf (.debug_info.dwo +for example) and ordinary +DWARF sections (.debug_info for example) +in the single object file +one must use +-x groupnumber=2 to print the dwo sections. +Adding -x tied= naming the same object file ties +in the non-dwo sections. + +.TP +.B \-x tied=/t/i/depath +Used when opening a main object that is a .dwo or .dwp file. +The tied file path names the executable which has +the .debug_addr section that may be referred to from +the main object. See Split Objects (aka Debug Fission). +.TP +.B \-x line5=s2l +Normally used only to test libdwarf interfaces. +There are 4 different interface function sets and to ensure +they all work this option lets us choose which +to use. The options are 's2l' (default, Allows standard +and two-level line tables using the latest +interface functions), 'std' (Allows standard +single level line tables using the latest +interface functions), 'orig' (allows DWARF2,3,4 +original line tables using an older +interface function set), 'orig2l' (allows original line tables +and some two-level line tables using an older interface set). + +.TP +.B \-P +When checking this adds the list of compilation-unit names +seen for each producer-compiler to the printed checking results. +.TP +.B \-q +When a URI is found and translated while reading +the command line, be quiet about +the URI translation. That is, don't print the +original and translated option strings. + +.TP +.B \-E +Turns on printing object-internal header data for some +systems (for Unix/Linux does nothing). + +.TP +.B \-u cuname +Turns on selective printing of DIEs (printing like -i). +Only the DIEs for a compilation unit that match the +name provided are printed. +If the compilation unit is ./a/b/c.c +the 'cuname' you provide should be c.c as the characters +through the final path-separating / are ignored. +If 'cuname' begins with a / then the entire name string +of a compilation unit must match 'cuname'. +The 'cuname' is read as a URI string. + +.TP +.B \-U +Turn off the URI interpretation of the command line +strings entirely. Must be be on the command line before +any URI strings encountered to be fully effective. + +.TP +.B \-z +No longer supported. + + +.SH FILES +dwarfdump + + ./dwarfdump.conf + +$(HOME)/.dwarfdump.conf + +$(HOME)/dwarfdump.conf + +/lib/dwarfdump.conf +.SH NOTES +In some cases compilers use DW_FORM_data1 (for example) +and in such cases the signedness of the value must be taken +from context. Rather than attempt to determine the +context, dwarfdump prints the value with both signednesses +whenever there is ambiguity about the correct interpretation. +For example, +"DW_AT_const_value 176(as signed = -80)". +For normal DWARF consumers that correctly and fully +evaluate all attributes there is no ambiguity of signedness: +the ambiguity for dwarfdump is due to dwarfdump evaluating +DIEs in a simple order and not keeping track of much context. +.SH BUGS +Support for DWARF3 is being completed but may not be complete. diff --git a/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarfdump.c b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarfdump.c new file mode 100644 index 0000000..8f54f80 --- /dev/null +++ b/dwarf-compilation.base/contrib/libdwarf/dwarfdump/dwarfdump.c @@ -0,0 +1,3303 @@ +/* + Copyright (C) 2000,2002,2004,2005 Silicon Graphics, Inc. All Rights Reserved. + Portions Copyright (C) 2007-2017 David Anderson. All Rights Reserved. + Portions Copyright 2007-2010 Sun Microsystems, Inc. All rights reserved. + Portions Copyright 2012 SN Systems Ltd. All rights reserved.:w + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This program is distributed in the hope that it would be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Further, this software is distributed without any warranty that it is + free of the rightful claim of any third person regarding infringement + or the like. Any license provided herein, whether implied or + otherwise, applies only to this software file. Patent licenses, if + any, provided herein do not apply to combinations of this program with + other software, or any other product whatsoever. + + You should have received a copy of the GNU General Public License along + with this program; if not, write the Free Software Foundation, Inc., 51 + Franklin Street - Fifth Floor, Boston MA 02110-1301, USA. + +*/ + +/* The address of the Free Software Foundation is + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + SGI has moved from the Crittenden Lane address. +*/ + +#include "globals.h" +/* for 'open' */ +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include /* for dup2() */ +#endif +#include "dwgetopt.h" +#include "makename.h" +#include "dwconf.h" +#include "common.h" +#include "macrocheck.h" +#include "helpertree.h" +#include "uri.h" +#include "esb.h" /* For flexible string buffer. */ +#include "tag_common.h" + +#ifdef _WIN32 +extern int elf_open(const char *name,int mode); +#endif /* _WIN32 */ + +#define DW_VERSION_DATE_STR " 2017-10-13 19:09:46-07:00 " + +extern char *dwoptarg; + + +#define OKAY 0 +#define BYTES_PER_INSTRUCTION 4 + +static const char* process_args(int argc, char *argv[]); + +const char * program_name; +static int check_error = 0; + +/* used in special_program_name() only */ +static struct esb_s newprogname; + +/* The type of Bucket. */ +#define KIND_RANGES_INFO 1 +#define KIND_SECTIONS_INFO 2 +#define KIND_VISITED_INFO 3 + +/* pRangesInfo records the DW_AT_high_pc and DW_AT_low_pc + and is used to check that line range info falls inside + the known valid ranges. The data is per CU, and is + reset per CU in tag_specific_checks_setup(). */ +Bucket_Group *pRangesInfo = NULL; + +struct section_high_offsets_s section_high_offsets_global; + +/* pLinkonceInfo records data about the link once sections. + If a line range is not valid in the current CU it might + be valid in a linkonce section, this data records the + linkonce sections. So it is filled in when an + object file is read and remains unchanged for an entire + object file. */ +Bucket_Group *pLinkonceInfo = NULL; +/* pVisitedInfo records a recursive traversal of DIE attributes + DW_AT_specification DW_AT_abstract_origin DW_AT_type + that let DWARF refer (as in a general graph) to + arbitrary other DIEs. + These traversals use pVisitedInfo to + detect any compiler errors that introduce circular references. + Printing of the traversals is also done on request. + Entries are added and deleted as they are visited in + a depth-first traversal. */ +Bucket_Group *pVisitedInfo = NULL; + +/* Options to enable debug tracing */ +int nTrace[MAX_TRACE_LEVEL + 1]; + +/* Build section information */ +void build_linkonce_info(Dwarf_Debug dbg); +static const char * do_uri_translation(const char *s, + const char *context); + +struct glflags_s glflags; + +/* See section_bitmaps.c, .h Control section header + printing. (not DWARF printing) */ +static char reloc_map[DW_SECTION_REL_ARRAY_SIZE]; +static char section_map[DW_HDR_ARRAY_SIZE]; + +/* Start verbose at zero. verbose can + be incremented with -v but not decremented. */ +int verbose = 0; + +boolean dense = FALSE; +boolean ellipsis = FALSE; +boolean show_form_used = FALSE; + +/* break_after_n_units is mainly for testing. + It enables easy limiting of output size/running time + when one wants the output limited. + For example, + -H 2 + limits the -i output to 2 compilation units and + the -f or -F output to 2 FDEs and 2 CIEs. +*/ +int break_after_n_units = INT_MAX; + +#define COMPILER_TABLE_MAX 100 +typedef struct anc { + struct anc *next; + char *item; +} a_name_chain; + +/* Records information about compilers (producers) found in the + debug information, including the check results for several + categories (see -k option). */ +typedef struct { + const char *name; + boolean verified; + a_name_chain *cu_list; + a_name_chain *cu_last; + Dwarf_Check_Result results[LAST_CATEGORY]; +} Compiler; + +/* Record compilers whose CU names have been seen. + Full CU names recorded here, though only a portion + of the name may have been checked to cause the + compiler data to be entered here. + The +1 guarantees we do not overstep the array. +*/ +static Compiler compilers_detected[COMPILER_TABLE_MAX]; +static int compilers_detected_count = 0; + +/* compilers_targeted is a list of indications of compilers + on which we wish error checking (and the counts + of checks made and errors found). We do substring + comparisons, so the compilers_targeted name might be simply a + compiler version number or a short substring of a + CU producer name. + The +1 guarantees we do not overstep the array. +*/ +static Compiler compilers_targeted[COMPILER_TABLE_MAX]; +static int compilers_targeted_count = 0; +static int current_compiler = -1; + +static void reset_compiler_entry(Compiler *compiler); +static void PRINT_CHECK_RESULT(char *str, + Compiler *pCompiler, Dwarf_Check_Categories category); + +/* These names make diagnostic messages more complete, the + fixed length is safe, though ultra long names will get + truncated. */ +char PU_name[COMPILE_UNIT_NAME_LEN]; +char CU_name[COMPILE_UNIT_NAME_LEN]; +char CU_producer[COMPILE_UNIT_NAME_LEN]; + +/* Base address has a special meaning in DWARF4 relative to address ranges. */ +boolean seen_PU = FALSE; /* Detected a PU */ +boolean seen_CU = FALSE; /* Detected a CU */ +boolean need_CU_name = TRUE; /* Need CU name */ +boolean need_CU_base_address = TRUE; /* Need CU Base address */ +boolean need_CU_high_address = TRUE; /* Need CU High address */ +boolean need_PU_valid_code = TRUE; /* Need PU valid code */ + +boolean seen_PU_base_address = FALSE; /* Detected a Base address for PU */ +boolean seen_PU_high_address = FALSE; /* Detected a High address for PU */ +Dwarf_Addr PU_base_address = 0; /* PU Base address */ +Dwarf_Addr PU_high_address = 0; /* PU High address */ + +Dwarf_Off DIE_offset = 0; /* DIE offset in compile unit */ +Dwarf_Off DIE_overall_offset = 0; /* DIE offset in .debug_info */ + +/* These globals enable better error reporting. */ +Dwarf_Off DIE_CU_offset = 0; /* CU DIE offset in compile unit */ +Dwarf_Off DIE_CU_overall_offset = 0; /* CU DIE offset in .debug_info */ +int current_section_id = 0; /* Section being process */ + +/* Base Address is needed for range lists and must come from a CU. + Low address is for information and can come from a function + or something in the CU. */ +Dwarf_Addr CU_base_address = 0; /* CU Base address */ +Dwarf_Addr CU_low_address = 0; /* CU low address */ +Dwarf_Addr CU_high_address = 0; /* CU High address */ + +const char *search_any_text = 0; +const char *search_match_text = 0; +const char *search_regex_text = 0; +int search_occurrences = 0; + +#ifdef HAVE_REGEX +/* -S option: the compiled_regex */ +regex_t search_re; +#endif + +/* Functions used to manage the unique errors table */ +static void allocate_unique_errors_table(void); +static void release_unique_errors_table(void); +#ifdef TESTING +static void dump_unique_errors_table(void); +#endif +static boolean add_to_unique_errors_table(char * error_text); + +/* These configure items are for the + frame data. We're flexible in + the path to dwarfdump.conf . + The HOME strings here are transformed in + dwconf.c to reference the environment + variable $HOME . +*/ +static struct esb_s config_file_path; +static struct esb_s config_file_tiedpath; +static const char *config_file_abi = 0; +static char *config_file_defaults[] = { + "dwarfdump.conf", + "./dwarfdump.conf", + "HOME/.dwarfdump.conf", + "HOME/dwarfdump.conf", +#ifdef CONFPREFIX +/* See Makefile.in "libdir" and CFLAGS */ +/* We need 2 levels of macro to get the name turned into + the string we want. */ +#define STR2(s) # s +#define STR(s) STR2(s) + STR(CONFPREFIX) + "/dwarfdump.conf", +#else + "/usr/lib/dwarfdump.conf", +#endif + 0 +}; +static struct dwconf_s g_config_file_data; + +static struct esb_s esb_short_cu_name; +static struct esb_s esb_long_cu_name; +static struct esb_s dwarf_error_line; +static struct esb_s cu_name; + +/* Output filename */ +static const char *output_file = 0; +static int group_number = 0; + + +static int +get_number_value(char *v_in,long int *v_out) +{ + long int v= 0; + size_t len = strlen(v_in); + char *endptr = 0; + + if (len < 1) { + return DW_DLV_ERROR; + } + v = strtol(v_in,&endptr,10); + if (endptr == v_in) { + return DW_DLV_NO_ENTRY; + } + if (*endptr != '\0') { + return DW_DLV_ERROR; + } + *v_out = v; + return DW_DLV_OK; +} + +/* When we add a 'print' option after an option + requests one or more checks + we turn off all checking, putting it back to default + checking state. */ +static void +set_checks_off() +{ + glflags.gf_check_abbrev_code = FALSE; + glflags.gf_check_pubname_attr = FALSE; + glflags.gf_check_reloc_offset = FALSE; + glflags.gf_check_attr_tag = FALSE; + glflags.gf_check_tag_tree = FALSE; + glflags.gf_check_type_offset = FALSE; + glflags.gf_check_decl_file = FALSE; + glflags.gf_check_lines = FALSE; + glflags.gf_check_fdes = FALSE; + glflags.gf_check_ranges = FALSE; + glflags.gf_check_aranges = FALSE; + glflags.gf_check_harmless = FALSE; + glflags.gf_check_abbreviations = FALSE; + glflags.gf_check_dwarf_constants = FALSE; + glflags.gf_check_di_gaps = FALSE; + glflags.gf_check_forward_decl = FALSE; + glflags.gf_check_self_references = FALSE; + glflags.gf_check_attr_encoding = FALSE; + glflags.gf_check_duplicated_attributes = FALSE; + glflags.gf_check_debug_names = FALSE; +} + +static void suppress_check_dwarf() +{ + glflags.gf_do_print_dwarf = TRUE; + if (glflags.gf_do_check_dwarf) { + printf("Warning: check flag turned off, " + "checking and printing are separate.\n"); + } + glflags.gf_do_check_dwarf = FALSE; + set_checks_off(); +} +static void suppress_print_dwarf() +{ + glflags.gf_do_print_dwarf = FALSE; + glflags.gf_do_check_dwarf = TRUE; +} + +static int process_one_file(Elf * elf, Elf *elftied, + const char * file_name, + const char * tied_file_name, + int archive, + struct dwconf_s *conf); + +static int +open_a_file(const char * name) +{ + /* Set to a file number that cannot be legal. */ + int f = -1; + +#ifdef _MSC_VER + f = _open(name, _O_RDONLY| _O_BINARY); +#elif defined(__CYGWIN__) || defined(_WIN32) + /* It is not possible to share file handles + between applications or DLLs. Each application has its own + file-handle table. For two applications to use the same file + using a DLL, they must both open the file individually. + Let the 'libelf' dll to open and close the file. */ + + /* For WIN32 open the file as binary */ + f = elf_open(name, O_RDONLY | O_BINARY); +#else + f = open(name, O_RDONLY); +#endif + return f; + +} +static void +close_a_file(int f) +{ +#ifdef _MSC_VER + _close(f); +#else + close(f); +#endif +} + +static int +is_it_known_elf_header(Elf *elf) +{ + Elf32_Ehdr *eh32; + + eh32 = elf32_getehdr(elf); + if (eh32) { + return 1; + } +#ifdef HAVE_ELF64_GETEHDR + { + Elf64_Ehdr *eh64; + /* not a 32-bit obj */ + eh64 = elf64_getehdr(elf); + if (eh64) { + return 1; + } + } +#endif /* HAVE_ELF64_GETEHDR */ + /* Not something we can handle. */ + return 0; +} + +static void +clean_up_compilers_detected(void) +{ + memset(&compilers_detected[0],0, + COMPILER_TABLE_MAX*sizeof(Compiler)); + compilers_detected_count = 0; +} + + +/* + Iterate through dwarf and print all info. +*/ +int +main(int argc, char *argv[]) +{ + const char * file_name = 0; + const char * tied_file_name = 0; + int f = 0; + int ftied = 0; + Elf_Cmd cmd = 0; + Elf *arf = 0; + Elf *elf = 0; + Elf *elftied = 0; + int archive = 0; + int archmemnum = 0; + +#ifdef _WIN32 + /* Open the null device used during formatting printing */ + if (!esb_open_null_device()) { + fprintf(stderr,"dwarfdump: Unable to open null device.\n"); + exit(FAILED); + } +#endif /* _WIN32 */ + + init_global_flags(); + set_checks_off(); + esb_constructor(&config_file_path); + esb_constructor(&config_file_tiedpath); + esb_constructor(&esb_short_cu_name); + esb_constructor(&esb_long_cu_name); + esb_constructor(&dwarf_error_line); + esb_constructor(&cu_name); +#ifdef _WIN32 + /* Often we redirect the output to a file, but we have found + issues due to the buffering associated with stdout. Some issues + were fixed just by the use of 'fflush', but the main issued + remained. + The stdout stream is buffered, so will only display what's in the + buffer after it reaches a newline (or when it's told to). We have a + few options to print immediately: + - Print to stderr instead using fprintf. + - Print to stdout and flush stdout whenever we need it to using fflush. + - We can also disable buffering on stdout by using setbuf: + setbuf(stdout,NULL); + Make stdout unbuffered; this seems to work for all cases. + */ + + setbuf(stdout,NULL); + /* Windows specific. */ + /* Redirect stderr to stdout. */ + /* Tried to use SetStdHandle, but it does not work properly. */ +#if 0 + BOOL bbb = SetStdHandle(STD_ERROR_HANDLE,GetStdHandle(STD_OUTPUT_HANDLE)); + _iob[2]._file = _iob[1]._file; + stderr->_file = stdout->_file; +#endif + dup2(fileno(stdout),fileno(stderr)); +#endif /* _WIN32 */ + + print_version_details(argv[0],FALSE); + + (void) elf_version(EV_NONE); + if (elf_version(EV_CURRENT) == EV_NONE) { + (void) fprintf(stderr, "dwarfdump: libelf.a out of date.\n"); + exit(FAILED); + } + + esb_constructor(&newprogname); + file_name = process_args(argc, argv); + print_args(argc,argv); + + /* Redirect stdout and stderr to an specific file */ + if (output_file) { + if (NULL == freopen(output_file,"w",stdout)) { + fprintf(stderr, + "dwarfdump: Unable to redirect output to '%s'\n",output_file); + exit(FAILED); + } + dup2(fileno(stdout),fileno(stderr)); + /* Record version and arguments in the output file */ + print_version_details(argv[0],TRUE); + print_args(argc,argv); + } + + /* Because LibDwarf now generates some new warnings, + allow the user to hide them by using command line options */ + { + Dwarf_Cmdline_Options wcmd; + /* The struct has just one field!. */ + wcmd.check_verbose_mode = glflags.gf_check_verbose_mode; + dwarf_record_cmdline_options(wcmd); + } + + + f = open_a_file(file_name); + if (f == -1) { + fprintf(stderr, "%s ERROR: can't open %s\n", program_name, + file_name); + return (FAILED); + } + + cmd = ELF_C_READ; + arf = elf_begin(f, cmd, (Elf *) 0); + if (elf_kind(arf) == ELF_K_AR) { + /* This option is never tested and may not work sensibly. */ + archive = 1; + } + + if (esb_string_len(&config_file_tiedpath) > 0) { + int isknown = 0; + tied_file_name = esb_get_string(&config_file_tiedpath); + ftied = open_a_file(tied_file_name); + if (ftied == -1) { + fprintf(stderr, "%s ERROR: can't open tied file %s\n", + program_name, + tied_file_name); + return (FAILED); + } + elftied = elf_begin(ftied, cmd, (Elf *) 0); + if (elf_kind(elftied) == ELF_K_AR) { + fprintf(stderr, "%s ERROR: tied file %s is " + "an archive. Not allowed. Giving up.\n", + program_name, + tied_file_name); + return (FAILED); + } + isknown = is_it_known_elf_header(elftied); + if (!isknown) { + fprintf(stderr, + "Cannot process tied file %s: unknown format\n", + tied_file_name); + return FAILED; + } + } + + + while ((elf = elf_begin(f, cmd, arf)) != 0) { + int isknown = is_it_known_elf_header(elf); + if (!isknown) { + /* not a 64-bit obj either! */ + /* dwarfdump is almost-quiet when not an object */ + if (archive) { + Elf_Arhdr *mem_header = elf_getarhdr(elf); + const char *memname = + (mem_header && mem_header->ar_name)? + mem_header->ar_name:""; + + /* / and // archive entries are not archive + objects, but are not errors. */ + if (strcmp(memname,"/") && strcmp(memname,"//")) { + fprintf(stderr, "Can't process archive member " + "%d %s of %s: unknown format\n", + archmemnum, + sanitized(memname), + file_name); + } + } else { + fprintf(stderr, "Can't process %s: unknown format\n", + file_name); + } + check_error = 1; + cmd = elf_next(elf); + elf_end(elf); + continue; + } + memset(§ion_high_offsets_global,0, + sizeof(section_high_offsets_global)); + /* If we are checking .debug_line, .debug_ranges, .debug_aranges, + or .debug_loc build the tables containing + the pairs LowPC and HighPC. It is safer (and not + expensive) to build all + of these at once so mistakes in options do not lead + to coredumps (like -ka -p did once). */ + if (glflags.gf_check_decl_file || glflags.gf_check_ranges || + glflags.gf_check_locations || + glflags.gf_do_check_dwarf || + glflags.gf_check_self_references) { + pRangesInfo = AllocateBucketGroup(KIND_RANGES_INFO); + pLinkonceInfo = AllocateBucketGroup(KIND_SECTIONS_INFO); + pVisitedInfo = AllocateBucketGroup(KIND_VISITED_INFO); + } + + /* Create the unique error table */ + if (glflags.gf_print_unique_errors) { + allocate_unique_errors_table(); + } + + /* Allocate range array to be used by all CUs */ + if (glflags.gf_check_ranges) { + allocate_range_array_info(); + } + process_one_file(elf,elftied, + file_name, tied_file_name, + archive, &g_config_file_data); + /* Now cleanup object-specific allocations. */ + /* Trivial malloc space cleanup. */ + clean_up_syms_malloc_data(); + if (pRangesInfo) { + ReleaseBucketGroup(pRangesInfo); + pRangesInfo = 0; + } + if (pLinkonceInfo) { + ReleaseBucketGroup(pLinkonceInfo); + pLinkonceInfo = 0; + } + if (pVisitedInfo) { + ReleaseBucketGroup(pVisitedInfo); + pVisitedInfo = 0; + } + /* Release range array to be used by all CUs */ + if (glflags.gf_check_ranges) { + release_range_array_info(); + } + /* Delete the unique error set */ + if (glflags.gf_print_unique_errors) { + release_unique_errors_table(); + } + clean_up_compilers_detected(); + destruct_abbrev_array(); + cmd = elf_next(elf); + elf_end(elf); + archmemnum += 1; + } + elf_end(arf); + if (elftied) { + elf_end(elftied); + elftied = 0; + } + + /* These cleanups only necessary once all + objects processed. */ +#ifdef HAVE_REGEX + if (search_regex_text) { + regfree(&search_re); + } +#endif + makename_destructor(); + esb_destructor(&config_file_path); + esb_destructor(&config_file_tiedpath); + esb_destructor(&esb_long_cu_name); + esb_destructor(&esb_short_cu_name); + esb_destructor(&dwarf_error_line); + esb_destructor(&cu_name); + sanitized_string_destructor(); + ranges_esb_string_destructor(); + esb_destructor(&newprogname); + + close_a_file(f); + +#ifdef _WIN32 + /* Close the null device used during formatting printing */ + esb_close_null_device(); +#endif /* _WIN32 */ + + /* As the tool have reached this point, it means there are + no internal errors and we should return an OKAY condition, + regardless if the file being processed has errors. */ + return OKAY; +} + +void +print_any_harmless_errors(Dwarf_Debug dbg) +{ +#define LOCAL_PTR_ARY_COUNT 50 + /* We do not need to initialize the local array, + libdwarf does it. */ + const char *buf[LOCAL_PTR_ARY_COUNT]; + unsigned totalcount = 0; + unsigned i = 0; + unsigned printcount = 0; + int res = dwarf_get_harmless_error_list(dbg,LOCAL_PTR_ARY_COUNT,buf, + &totalcount); + if (res == DW_DLV_NO_ENTRY) { + return; + } + if (totalcount > 0) { + printf("\n*** HARMLESS ERROR COUNT: %u ***\n",totalcount); + } + for (i = 0 ; buf[i]; ++i) { + ++printcount; + DWARF_CHECK_COUNT(harmless_result,1); + DWARF_CHECK_ERROR(harmless_result,buf[i]); + } + if (totalcount > printcount) { + /*harmless_result.checks += (totalcount - printcount); */ + DWARF_CHECK_COUNT(harmless_result,(totalcount - printcount)); + /*harmless_result.errors += (totalcount - printcount); */ + DWARF_ERROR_COUNT(harmless_result,(totalcount - printcount)); + } +} + +static void +print_object_header(UNUSEDARG Elf *elf, + Dwarf_Debug dbg) +{ + /* Check if header information is required */ + if (section_map[DW_HDR_HEADER]) { +#ifdef WIN32 +#ifdef HAVE_ELF32_GETEHDR + /* Standard libelf has no function generating the names of the + encodings, but this libelf apparently does. */ + Elf_Ehdr_Literal eh_literals; + Elf32_Ehdr *eh32; +#ifdef HAVE_ELF64_GETEHDR + Elf64_Ehdr *eh64; +#endif /* HAVE_ELF64_GETEHDR */ + + eh32 = elf32_getehdr(elf); + if (eh32) { + /* Get literal strings for header fields */ + elf32_gethdr_literals(eh32,&eh_literals); + /* Print 32-bit obj header */ + printf("\nObject Header:\ne_ident:\n"); + printf(" File ID = %s\n",eh_literals.e_ident_file_id); + printf(" File class = %02x (%s)\n", + eh32->e_ident[EI_CLASS],eh_literals.e_ident_file_class); + printf(" Data encoding = %02x (%s)\n", + eh32->e_ident[EI_DATA],eh_literals.e_ident_data_encoding); + printf(" File version = %02x (%s)\n", + eh32->e_ident[EI_VERSION],eh_literals.e_ident_file_version); + printf(" OS ABI = %02x (%s) (%s)\n",eh32->e_ident[EI_OSABI], + eh_literals.e_ident_os_abi_s,eh_literals.e_ident_os_abi_l); + printf(" ABI version = %02x (%s)\n", + eh32->e_ident[EI_ABIVERSION], eh_literals.e_ident_abi_version); + printf("e_type : 0x%x (%s)\n", + eh32->e_type,eh_literals.e_type); + printf("e_machine : 0x%x (%s) (%s)\n",eh32->e_machine, + eh_literals.e_machine_s,eh_literals.e_machine_l); + printf("e_version : 0x%x\n", eh32->e_version); + printf("e_entry : 0x%" DW_PR_XZEROS DW_PR_DUx "\n",eh32->e_entry); + printf("e_phoff : 0x%" DW_PR_XZEROS DW_PR_DUx "\n",eh32->e_phoff); + printf("e_shoff : 0x%" DW_PR_XZEROS DW_PR_DUx "\n",eh32->e_shoff); + printf("e_flags : 0x%x\n",eh32->e_flags); + printf("e_ehsize : 0x%x\n",eh32->e_ehsize); + printf("e_phentsize: 0x%x\n",eh32->e_phentsize); + printf("e_phnum : 0x%x\n",eh32->e_phnum); + printf("e_shentsize: 0x%x\n",eh32->e_shentsize); + printf("e_shnum : 0x%x\n",eh32->e_shnum); + printf("e_shstrndx : 0x%x\n",eh32->e_shstrndx); + } + else { +#ifdef HAVE_ELF64_GETEHDR + /* not a 32-bit obj */ + eh64 = elf64_getehdr(elf); + if (eh64) { + /* Get literal strings for header fields */ + elf64_gethdr_literals(eh64,&eh_literals); + /* Print 64-bit obj header */ + printf("\nObject Header:\ne_ident:\n"); + printf(" File ID = %s\n",eh_literals.e_ident_file_id); + printf(" File class = %02x (%s)\n", + eh64->e_ident[EI_CLASS],eh_literals.e_ident_file_class); + printf(" Data encoding = %02x (%s)\n", + eh64->e_ident[EI_DATA],eh_literals.e_ident_data_encoding); + printf(" File version = %02x (%s)\n", + eh64->e_ident[EI_VERSION],eh_literals.e_ident_file_version); + printf(" OS ABI = %02x (%s) (%s)\n",eh64->e_ident[EI_OSABI], + eh_literals.e_ident_os_abi_s,eh_literals.e_ident_os_abi_l); + printf(" ABI version = %02x (%s)\n", + eh64->e_ident[EI_ABIVERSION], eh_literals.e_ident_abi_version); + printf("e_type : 0x%x (%s)\n", + eh64->e_type,eh_literals.e_type); + printf("e_machine : 0x%x (%s) (%s)\n",eh64->e_machine, + eh_literals.e_machine_s,eh_literals.e_machine_l); + printf("e_version : 0x%x\n", eh64->e_version); + printf("e_entry : 0x%" DW_PR_XZEROS DW_PR_DUx "\n",eh64->e_entry); + printf("e_phoff : 0x%" DW_PR_XZEROS DW_PR_DUx "\n",eh64->e_phoff); + printf("e_shoff : 0x%" DW_PR_XZEROS DW_PR_DUx "\n",eh64->e_shoff); + printf("e_flags : 0x%x\n",eh64->e_flags); + printf("e_ehsize : 0x%x\n",eh64->e_ehsize); + printf("e_phentsize: 0x%x\n",eh64->e_phentsize); + printf("e_phnum : 0x%x\n",eh64->e_phnum); + printf("e_shentsize: 0x%x\n",eh64->e_shentsize); + printf("e_shnum : 0x%x\n",eh64->e_shnum); + printf("e_shstrndx : 0x%x\n",eh64->e_shstrndx); + } +#endif /* HAVE_ELF64_GETEHDR */ + } +#endif /* HAVE_ELF32_GETEHDR */ +#endif /* WIN32 */ + } + /* Print basic section information is required */ + /* Mask only known sections (debug and text) bits */ + if (any_section_header_to_print(section_map)) { + int nCount = 0; + int section_index = 0; + int res = 0; + const char *section_name = NULL; + Dwarf_Addr section_addr = 0; + Dwarf_Unsigned section_size = 0; + Dwarf_Error error = 0; + boolean print_it = FALSE; + Dwarf_Unsigned total_bytes = 0; + int printed_sections = 0; + + /* Print section information (name, size, address). */ + nCount = dwarf_get_section_count(dbg); + printf("\nInfo for %d sections:\n" + " Nro Index Address Size(h) Size(d) Name\n",nCount); + /* Ignore section with index=0 */ + for (section_index = 1; section_index < nCount; ++section_index) { + res = dwarf_get_section_info_by_index(dbg,section_index, + §ion_name, + §ion_addr, + §ion_size, + &error); + if (res == DW_DLV_OK) { + print_it = FALSE; + /* Use original mapping */ + /* Check if the section name is a debug section */ + print_it = section_name_is_debug_and_wanted(section_name, + section_map); + if (print_it) { + ++printed_sections; + printf(" %3d " /* nro */ + "0x%03x " /* index */ + "0x%" DW_PR_XZEROS DW_PR_DUx " " /* address */ + "0x%" DW_PR_XZEROS DW_PR_DUx " " /* size (hex) */ + "%" DW_PR_XZEROS DW_PR_DUu " " /* size (dec) */ + "%s\n", /* name */ + printed_sections, + section_index, + section_addr, + section_size, section_size, + section_name); + total_bytes += section_size; + } + } + } + printf("*** Summary: %" DW_PR_DUu " bytes for %d section(s) ***\n", + total_bytes, printed_sections); + } +} + +/* Print checks and errors for a specific compiler */ +static void +print_specific_checks_results(Compiler *pCompiler) +{ + printf("\nDWARF CHECK RESULT\n"); + printf(" \n"); + if (glflags.gf_check_pubname_attr) { + PRINT_CHECK_RESULT("pubname_attr", pCompiler, pubname_attr_result); + } + if (glflags.gf_check_attr_tag) { + PRINT_CHECK_RESULT("attr_tag", pCompiler, attr_tag_result); + } + if (glflags.gf_check_tag_tree) { + PRINT_CHECK_RESULT("tag_tree", pCompiler, tag_tree_result); + } + if (glflags.gf_check_type_offset) { + PRINT_CHECK_RESULT("type_offset", pCompiler, type_offset_result); + } + if (glflags.gf_check_decl_file) { + PRINT_CHECK_RESULT("decl_file", pCompiler, decl_file_result); + } + if (glflags.gf_check_ranges) { + PRINT_CHECK_RESULT("ranges", pCompiler, ranges_result); + } + if (glflags.gf_check_lines) { + PRINT_CHECK_RESULT("line_table", pCompiler, lines_result); + } + if (glflags.gf_check_fdes) { + PRINT_CHECK_RESULT("fde_table", pCompiler, fde_duplication); + } + if (glflags.gf_check_aranges) { + PRINT_CHECK_RESULT("aranges", pCompiler, aranges_result); + } + + if (glflags.gf_check_names) { + PRINT_CHECK_RESULT("names",pCompiler, names_result); + } + if (glflags.gf_check_frames) { + PRINT_CHECK_RESULT("frames",pCompiler, frames_result); + } + if (glflags.gf_check_locations) { + PRINT_CHECK_RESULT("locations",pCompiler, locations_result); + } + + if (glflags.gf_check_harmless) { + PRINT_CHECK_RESULT("harmless_errors", pCompiler, harmless_result); + } + + if (glflags.gf_check_abbreviations) { + PRINT_CHECK_RESULT("abbreviations", pCompiler, abbreviations_result); + } + + if (glflags.gf_check_dwarf_constants) { + PRINT_CHECK_RESULT("dwarf_constants", + pCompiler, dwarf_constants_result); + } + + if (glflags.gf_check_di_gaps) { + PRINT_CHECK_RESULT("debug_info_gaps", pCompiler, di_gaps_result); + } + + if (glflags.gf_check_forward_decl) { + PRINT_CHECK_RESULT("forward_declarations", + pCompiler, forward_decl_result); + } + + if (glflags.gf_check_self_references) { + PRINT_CHECK_RESULT("self_references", + pCompiler, self_references_result); + } + + /* Display attributes encoding results */ + if (glflags.gf_check_attr_encoding) { + PRINT_CHECK_RESULT("attr_encoding", pCompiler, attr_encoding_result); + } + + /* Duplicated attributes */ + if (glflags.gf_check_duplicated_attributes) { + PRINT_CHECK_RESULT("duplicated_attributes", + pCompiler, duplicated_attributes_result); + } + + PRINT_CHECK_RESULT("** Summarize **",pCompiler, total_check_result); + fflush(stdout); +} + +static int +qsort_compare_compiler(const void *elem1,const void *elem2) +{ + Compiler cmp1 = *(Compiler *)elem1; + Compiler cmp2 = *(Compiler *)elem2; + int cnt1 = cmp1.results[total_check_result].errors; + int cnt2 = cmp2.results[total_check_result].errors; + + if (cnt1 < cnt2) { + return 1; + } else if (cnt1 > cnt2) { + return -1; + } + /* When error counts match, sort on name. */ + { + int v = strcmp(cmp2.name, cmp1.name); + return v; + } +} + +/* Print a summary of search results */ +static void +print_search_results(void) +{ + const char *search_type = 0; + const char *search_text = 0; + if (search_any_text) { + search_type = "any"; + search_text = search_any_text; + } else { + if (search_match_text) { + search_type = "match"; + search_text = search_match_text; + } else { + search_type = "regex"; + search_text = search_regex_text; + } + } + fflush(stdout); + fflush(stderr); + printf("\nSearch type : '%s'\n",search_type); + printf("Pattern searched : '%s'\n",search_text); + printf("Occurrences Found: %d\n",search_occurrences); + fflush(stdout); +} + +/* Print a summary of checks and errors */ +static void +print_checks_results(void) +{ + int index = 0; + Compiler *pCompilers; + Compiler *pCompiler; + + /* Sort based on errors detected; the first entry is reserved */ + pCompilers = &compilers_detected[1]; + qsort((void *)pCompilers,compilers_detected_count, + sizeof(Compiler),qsort_compare_compiler); + + /* Print list of CUs for each compiler detected */ + if (glflags.gf_producer_children_flag) { + + a_name_chain *nc = 0; + a_name_chain *nc_next = 0; + int count = 0; + int total = 0; + + printf("\n*** CU NAMES PER COMPILER ***\n"); + for (index = 1; index <= compilers_detected_count; ++index) { + pCompiler = &compilers_detected[index]; + printf("\n%02d: %s",index,pCompiler->name); + count = 0; + for (nc = pCompiler->cu_list; nc; nc = nc_next) { + printf("\n %02d: '%s'",++count,nc->item); + nc_next = nc->next; + free(nc); + } + total += count; + printf("\n"); + } + printf("\nDetected %d CU names\n",total); + } + + /* Print error report only if errors have been detected */ + /* Print error report if the -kd option */ + if ((glflags.gf_do_check_dwarf && check_error) || + glflags.gf_check_show_results) { + int count = 0; + int compilers_not_detected = 0; + int compilers_verified = 0; + + /* Find out how many compilers have been verified. */ + for (index = 1; index <= compilers_detected_count; ++index) { + if (compilers_detected[index].verified) { + ++compilers_verified; + } + } + /* Find out how many compilers have been not detected. */ + for (index = 1; index <= compilers_targeted_count; ++index) { + if (!compilers_targeted[index].verified) { + ++compilers_not_detected; + } + } + + /* Print compilers detected list */ + printf( + "\n%d Compilers detected:\n",compilers_detected_count); + for (index = 1; index <= compilers_detected_count; ++index) { + pCompiler = &compilers_detected[index]; + printf("%02d: %s\n",index,pCompiler->name); + } + + /* Print compiler list specified by the user with the + '-c', that were not detected. */ + if (compilers_not_detected) { + count = 0; + printf( + "\n%d Compilers not detected:\n",compilers_not_detected); + for (index = 1; index <= compilers_targeted_count; ++index) { + if (!compilers_targeted[index].verified) { + printf( + "%02d: '%s'\n", + ++count,compilers_targeted[index].name); + } + } + } + + count = 0; + printf("\n%d Compilers verified:\n",compilers_verified); + for (index = 1; index <= compilers_detected_count; ++index) { + pCompiler = &compilers_detected[index]; + if (pCompiler->verified) { + printf("%02d: errors = %5d, %s\n", + ++count, + pCompiler->results[total_check_result].errors, + pCompiler->name); + } + } + + /* Print summary if we have verified compilers or + if the -kd option used. */ + if (compilers_verified || glflags.gf_check_show_results) { + /* Print compilers detected summary*/ + if (glflags.gf_print_summary_all) { + count = 0; + printf("\n*** ERRORS PER COMPILER ***\n"); + for (index = 1; index <= compilers_detected_count; ++index) { + pCompiler = &compilers_detected[index]; + if (pCompiler->verified) { + printf("\n%02d: %s", + ++count,pCompiler->name); + print_specific_checks_results(pCompiler); + } + } + } + + /* Print general summary (all compilers checked) */ + printf("\n*** TOTAL ERRORS FOR ALL COMPILERS ***\n"); + print_specific_checks_results(&compilers_detected[0]); + } + } + fflush(stdout); +} + +/* This is for dwarf_print_lines() */ +static void +printf_callback_for_libdwarf(UNUSEDARG void *userdata, + const char *data) +{ + printf("%s",data); +} + + +/* Does not return on error. */ +void +get_address_size_and_max(Dwarf_Debug dbg, + Dwarf_Half * size, + Dwarf_Addr * max, + Dwarf_Error *aerr) +{ + int dres = 0; + Dwarf_Half lsize = 4; + /* Get address size and largest representable address */ + dres = dwarf_get_address_size(dbg,&lsize,aerr); + if (dres != DW_DLV_OK) { + print_error(dbg, "get_address_size()", dres, *aerr); + } + if(max) { + *max = (lsize == 8 ) ? 0xffffffffffffffffULL : 0xffffffff; + } + if(size) { + *size = lsize; + } +} + + +/* dbg is often null when dbgtied was passed in. */ +static void +dbgsetup(Dwarf_Debug dbg,struct dwconf_s *setup_config_file_data) +{ + if (!dbg) { + return; + } + dwarf_set_frame_rule_initial_value(dbg, + setup_config_file_data->cf_initial_rule_value); + dwarf_set_frame_rule_table_size(dbg, + setup_config_file_data->cf_table_entry_count); + dwarf_set_frame_cfa_value(dbg, + setup_config_file_data->cf_cfa_reg); + dwarf_set_frame_same_value(dbg, + setup_config_file_data->cf_same_val); + dwarf_set_frame_undefined_value(dbg, + setup_config_file_data->cf_undefined_val); + if (setup_config_file_data->cf_address_size) { + dwarf_set_default_address_size(dbg, + setup_config_file_data->cf_address_size); + } + dwarf_set_harmless_error_list_size(dbg,50); +} + +/* Callable at any time, Sets section sizes with the sizes + known as of the call. + Repeat whenever about to reference a size that might not + have been set as of the last call. */ +static void +set_global_section_sizes(Dwarf_Debug dbg) +{ + dwarf_get_section_max_offsets_c(dbg, + §ion_high_offsets_global.debug_info_size, + §ion_high_offsets_global.debug_abbrev_size, + §ion_high_offsets_global.debug_line_size, + §ion_high_offsets_global.debug_loc_size, + §ion_high_offsets_global.debug_aranges_size, + §ion_high_offsets_global.debug_macinfo_size, + §ion_high_offsets_global.debug_pubnames_size, + §ion_high_offsets_global.debug_str_size, + §ion_high_offsets_global.debug_frame_size, + §ion_high_offsets_global.debug_ranges_size, + §ion_high_offsets_global.debug_pubtypes_size, + §ion_high_offsets_global.debug_types_size, + §ion_high_offsets_global.debug_macro_size, + §ion_high_offsets_global.debug_str_offsets_size, + §ion_high_offsets_global.debug_sup_size, + §ion_high_offsets_global.debug_cu_index_size, + §ion_high_offsets_global.debug_tu_index_size); +} + +/* + Given a file which we know is an elf file, process + the dwarf data. + +*/ +static int +process_one_file(Elf * elf,Elf *elftied, + const char * file_name, + const char * tied_file_name, + int archive, + struct dwconf_s *l_config_file_data) +{ + Dwarf_Debug dbg = 0; + Dwarf_Debug dbgtied = 0; + int dres = 0; + struct Dwarf_Printf_Callback_Info_s printfcallbackdata; + Dwarf_Half elf_address_size = 0; /* Target pointer size */ + Dwarf_Error onef_err = 0; + + /* If using a tied file group number should be 2 DW_GROUPNUMBER_DWO + but in a dwp or separate-split-dwarf object then + 0 will find the .dwo data automatically. */ + dres = dwarf_elf_init_b(elf, DW_DLC_READ,group_number, + NULL, NULL, &dbg, &onef_err); + if (dres == DW_DLV_NO_ENTRY) { + if (group_number > 0) { + printf("No DWARF information present in %s " + "for section group %d \n", file_name,group_number); + } else { + printf("No DWARF information present in %s\n",file_name); + } + return 0; + } + if (dres != DW_DLV_OK) { + print_error(dbg, "dwarf_elf_init", dres, onef_err); + } + + if (elftied) { + /* The tied file we define as group 1, BASE. */ + dres = dwarf_elf_init_b(elftied, DW_DLC_READ, + DW_GROUPNUMBER_BASE, NULL, NULL, &dbgtied, + &onef_err); + if (dres == DW_DLV_NO_ENTRY) { + printf("No DWARF information present in tied file: %s\n", + tied_file_name); + return 0; + } + if (dres != DW_DLV_OK) { + print_error(dbg, "dwarf_elf_init on tied_file", dres, onef_err); + } + } + + memset(&printfcallbackdata,0,sizeof(printfcallbackdata)); + printfcallbackdata.dp_fptr = printf_callback_for_libdwarf; + dwarf_register_printf_callback(dbg,&printfcallbackdata); + if (dbgtied) { + dwarf_register_printf_callback(dbgtied,&printfcallbackdata); + } + memset(&printfcallbackdata,0,sizeof(printfcallbackdata)); + + + + if (archive) { + Elf_Arhdr *mem_header = elf_getarhdr(elf); + const char *memname = + (mem_header && mem_header->ar_name)? + mem_header->ar_name:""; + + printf("\narchive member \t%s\n",sanitized(memname)); + } + dbgsetup(dbg,l_config_file_data); + dbgsetup(dbgtied,l_config_file_data); + get_address_size_and_max(dbg,&elf_address_size,0,&onef_err); + + /* Ok for dbgtied to be NULL. */ + dres = dwarf_set_tied_dbg(dbg,dbgtied,&onef_err); + if (dres != DW_DLV_OK) { + print_error(dbg, "dwarf_set_tied_dbg() failed", dres, onef_err); + } + + /* Get .text and .debug_ranges info if in check mode */ + if (glflags.gf_do_check_dwarf) { + Dwarf_Addr lower = 0; + Dwarf_Addr upper = 0; + Dwarf_Unsigned size = 0; + int res = 0; + res = dwarf_get_section_info_by_name(dbg,".text",&lower,&size,&onef_err); + if (DW_DLV_OK == res) { + upper = lower + size; + } + + /* Set limits for Ranges Information */ + if (pRangesInfo) { + SetLimitsBucketGroup(pRangesInfo,lower,upper); + } + + /* Build section information */ + build_linkonce_info(dbg); + } + + if (glflags.gf_header_flag) { + print_object_header(elf,dbg); + } + + if (glflags.gf_section_groups_flag) { + print_section_groups_data(dbg); + /* If groupnum > 2 this turns off some + of the gf_flags here so we don't print + section names of things we do not + want to print. */ + update_section_flags_per_groups(dbg); + } + + reset_overall_CU_error_data(); + if (glflags.gf_info_flag || glflags.gf_line_flag || + glflags.gf_types_flag || + glflags.gf_check_macros || glflags.gf_macinfo_flag || + glflags.gf_macro_flag || + glflags.gf_cu_name_flag || glflags.gf_search_is_on || + glflags.gf_producer_children_flag) { + + print_infos(dbg,TRUE); + reset_overall_CU_error_data(); + print_infos(dbg,FALSE); + if (glflags.gf_check_macros) { + set_global_section_sizes(dbg); + if(macro_check_tree) { + /* Fake item representing end of section. */ + /* Length of the fake item is zero. */ + print_macro_statistics("DWARF5 .debug_macro", + ¯o_check_tree, + section_high_offsets_global.debug_macro_size); + } + if(macinfo_check_tree) { + /* Fake item representing end of section. */ + /* Length of the fake item is zero. */ + print_macro_statistics("DWARF2 .debug_macinfo", + &macinfo_check_tree, + section_high_offsets_global.debug_macinfo_size); + } + } + clear_macro_statistics(¯o_check_tree); + clear_macro_statistics(&macinfo_check_tree); + } + if (glflags.gf_gdbindex_flag) { + reset_overall_CU_error_data(); + /* By definition if gdb_index is present + then "cu" and "tu" will not be. And vice versa. */ + print_gdb_index(dbg); + print_debugfission_index(dbg,"cu"); + print_debugfission_index(dbg,"tu"); + } + if (glflags.gf_pubnames_flag) { + reset_overall_CU_error_data(); + print_pubnames(dbg); + } + if (glflags.gf_loc_flag) { + reset_overall_CU_error_data(); + print_locs(dbg); + } + if (glflags.gf_abbrev_flag) { + reset_overall_CU_error_data(); + print_abbrevs(dbg); + } + if (glflags.gf_string_flag) { + reset_overall_CU_error_data(); + print_strings(dbg); + } + if (glflags.gf_aranges_flag) { + reset_overall_CU_error_data(); + print_aranges(dbg); + } + if (glflags.gf_ranges_flag) { + reset_overall_CU_error_data(); + print_ranges(dbg); + } + if (glflags.gf_frame_flag || glflags.gf_eh_frame_flag) { + reset_overall_CU_error_data(); + current_cu_die_for_print_frames = 0; + print_frames(dbg, glflags.gf_frame_flag, + glflags.gf_eh_frame_flag, l_config_file_data); + } + if (glflags.gf_static_func_flag) { + reset_overall_CU_error_data(); + print_static_funcs(dbg); + } + if (glflags.gf_static_var_flag) { + reset_overall_CU_error_data(); + print_static_vars(dbg); + } + /* DWARF_PUBTYPES is the standard typenames dwarf section. + SGI_TYPENAME is the same concept but is SGI specific ( it was + defined 10 years before dwarf pubtypes). */ + + if (glflags.gf_pubtypes_flag) { + reset_overall_CU_error_data(); + print_types(dbg, DWARF_PUBTYPES); + reset_overall_CU_error_data(); + print_types(dbg, SGI_TYPENAME); + } + if (glflags.gf_weakname_flag) { + reset_overall_CU_error_data(); + print_weaknames(dbg); + } + if (glflags.gf_reloc_flag) { + reset_overall_CU_error_data(); + print_relocinfo(dbg, reloc_map); + } + if (glflags.gf_debug_names_flag) { + reset_overall_CU_error_data(); + print_debug_names(dbg); + } + + /* Print search results */ + if (glflags.gf_search_print_results && glflags.gf_search_is_on) { + print_search_results(); + } + + /* The right time to do this is unclear. But we need to do it. */ + if (glflags.gf_check_harmless) { + print_any_harmless_errors(dbg); + } + + /* Print error report only if errors have been detected */ + /* Print error report if the -kd option */ + print_checks_results(); + + /* Print the detailed attribute usage space + and free the attributes_encoding data allocated. */ + if (glflags.gf_check_attr_encoding) { + print_attributes_encoding(dbg); + } + + /* Print the tags and attribute usage */ + if (glflags.gf_print_usage_tag_attr) { + print_tag_attributes_usage(dbg); + } + + /* Could finish dbg first. Either order ok. */ + if (dbgtied) { + dres = dwarf_finish(dbgtied,&onef_err); + if (dres != DW_DLV_OK) { + print_error(dbg, "dwarf_finish on dbgtied", dres, onef_err); + } + dbgtied = 0; + } + groups_restore_subsidiary_flags(); + dres = dwarf_finish(dbg, &onef_err); + if (dres != DW_DLV_OK) { + print_error(dbg, "dwarf_finish", dres, onef_err); + dbg = 0; + } + printf("\n"); + clean_up_syms_malloc_data(); + destruct_abbrev_array(); + helpertree_clear_statistics(&helpertree_offsets_base_info); + helpertree_clear_statistics(&helpertree_offsets_base_types); + return 0; +} + +/* Do printing of most sections. + Do not do detailed checking. +*/ +static void +do_all(void) +{ + glflags.gf_frame_flag = TRUE; + glflags.gf_info_flag = TRUE; + glflags.gf_types_flag = TRUE; /* .debug_types */ + glflags.gf_line_flag = TRUE; + glflags.gf_pubnames_flag = TRUE; + glflags.gf_macinfo_flag = TRUE; + glflags.gf_macro_flag = TRUE; + glflags.gf_aranges_flag = TRUE; + /* Do not do + glflags.gf_loc_flag = TRUE + glflags.gf_abbrev_flag = TRUE; + glflags.gf_ranges_flag = TRUE; + because nothing in + the DWARF spec guarantees the sections are free of random bytes + in areas not referenced by .debug_info */ + glflags.gf_string_flag = TRUE; + /* Do not do + glflags.gf_reloc_flag = TRUE; + as print_relocs makes no sense for non-elf dwarfdump users. */ + glflags.gf_static_func_flag = TRUE; /* SGI only*/ + glflags.gf_static_var_flag = TRUE; /* SGI only*/ + glflags.gf_pubtypes_flag = TRUE; /* both SGI typenames and dwarf_pubtypes. */ + glflags.gf_weakname_flag = TRUE; /* SGI only*/ + glflags.gf_header_flag = TRUE; /* Dump header info */ + glflags.gf_debug_names_flag = TRUE; +} + +static const char *usage_text[] = { +"Usage: DwarfDump ", +"options:\t-a\tprint all .debug_* sections", +"\t\t-b\tprint abbrev section", +"\t\t-c\tprint loc section", +"\t\t-c\tcheck only specific compiler objects", +"\t\t \t is described by 'DW_AT_producer'. Examples:", +"\t\t \t -cg check only GCC compiler objects", +"\t\t \t -cs check only SNC compiler objects", +"\t\t \t -c'350.1' check only compiler objects with 350.1 in the CU name", +"\t\t-C\tactivate printing (with -i) of warnings about", +"\t\t\tcertain common extensions of DWARF.", +"\t\t-d\tdense: one line per entry (info section only)", +"\t\t-D\tdo not show offsets", /* Do not show any offsets */ +"\t\t-e\tellipsis: short names for tags, attrs etc.", +"\t\t-E[hliaprfoRstxd]\tprint object Header and/or section information", +"\t\t \th=header,l=line,i=info,a=abbrev,p=pubnames,r=aranges,", +"\t\t \tf=frames,o=loc,R=Ranges,s=strings,t=pubtypes,x=text,", +"\t\t \td=default sections, same as -E and {liaprfoRstx}", +"\t\t-f\tprint dwarf frame section", +"\t\t-F\tprint gnu .eh_frame section", +"\t\t-g\t(use incomplete loclist support)", +"\t\t-G\tshow global die offsets", +"\t\t-h\tprint IRIX exception tables (unsupported)", +"\t\t-H \tlimit output to the first major units", +"\t\t\t example: to stop after compilation units", +"\t\t-i\tprint info section", +"\t\t-I\tprint sections .gdb_index, .debug_cu_index, .debug_tu_index", +/* FIXME -kw is check macros */ +"\t\t-k[abcdDeEfFgGilmMnrRsStu[f]x[e]y] check dwarf information", +"\t\t a\tdo all checks", +"\t\t b\tcheck abbreviations", /* Check abbreviations */ +"\t\t c\texamine DWARF constants", /* Check for valid DWARF constants */ +"\t\t d\tshow check results", /* Show check results */ +"\t\t D\tcheck duplicated attributes", /* Duplicated attributes */ +"\t\t e\texamine attributes of pubnames", +"\t\t E\texamine attributes encodings", /* Attributes encoding */ +"\t\t f\texamine frame information (use with -f or -F)", +"\t\t F\texamine integrity of files-lines attributes", /* Files-Lines integrity */ +"\t\t g\tcheck debug info gaps", /* Check for debug info gaps */ +"\t\t G\tprint only unique errors", /* Only print the unique errors */ +"\t\t i\tdisplay summary for all compilers", /* Summary all compilers */ +"\t\t l\tcheck location list (.debug_loc)", /* Location list integrity */ +"\t\t m\tcheck ranges list (.debug_ranges)", /* Ranges list integrity */ +"\t\t M\tcheck ranges list (.debug_aranges)",/* Aranges list integrity */ +"\t\t n\texamine names in attributes", /* Check for valid names */ +"\t\t r\texamine tag-attr relation", +"\t\t R\tcheck forward references to DIEs (declarations)", /* Check DW_AT_specification references */ +"\t\t s\tperform checks in silent mode", +"\t\t S\tcheck self references to DIEs", +"\t\t t\texamine tag-tag relations", +#ifdef HAVE_USAGE_TAG_ATTR +"\t\t u\tprint tag-tree and tag-attribute usage (basic format)", +"\t\t uf\tprint tag-tree and tag-attribute usage (full format)", +#endif /* HAVE_USAGE_TAG_ATTR */ +"\t\t x\tbasic frames check (.eh_frame, .debug_frame)", +"\t\t xe\textensive frames check (.eh_frame, .debug_frame)", +"\t\t y\texamine type info", +"\t\t\tUnless -C option given certain common tag-attr and tag-tag", +"\t\t\textensions are assumed to be ok (not reported).", +"\t\t-l[s]\tprint line section", +"\t\t s\tdo not print address", +"\t\t-m\tprint macinfo section", +"\t\t-M\tprint the form name for each attribute", +"\t\t-n\tsuppress frame information function name lookup", +"\t\t \t(when printing frame information from multi-gigabyte", +"\t\t \tobject files this option may save significant time).", +"\t\t-N\tprint ranges section", +"\t\t-O file=\tname the output file", +"\t\t-o[liaprfoR]\tprint relocation info", +"\t\t \tl=line,i=info,a=abbrev,p=pubnames,r=aranges,f=frames,o=loc,R=Ranges", +"\t\t-p\tprint pubnames section", +"\t\t-P\tprint list of compile units per producer", /* List of CUs per compiler */ +"\t\t-Q\tsuppress printing section data", +"\t\t-r\tprint aranges section", +"\t\t-R\tPrint frame register names as r33 etc", +"\t\t \t and allow up to 1200 registers.", +"\t\t \t Print using a 'generic' register set.", +"\t\t-s\tprint string section", +"\t\t-S[v]