svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast

Mikolaj Golub trociny at FreeBSD.org
Thu May 9 10:05:40 UTC 2013


On Thu, May 09, 2013 at 11:22:43AM +0300, Konstantin Belousov wrote:
> On Thu, May 09, 2013 at 10:14:14AM +0300, Mikolaj Golub wrote:
> > On Wed, May 08, 2013 at 04:44:54PM -0700, Peter Wemm wrote:
> > > On Wed, May 8, 2013 at 4:25 PM, Peter Wemm <peter at wemm.org> wrote:
> > > > On Wed, May 8, 2013 at 1:03 PM, Mikolaj Golub <trociny at freebsd.org> wrote:
> > > >> Author: trociny
> > > >> Date: Wed May  8 20:03:37 2013
> > > >> New Revision: 250379
> > > >> URL: http://svnweb.freebsd.org/changeset/base/250379
> > > >>
> > > >> Log:
> > > >>   HAST module for bsnmpd(1).
> > > >>
> > > >>   Reviewed by:  harti, pjd
> > > >>   MFC after:    2 weeks
> > > >
> > > > This breaks world on just about everything other than i386, and it is
> > > > technically broken there too but doesn't actually cause a build
> > > > failure.
> > > >
> > > > You cannot link a .so file against a non-pic library, libl.a in this case.
> > > >
> > > > ===> usr.sbin/bsnmpd/modules/snmp_hast (all)^M
> > > > /usr/obj/usr/src/tmp/usr/bin/ld: /usr/obj/usr/src/tmp/usr/lib/libl.a(libyywrap.o
> > > > ): relocation R_X86_64_32 against `a local symbol' can not be used when making a
> > > >  shared object; recompile with -fPIC^M
> > > > /usr/obj/usr/src/tmp/usr/lib/libl.a: could not read symbols: Bad value^M
> > > > *** [snmp_hast.so.6] Error code 1^M
> > > 
> > > 
> > > Hmm. It seems clang optimizes something away that gcc doesn't.  When
> > > building with clang the problem doesn't show up.
> > 
> > Sorry for breaking build. I am always running tinderbox before commits
> > like this, which did not help this time. Now I will run it twice, with
> > both clang and gcc.
> > 
> > Thank you for r250394. I will investigate how to fix this. Any
> > suggestions are highly appreciated.
> 
> Why do you need libl.a ? If only for yywrap(), then re-implementing
> it for the module seems to be trivial.

Yes, it is like so. Thanks! I am now considering two possible
solutions:

1) As it is suggested above, add trivial yywrap() and link without -ll.

2) Add '%option noyywrap' to hastd/token.l, and link hastd, hastctl
and snmp_hast without -ll (it looks like yywrap is needed only when
parsing more than one file).

See the patches below. It looks both solutions work for me and I
personally prefer the second one.

-- 
Mikolaj Golub
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snmp_hast.ll.1.patch
Type: text/x-diff
Size: 926 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20130509/9bcef90c/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hast.ll.1.patch
Type: text/x-diff
Size: 1633 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20130509/9bcef90c/attachment-0001.patch>


More information about the svn-src-head mailing list