Re: [libvirt] [PATCH] Fix DSO linking problem for nodeinfotest

2010-02-18 Thread Daniel Veillard
On Thu, Feb 18, 2010 at 10:20:47AM +, Daniel P. Berrange wrote:
> On Wed, Feb 17, 2010 at 04:37:17PM +0100, Daniel Veillard wrote:
> >   Following changes in Fedora about exposing shared libraries
> > dependancies, libvirt built failed for one of the test binaries
> > because it didn't explicitely required -ldl
> > 
> > gcc -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib
> > -I../include -I../include -I../src -I../src/util -I../src/conf
> > -I/usr/include/libxml2   -DGETTEXT_PACKAGE=\"libvirt\"  -Wall
> > -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs
> > -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings
> > -Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls
> > -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> > -fasynchronous-unwind-tables  -O2 -g -pipe -Wall
> > -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
> > --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
> > -fasynchronous-unwind-tables -c nodeinfotest.c
> >   CCLD   nodeinfotest
> > /usr/bin/ld:
> > ../src/.libs/libvirt_test.a(libvirt_driver_vbox_la-vbox_XPCOMCGlue.o):
> > undefined reference to symbol 'dlopen@@GLIBC_2.1'
> > /usr/bin/ld: note: 'dlopen@@GLIBC_2.1' is defined in DSO /lib/libdl.so.2
> > so try adding it to the linker command line
> > /lib/libdl.so.2: could not read symbols: Invalid operation
> > collect2: ld returned 1 exit status
> > 
> >   the following patch fixes it,
> 
> This isn't corect. nodeinfotest isn't the thing that is ultimately
> using libdl. The place we need it is in src/Makefile.am against
> 
>   libvirt_driver_vbox_la_LDFLAGS

  Well, surprizingly nodeinfotest is the only binary exhibiting the
build failure, so there must be something else going on ...

> 
> NB, we also need to adjust the configure.ac check 

  Well we have the check but only for the driver_modules options.
I assume you mean doing this check unconditionally and export some
autoconf variable holding the -ldl flag.

 I will rework the patch accordingly,

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] Fix DSO linking problem for nodeinfotest

2010-02-18 Thread Daniel P. Berrange
On Wed, Feb 17, 2010 at 04:37:17PM +0100, Daniel Veillard wrote:
>   Following changes in Fedora about exposing shared libraries
> dependancies, libvirt built failed for one of the test binaries
> because it didn't explicitely required -ldl
> 
> gcc -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib
> -I../include -I../include -I../src -I../src/util -I../src/conf
> -I/usr/include/libxml2   -DGETTEXT_PACKAGE=\"libvirt\"  -Wall
> -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs
> -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings
> -Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls
> -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
> -fasynchronous-unwind-tables  -O2 -g -pipe -Wall
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
> --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
> -fasynchronous-unwind-tables -c nodeinfotest.c
>   CCLD   nodeinfotest
> /usr/bin/ld:
> ../src/.libs/libvirt_test.a(libvirt_driver_vbox_la-vbox_XPCOMCGlue.o):
> undefined reference to symbol 'dlopen@@GLIBC_2.1'
> /usr/bin/ld: note: 'dlopen@@GLIBC_2.1' is defined in DSO /lib/libdl.so.2
> so try adding it to the linker command line
> /lib/libdl.so.2: could not read symbols: Invalid operation
> collect2: ld returned 1 exit status
> 
>   the following patch fixes it,

This isn't corect. nodeinfotest isn't the thing that is ultimately
using libdl. The place we need it is in src/Makefile.am against

  libvirt_driver_vbox_la_LDFLAGS


NB, we also need to adjust the configure.ac check 


Regards,
Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] Fix DSO linking problem for nodeinfotest

2010-02-17 Thread Daniel Veillard
  Following changes in Fedora about exposing shared libraries
dependancies, libvirt built failed for one of the test binaries
because it didn't explicitely required -ldl

gcc -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../include -I../src -I../src/util -I../src/conf
-I/usr/include/libxml2   -DGETTEXT_PACKAGE=\"libvirt\"  -Wall
-Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs
-Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings
-Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls
-Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fasynchronous-unwind-tables  -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
-fasynchronous-unwind-tables -c nodeinfotest.c
  CCLD   nodeinfotest
/usr/bin/ld:
../src/.libs/libvirt_test.a(libvirt_driver_vbox_la-vbox_XPCOMCGlue.o):
undefined reference to symbol 'dlopen@@GLIBC_2.1'
/usr/bin/ld: note: 'dlopen@@GLIBC_2.1' is defined in DSO /lib/libdl.so.2
so try adding it to the linker command line
/lib/libdl.so.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

  the following patch fixes it,

Daniel

-- 
Daniel Veillard  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
dan...@veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 090b320..ea604d8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -317,7 +317,7 @@ conftest_LDADD = $(LDADDS)
 
 nodeinfotest_SOURCES = \
nodeinfotest.c testutils.h testutils.c
-nodeinfotest_LDADD = $(LDADDS)
+nodeinfotest_LDADD = $(LDADDS) -ldl
 
 statstest_SOURCES = \
statstest.c testutils.h testutils.c
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list