Re: DSO Problems linking corosync v2.1.0 (solved for me..)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Bernardo,

can you please provide more info on your build environment?

and configure invocation?

It looks like a bug in our build script, but the patch you propose
doesn't look right.

Fabio

On 10/30/2012 05:19 PM, Bernardo Cabezas Serra wrote:
> Hello,
> 
> I have found some linking errors on building corosync v2.1.0.
> I have been able to compile and link, but with specific LDFLAGS, as
> suggested in:
> http://fedoraproject.org/wiki/UnderstandingDSOLinkChange
> 
> Don't know if problem is mine or is a code error, neither if this is the
> right solution... So I post details to get feedback and report a
> possible error.
> 
> At the end of mail you can see details about the build environment.
> 
> Am I doing something wrong? Is an upstream code error?
> 
> Linking errors were like this one:
> 
> ------------
> /usr/bin/ld: cpgbenchzc.o: undefined reference to symbol 'cs_strerror'
> /usr/bin/ld: note: 'cs_strerror' is defined in DSO
> /usr/src/corosync.git/common_lib/.libs/libcorosync_common.so.4 so try
> adding it to the linker command line
> /usr/src/corosync.git/common_lib/.libs/libcorosync_common.so.4: could
> not read symbols: Invalid operation
> collect2: ld returned 1 exit status
> make: *** [cpgbenchzc] Error 1
> -------------
> 
> 
> Solved by linking with -lcorosync_common  as suggested in:
> http://fedoraproject.org/wiki/UnderstandingDSOLinkChange
> 
> I added:
> "-L../common_lib/.libs/ -lcorosync_common"
> to:
> cpgbenchzc_LDADD  (test/Makefile.am)
> corosync_cmapctl_LDADD (tools/Makefile.am)
> corosync_quorumtool_LDADD (tools/Makefile.am)
> 
> and
> "-L../lib/.libs -lcmap"
> to:
> testsam_LDADD    (test/Makefile.am)
> 
> 
> This is the diff of changed Makefiles.am:
> --------------
> bercab@turifel:/usr/src/corosync.git.2.1.0$ git diff
> diff --git a/test/Makefile.am b/test/Makefile.am
> index c19e506..73b5c9b 100644
> --- a/test/Makefile.am
> +++ b/test/Makefile.am
> @@ -55,8 +55,8 @@ cpgverify_CPPFLAGS    = $(nss_CFLAGS)
>  cpgverify_LDADD                = $(LIBQB_LIBS) $(nss_LIBS)
> $(top_builddir)/lib/libcpg.la
>  cpgbound_LDADD         = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
>  cpgbench_LDADD         = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
> -cpgbenchzc_LDADD       = $(LIBQB_LIBS) $(top_builddir)/lib/libcpg.la
> -testsam_LDADD          = $(LIBQB_LIBS) $(top_builddir)/lib/libsam.la
> +cpgbenchzc_LDADD       = $(LIBQB_LIBS) -L../common_lib/.libs/
> -lcorosync_common $(top_builddir)/lib/libcpg.la
> +testsam_LDADD          = $(LIBQB_LIBS) -L../lib/.libs -lcmap
> $(top_builddir)/lib/libsam.la
> 
>  ploadstart: ploadstart.sh
>         sed -e 's#@''BASHPATH@#${BASHPATH}#g' $< > $@
> diff --git a/tools/Makefile.am b/tools/Makefile.am
> index 8f4064a..fe57bc4 100644
> --- a/tools/Makefile.am
> +++ b/tools/Makefile.am
> @@ -54,14 +54,14 @@ corosync-xmlproc: corosync-xmlproc.sh
>  corosync-blackbox: corosync-blackbox.sh
>         sed -e 's#@''LOCALSTATEDIR@#${localstatedir}#g' $< > $@
> 
> -corosync_cmapctl_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcmap.la
> +corosync_cmapctl_LDADD = $(LIBQB_LIBS) -L../common_lib/.libs/
> -lcorosync_common $(top_builddir)/lib/libcmap.la
> 
>  corosync_cfgtool_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcfg.la
> 
>  corosync_cpgtool_LDADD = $(LIBQB_LIBS) $(top_builddir)/lib/libcfg.la \
>                           $(top_builddir)/lib/libcpg.la
> 
> -corosync_quorumtool_LDADD = $(LIBQB_LIBS) \
> +corosync_quorumtool_LDADD = $(LIBQB_LIBS) -L../common_lib/.libs/
> -lcorosync_common \
>                             $(top_builddir)/lib/libcmap.la \
>                             $(top_builddir)/lib/libcfg.la \
>                             $(top_builddir)/lib/libquorum.la \
> 
> 
> My build environment:
> 
> Environ vars:
> export PREFIX=/opt/ha
> export PKG_CONFIG_PATH=/opt/ha/lib/pkgconfig
> export LCRSODIR=$PREFIX/libexec/lcrso
> export CLUSTER_USER=hacluster
> export CLUSTER_GROUP=haclient
> export LDFLAGS=-L/opt/ha/lib
> export CPPFLAGS=-I/opt/ha/include
> export CFLAGS=-I/opt/ha/include
> 
> Corosync configure options and output:
> 
> ./configure --prefix=$PREFIX
> [...]
> corosync configuration:
>   Version                  = 2.1.0.4-8a98
>   Prefix                   = /opt/ha
>   Executables              = ${exec_prefix}/sbin
>   Man pages                = ${datarootdir}/man
>   Doc dir                  = ${datarootdir}/doc/${PACKAGE_TARNAME}
>   Libraries                = ${exec_prefix}/lib
>   Header files             = ${prefix}/include
>   Arch-independent files   = ${datarootdir}
>   State information        = ${prefix}/var
>   System configuration     = ${prefix}/etc
>   System init.d directory  = ${prefix}/etc/init.d
>   System systemd directory = /lib/systemd/system
>   System init wraps dir    = /opt/ha/share/corosync
>   corosync config dir      = ${prefix}/etc/corosync
>   Features                 = pie relro bindnow
> 
> corosync build info:
>   Library SONAME           = 5.0.0
>   CFG Library SONAME       = 6.0.0
>   CPG Library SONAME       = 4.1.0
>   QUORUM Library SONAME    = 5.0.0
>   SAM Library SONAME       = 4.4.0
>   VOTEQUORUM Library SONAME  = 6.0.0
>   CMAP Library SONAME      = 4.1.0
>   Default optimization     = -O3
>   Default debug options    =
>   Extra compiler warnings  =
>   Env. defined CFLAG       = -I/opt/ha/include
>   Env. defined CPPFLAGS    = -I/opt/ha/include
>   Env. defined LDFLAGS     = -L/opt/ha/lib
>   ANSI defined CPPFLAGS    =
>   Coverage     CFLAGS      =
>   Coverage     LDFLAGS     =
>   Fatal War.   CFLAGS      =
>   Final        CFLAGS      = -I/opt/ha/include  -fPIC -DPIC  -fPIE -O3
> -ggdb3 	  -Wall -Wshadow -Wmissing-prototypes -Wmissing-declarations
> -Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith
> -Wwrite-strings -Wcast-align -Wbad-function-cast
> -Wmissing-format-attribute -Wformat=2 -Wformat-security
> -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing 	
> -I/opt/ha/include   	
>   Final        CPPFLAGS    = -I/opt/ha/include
> -I$(top_builddir)/include -I$(top_srcdir)/include
> -I$(top_builddir)/include/corosync -I$(top_srcdir)/include/corosync
>   Final        LDFLAGS     = -L/opt/ha/lib  -fPIC -DPIC  -pie
> -Wl,-z,relro -Wl,-z,now -Wl,--as-needed
> 
> 
> Thanks in advance,
> Bernardo
> _______________________________________________
> discuss mailing list
> discuss@xxxxxxxxxxxx
> http://lists.corosync.org/mailman/listinfo/discuss
> 

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux