Re: nftables-20140407 compilation error

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

 



Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
> On Wed, Apr 09, 2014 at 05:29:49PM +0200, Florian Westphal wrote:
> > Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
> > > > > src/scanner.o: In function `nft_realloc':
> > > > > /home/nwd/lab/nftables/nftables-20140407/<stdout>:4260: undefined
> > > > > reference to `rpl_realloc'
> > > > 
> > > > This happens when configure thinks malloc/realloc are missing.
> > > > 
> > > > Any objetions wrt. removing AC_FUNC_MALLOC/AC_FUNC_REALLOC from
> > > > nftables configure.ac?
> > > 
> > > If that resolves the problem, please go ahead, thanks Florian.
> > 
> > The problem is two-fold.  When libnftnl has just been installed and
> > is not yet in linker path, the malloc/realloc test will fail:
> > 
> > configure:4557: gcc -o conftest -I/usr/local/libnftnl/include
> > -L/usr/local/libnftnl/lib conftest.c -lreadline -lgmp -lnftnl -lmnl  >&5
> > configure:4557: $? = 0
> > configure:4557: ./conftest
> > ./conftest: error while loading shared libraries: libnftnl.so.0: cannot
> > open shared object file: No such file or directory
> >
> > That error is only in config.log, and config.h redefines malloc/realloc
> > with rpl_ prefix, which then yields the mysterious
> > 'undefined reference to `rpl_realloc'' error when compiling nftables.
> > 
> > The 2nd problem is that the macro executes the built program, which has
> > the usual cross-compiling issue.
> > 
> > AFAIU these macros are only useful to check if malloc(0) returns
> > non-NULL and that realloc(NULL, .. works, hence the question if these
> > should just be removed.
> 
> OK, so if we remove the macros, we may still hit the first problem,
> right?

No, since no "#define malloc rpl_malloc" will be done nft things will
compile/link.  You won't be able to run src/nft without fixing ld library
path, but at least then you'll get a clear message as to where the
problem is :-)

> Patrick has some build updates in his queue, not sure if this removal
> may clash with his changes.

I see, I'll leave it alone then (at least until his changes are in).

Thanks for the heads-up.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux