public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/19705] New: Can't build from HEAD without change
@ 2016-01-01  0:00 michi.henning at canonical dot com
  2016-01-01  0:00 ` [Bug default/19705] " michi.henning at canonical dot com
  2016-01-01  0:00 ` dodji at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: michi.henning at canonical dot com @ 2016-01-01  0:00 UTC (permalink / raw)
  To: libabigail

https://sourceware.org/bugzilla/show_bug.cgi?id=19705

            Bug ID: 19705
           Summary: Can't build from HEAD without change
           Product: libabigail
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: michi.henning at canonical dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

I'm not sure whether this really is a bug or not, so this is just in case...

I cloned the git repository and tried to build from source, following the
instructions at https://www.sourceware.org/libabigail/

I found that I had to install a few extra packages that weren't mentioned in
the build instructions:

elfutils, libtool, libelf-dev, libdw-dev

It might be nice to mention these in the doc.

After running configure/make, I got a whole bunch of failures caused by
unresolved externals to pthread_create() and the like. I fixed it by adding
-pthread to tests/Makefile.am and tools/Makefile.am.

git diff is:

diff --git a/tests/Makefile.am b/tests/Makefile.am
index caf49e6..36f3f29 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,6 +14,8 @@ CXX11_TESTS += runtestsvg
 AM_CXXFLAGS = "-std=gnu++11"
 endif

+AM_LDFLAGS = -pthread
+
 TESTS=                         \
 runtestreaddwarf               \
 runtestcanonicalizetypes.sh    \
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 6125842..de2dcad 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -8,6 +8,8 @@ endif

 noinst_PROGRAMS = abisym abinilint

+AM_LDFLAGS = -pthread
+
 if ENABLE_ZIP_ARCHIVE
 abiar_SOURCES = abiar.cc
 abiardir = $(bindir)
@@ -32,7 +34,7 @@ abisym_LDADD = ../src/libabigail.la

 abinilint_SOURCES = binilint.cc
 abinilintdir = $(bindir)
-abinilint_LDFLAGS = $(abs_top_builddir)/src/libabigail.la
+abinilint_LDADD = $(abs_top_builddir)/src/libabigail.la

 abicompat_SOURCES = abicompat.cc
 abicompatdir = $(bindir)
@@ -41,6 +43,5 @@ abicompat_LDADD = $(abs_top_builddir)/src/libabigail.la
 abipkgdiff_SOURCES = abipkgdiff.cc
 abipkgdiffdir = $(bindir)
 abipkgdiff_LDADD = $(abs_top_builddir)/src/libabigail.la
-abipkgdiff_LDFLAGS = -pthread

 AM_CPPFLAGS=-I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/tools -fPIC

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug default/19705] Can't build from HEAD without change
  2016-01-01  0:00 [Bug default/19705] New: Can't build from HEAD without change michi.henning at canonical dot com
  2016-01-01  0:00 ` [Bug default/19705] " michi.henning at canonical dot com
@ 2016-01-01  0:00 ` dodji at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dodji at redhat dot com @ 2016-01-01  0:00 UTC (permalink / raw)
  To: libabigail

https://sourceware.org/bugzilla/show_bug.cgi?id=19705

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from dodji at redhat dot com ---
Thank you for taking the time to file this problem report.

> elfutils, libtool, libelf-dev, libdw-dev
> 
> It might be nice to mention these in the doc.

Right.  I guess you mean the COMPILING file in the source tree.  elfutils at
least is mentioned at https://www.sourceware.org/libabigail/#compile.

I need to add libtool there.  The COMPILING file is rather completely out of
date, I'll update it.  And I'll update the website too.

As for libelf-dev and libdw-dev, they should be part of the development variant
of elfutils, shouldn't they?  On my system, for instance, trying to install
elfutils-devel will install the packages necessary for the libraries (and
header files) of libelf and libdw.  Those two components are parts of the
elfutils project anyway.

I am asking this just so that I can in the docs to install the development
variants of the 'elfutils' package, without having to go into the specifics of
how each distro splits up its things.

In the mean time, I am committing this change into master to fix things
somewhat:
https://sourceware.org/git/gitweb.cgi?p=libabigail.git;a=commitdiff;h=f48c0ef201a9d3051d34f1966a03fcc367fa62c8

> After running configure/make, I got a whole bunch of failures caused by
> unresolved externals to pthread_create() and the like. I fixed it by adding
> -pthread to tests/Makefile.am and tools/Makefile.am.

Weird, obviously, I don't get this on my system.

> git diff is:
> 
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index caf49e6..36f3f29 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -14,6 +14,8 @@ CXX11_TESTS += runtestsvg
>  AM_CXXFLAGS = "-std=gnu++11"
>  endif
>  
> +AM_LDFLAGS = -pthread

This hunk makes all test binaries link with pthread, even those that don't need
it directly.  I'd rather have the tests that need pthreads *directly* to link
with it, and only those.

I think what is making all the test binaries blow up at link time is that
libabigail.so now uses pthreads, via the abigail::workers namespace.  And I
forgot the make the library itself link with pthread.  And your system might be
using more aggressive linking flags than mine :-)

So I think we should rather make libabigail.so itself link with pthreads.


>  TESTS=                         \
>  runtestreaddwarf               \
>  runtestcanonicalizetypes.sh    \
> diff --git a/tools/Makefile.am b/tools/Makefile.am
> index 6125842..de2dcad 100644
> --- a/tools/Makefile.am
> +++ b/tools/Makefile.am
> @@ -8,6 +8,8 @@ endif
>  
>  noinst_PROGRAMS = abisym abinilint
>  
> +AM_LDFLAGS = -pthread
> +

I have the same comment for the tools.  the only program using pthreads
directly in the tools is abipkgdiff.  Thus, no other tool should link with
pthreads.

[...]

> -abinilint_LDFLAGS = $(abs_top_builddir)/src/libabigail.la
> +abinilint_LDADD = $(abs_top_builddir)/src/libabigail.la

Ah, this one is a real typo.  Thanks for spotting that!

[...]

So, I have committed this patch to the master git branch, to make libabigail.so
itself to link with pthreads and fix the typo above:
https://sourceware.org/git/gitweb.cgi?p=libabigail.git;a=commitdiff;h=12d56c861b77a0a462f59c90315c7ae6f94d658a

Hopefully the two patches should address your issues.

Please re-open the bug if you feel like they don't.

Thank you a lot for your time!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug default/19705] Can't build from HEAD without change
  2016-01-01  0:00 [Bug default/19705] New: Can't build from HEAD without change michi.henning at canonical dot com
@ 2016-01-01  0:00 ` michi.henning at canonical dot com
  2016-01-01  0:00 ` dodji at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: michi.henning at canonical dot com @ 2016-01-01  0:00 UTC (permalink / raw)
  To: libabigail

https://sourceware.org/bugzilla/show_bug.cgi?id=19705

--- Comment #2 from Michi Henning <michi.henning at canonical dot com> ---
(In reply to dodji from comment #1)
> Thank you for taking the time to file this problem report.
>  
> > elfutils, libtool, libelf-dev, libdw-dev
> > 
> > It might be nice to mention these in the doc.
> 
> Right.  I guess you mean the COMPILING file in the source tree.  elfutils at
> least is mentioned at https://www.sourceware.org/libabigail/#compile.

No, I was looking at the instructions here:

https://www.sourceware.org/libabigail/

> As for libelf-dev and libdw-dev, they should be part of the development
> variant of elfutils, shouldn't they?  On my system, for instance, trying to
> install elfutils-devel will install the packages necessary for the libraries
> (and header files) of libelf and libdw.  Those two components are parts of
> the elfutils project anyway.

It looks like, on Ubuntu, libelf-dev doesn't drag in libdw-dev. Instead,
libdw-dev requires libelf-dev. When I tried to resolve the package
dependencies, I installed libelf-dev first and then found that I need to
install libdw-dev too.

> I am asking this just so that I can in the docs to install the development
> variants of the 'elfutils' package, without having to go into the specifics
> of how each distro splits up its things.

Yes, the different packaging for distros is a headache. It's not a big deal--I
mean, it wasn't exactly rocket science to figure out the missing dependencies
:-)

> Weird, obviously, I don't get this on my system.

I just followed the instructions on the home page and figured it would be best
to report this. There is nothing unusual in my Ubuntu installation as far as
compiler, linker, or library locations are concerned. It's all stock-standard.

> > +AM_LDFLAGS = -pthread
> 
> This hunk makes all test binaries link with pthread, even those that don't
> need it directly.  I'd rather have the tests that need pthreads *directly*
> to link with it, and only those.

Sure. I wasn't trying to provide a real fix here because I was more interested
in just getting things to compile so I could tinker with rc3. Having libabigail
link with pthreads sounds like a cleaner solution, yes.

> I have the same comment for the tools.  the only program using pthreads
> directly in the tools is abipkgdiff.  Thus, no other tool should link with
> pthreads.

Yes. I found that none of the tools linked, so I just threw -pthread in as a
global flag so I could move on.

> > -abinilint_LDFLAGS = $(abs_top_builddir)/src/libabigail.la
> > +abinilint_LDADD = $(abs_top_builddir)/src/libabigail.la
> 
> Ah, this one is a real typo.  Thanks for spotting that!

NP!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-24 22:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-01  0:00 [Bug default/19705] New: Can't build from HEAD without change michi.henning at canonical dot com
2016-01-01  0:00 ` [Bug default/19705] " michi.henning at canonical dot com
2016-01-01  0:00 ` dodji at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).