Kai, that seems to have worked.  Thank you!  I was really stuck if you
hadn't fixed that.  When is the fix you just made going to be
released?  It seems for now people have to get it from the svn repo on
sourceforge.

FYI here are my current install instructions for my project for how to
install elftoolchain on 64-bit Ubuntu.  As you can see, I seem to have
to work around a lot of stuff that seems unnecessary.  I don't know if
all of these are still relevant, but they used to be.  You do have
install instructions for installing somewhere other than the default
system locations, so perhaps that paragraph is not relevant.

----
The elftoolchain-0.6.1/INSTALL will tell you what dependencies to
install; for the latest Ubuntu, this seems to be what they want and
seems to work:

    $ sudo apt-get install bison flex gcc libarchive-dev m4 pmake \
      libexpat1-dev python-yaml sharutils zlib1g-dev

The build process will stop and tell you to do this if you do not do
it initially:

    Please download the distribution from:
    
http://tetworks.opengroup.org/downloads/38/software/Sources/3.8/tet3.8-src.tar.gz
    and unpack it into directory "../../test/tet/tet3.8".

The tet3.8-src.tar.gz file unpacks into a dir named tet3.8 and the
message above means to put it into elftoolchain-0.6.1/test/tet/.

There does not seem to be a configure step.  Note that when building
on Linux, the instructions are wrong: just using pmake will not work,
you must invoke it as follows:

    $ NOGCCERROR=1 pmake

You must install elftoolchain in order to build against it; it is not
enough to just use +-I+ and +-L+ flags as the internal headers within
elftoolchain will not find each other.  Or, if there is a way to do
it, I do not know how.

    $ sudo pmake install

The current version of elftoolchain-0.6.1 has a bug where the install
target does not install the header files into /usr/include, so you
have to do it yourself.

    $ cd elftoolchain-0.6.1/
    $ sudo cp ./libelf/libelf.h ./libelf/gelf.h
      ./common/elfdefinitions.h ./libelftc/libelftc.h
      ./libdwarf/libdwarf.h ./libdwarf/dwarf.h /usr/include/



On Wed, Feb 18, 2015 at 6:38 PM, Daniel Wilkerson
<daniel.wilker...@gmail.com> wrote:
> That got me past that build error; still building.
>
> I suggest you add that to the INSTALL dependencies list; I don't see it there.
>
> Also, you might want to give the URL for the tet project in the INSTALL.
>
> On Wed, Feb 18, 2015 at 6:33 PM, Kai Wang <kaiwan...@gmail.com> wrote:
>> Did you install the zlib dev version?
>>
>> sudo apt-get install zlib1g-dev
>>
>> /Kai
>>
>> On Thu, Feb 19, 2015 at 3:31 AM, Daniel Wilkerson
>> <daniel.wilker...@gmail.com> wrote:
>>>
>>> What is -lz?  I did an apt-get install zlibc, but that isn't it.
>>>
>>> cc  -L../libelf -L../libelftc  -o ar ar.o read.o util.o write.o
>>> acplex.o acpyacc.o -larchive -lelftc -lelf -lz
>>> /usr/bin/ld: cannot find -lz
>>> collect2: error: ld returned 1 exit status
>>> *** Error code 1
>>>
>>> Stop.
>>> pmake[1]: stopped in /home/dsw/elftoolchain-code-0.6.1-r3164/ar
>>> *** Error code 1
>>>
>>> Stop.
>>> pmake: stopped in /home/dsw/elftoolchain-code-0.6.1-r3164
>>>
>>> On Wed, Feb 18, 2015 at 5:21 PM, Kai Wang <kaiwan...@gmail.com> wrote:
>>> > Daniel,
>>> >
>>> > This should be fixed in r3164. Could you verify?
>>> >
>>> > DWARF4 line section added a new field in the header and I missed that.
>>> > More work will probably be needed later but now the parsing part should
>>> > be
>>> > ok.
>>> >
>>> > /Kai
>>> >
>>> > On Wed, Feb 18, 2015 at 7:31 AM, Daniel Wilkerson
>>> > <daniel.wilker...@gmail.com> wrote:
>>> >>
>>> >> I tried using elftoolchain to parse the dwarf source line annotation
>>> >> output of vanilla gcc 4.9.2 and it works just fine.  In contrast, as
>>> >> stated below, parsing the output of the riscv-gcc 4.9.2 produces the
>>> >> error below: "Line info section too short".  Clearly this is a problem
>>> >> introduced by the riscv people.
>>> >>
>>> >> However, objdump parses the dwarf source line output of both compilers
>>> >> without complaint.  So if I report the bug to the riscv people at
>>> >> Berkeley that their compiler produces output that objdump likes but
>>> >> that elftoolchain will not parse, they can easily say that this is a
>>> >> bug in elftoolchain.
>>> >>
>>> >> I am basically blocked on this issue, so I am now in bug hell.  Any
>>> >> assistance would be greatly appreciated.  Can elftoolchain be made a
>>> >> bit more tolerant?  I will also write the riscv people.
>>> >>
>>> >> On Mon, Feb 16, 2015 at 1:07 PM, Daniel Wilkerson
>>> >> <daniel.wilker...@gmail.com> wrote:
>>> >> > The RISC-V people at Berkeley have modified gcc 4.9.2 to target the
>>> >> > RISC-V ISA.  I have been able to use elftoolchain to parse the output
>>> >> > of previous versions of gcc which they have hacked, but not this one.
>>> >> > When I try to get the dwarf source lines from ELF they produce, as
>>> >> > follows:
>>> >> >
>>> >> > int const dwarf_src_res =
>>> >> >       dwarf_srclines(root_die, &lines, &num_lines, &dwarf_error);
>>> >> > . . .
>>> >> > fprintf(stderr, "Dwarf_Source_Lines:"
>>> >> >             "DW_DLE_NO_ENTRY:%d, DW_DLV_OK:%d, "
>>> >> >             "dwarf_src_res: %d\n",
>>> >> >             DW_DLE_NO_ENTRY, DW_DLV_OK, dwarf_src_res);
>>> >> > . . .
>>> >> > dwarf_errmsg(dwarf_error)
>>> >> >
>>> >> > I get a dwarf_src_res of 1:
>>> >> > Dwarf_Source_Lines:DW_DLE_NO_ENTRY:4, DW_DLV_OK:0, dwarf_src_res: 1
>>> >> >
>>> >> > And this error message:
>>> >> > Line info section too short [_dwarf_lineno_init(335)]
>>> >> >
>>> >> > However objdump reads and will output the source lines of the same
>>> >> > ELF
>>> >> > file.
>>> >> >
>>> >> > Is anyone else getting this result parsing the DWARF source lines
>>> >> > coming from, say, unmodified gcc 4.9.2 ?
>>> >> >
>>> >> > Daniel
>>> >>
>>> >>
>>> >>
>>> >> ------------------------------------------------------------------------------
>>> >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> >> from Actuate! Instantly Supercharge Your Business Reports and
>>> >> Dashboards
>>> >> with Interactivity, Sharing, Native Excel Exports, App Integration &
>>> >> more
>>> >> Get technology previously reserved for billion-dollar corporations,
>>> >> FREE
>>> >>
>>> >>
>>> >> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
>>> >> _______________________________________________
>>> >> Elftoolchain-developers mailing list
>>> >> Elftoolchain-developers@lists.sourceforge.net
>>> >> https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers
>>> >
>>> >
>>
>>

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Elftoolchain-developers mailing list
Elftoolchain-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/elftoolchain-developers

Reply via email to