On Wed, Oct 5, 2011 at 1:57 PM, Jan Safranek <jsafr...@redhat.com> wrote:

> On 10/04/2011 08:09 PM, Bart Van Assche wrote:> $ readelf -a
> ./agent/.libs/snmpd|grep perl
> >  0x0000000000000001 (NEEDED)             Shared library: [libperl.so]
> >  0x000000000000000f (RPATH)              Library rpath:
> >
> [/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE:/usr/local/net-snmp-master/lib]
> >  0x000000000000001d (RUNPATH)            Library runpath:
> >
> [/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE:/usr/local/net-snmp-master/lib]
>
> That doesn't work for me, with clean compile environment (Fedora's mock,
> i.e. gcc in chroot), I still get the same error. Only my Makefile
> changes make it working :(.
>

I've had a closer look, and the patch below (that includes your patch) was
sufficient to set the libperl path in all relevant binaries - shared
libraries and executables, including unit tests. I'm still wondering whether
there's a more elegant way to fix this though.

diff --git a/agent/Makefile.in b/agent/Makefile.in
index 128eeca..696ba72 100644
--- a/agent/Makefile.in
+++ b/agent/Makefile.in
@@ -299,7 +299,7 @@ libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION):
${LLIBAGENTOBJS} $(USELIBS)
        $(RANLIB) $(AGENTLIB)

 libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION): ${LMIBOBJS} $(AGENTLIB)
$(USELIBS)
-       $(LIB_LD_CMD) $(MIBLIB) ${LMIBOBJS} $(AGENTLIB) $(USELIBS)
@LD_NO_UNDEFINED@ $(LDFLAGS) ${LMIBLIBS} $(LIB_LD_LIBS) @AGENTLIBS@
+       $(LIB_LD_CMD) $(MIBLIB) ${LMIBOBJS} $(AGENTLIB) $(USELIBS)
@LD_NO_UNDEFINED@ $(LDFLAGS) ${LMIBLIBS} $(PERLLDOPTS_FOR_LIBS)
$(LIB_LD_LIBS) @AGENTLIBS@
        $(RANLIB) $(MIBLIB)

 agentlib: $(AGENTLIB)
diff --git a/ltmain.sh b/ltmain.sh
old mode 100755
new mode 100644
index e492218..ed1814f
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -8051,7 +8051,7 @@ EOF
            elif test -n "$runpath_var"; then
              case "$perm_rpath " in
              *" $libdir "*) ;;
-             *) func_apped perm_rpath " $libdir" ;;
+             *) func_append perm_rpath " $libdir" ;;
              esac
            fi
          done
diff --git a/net-snmp-config.in b/net-snmp-config.in
index ef17bac..7bdafe0 100644
--- a/net-snmp-config.in
+++ b/net-snmp-config.in
@@ -183,7 +183,7 @@ else
       echo $result
       ;;
     --build-command)
-      echo "@CC@ @CFLAGS@ @DEVFLAGS@"
+      echo "@CC@ @CFLAGS@ @DEVFLAGS@ @PERLLDOPTS_FOR_LIBS@"
       ;;
     #################################################### client lib
     --libs)
From c5abe7f500c454ef69df025ab146535d4759e42e Mon Sep 17 00:00:00 2001
From: Bart Van Assche <bvanass...@acm.org>
Date: Wed, 5 Oct 2011 10:06:14 +0200
Subject: [PATCH] CHANGES: snmplib, agent: Perl library linking fixes

---
 agent/Makefile.in  |    2 +-
 ltmain.sh          |    2 +-
 net-snmp-config.in |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 mode change 100755 => 100644 ltmain.sh

diff --git a/agent/Makefile.in b/agent/Makefile.in
index 128eeca..696ba72 100644
--- a/agent/Makefile.in
+++ b/agent/Makefile.in
@@ -299,7 +299,7 @@ libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION):    ${LLIBAGENTOBJS} $(USELIBS)
 	$(RANLIB) $(AGENTLIB)
 
 libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION): ${LMIBOBJS} $(AGENTLIB) $(USELIBS)
-	$(LIB_LD_CMD) $(MIBLIB) ${LMIBOBJS} $(AGENTLIB) $(USELIBS) @LD_NO_UNDEFINED@ $(LDFLAGS) ${LMIBLIBS} $(LIB_LD_LIBS) @AGENTLIBS@
+	$(LIB_LD_CMD) $(MIBLIB) ${LMIBOBJS} $(AGENTLIB) $(USELIBS) @LD_NO_UNDEFINED@ $(LDFLAGS) ${LMIBLIBS} $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@
 	$(RANLIB) $(MIBLIB)
 
 agentlib: $(AGENTLIB)
diff --git a/ltmain.sh b/ltmain.sh
old mode 100755
new mode 100644
index e492218..ed1814f
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -8051,7 +8051,7 @@ EOF
 	    elif test -n "$runpath_var"; then
 	      case "$perm_rpath " in
 	      *" $libdir "*) ;;
-	      *) func_apped perm_rpath " $libdir" ;;
+	      *) func_append perm_rpath " $libdir" ;;
 	      esac
 	    fi
 	  done
diff --git a/net-snmp-config.in b/net-snmp-config.in
index ef17bac..7bdafe0 100644
--- a/net-snmp-config.in
+++ b/net-snmp-config.in
@@ -183,7 +183,7 @@ else
       echo $result
       ;;
     --build-command)
-      echo "@CC@ @CFLAGS@ @DEVFLAGS@"
+      echo "@CC@ @CFLAGS@ @DEVFLAGS@ @PERLLDOPTS_FOR_LIBS@"
       ;;
     #################################################### client lib
     --libs)
-- 
1.7.3.4

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to