From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>,
Nazim Wahid Djafar <nwd.dev@gmail.com>,
netfilter-devel@vger.kernel.org, kaber@trash.net
Subject: Re: nftables-20140407 compilation error
Date: Wed, 9 Apr 2014 23:27:14 +0200 [thread overview]
Message-ID: <20140409212714.GA19579@breakpoint.cc> (raw)
In-Reply-To: <20140409184418.GA4093@localhost>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Wed, Apr 09, 2014 at 05:29:49PM +0200, Florian Westphal wrote:
> > Pablo Neira Ayuso <pablo@netfilter.org> 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.
next prev parent reply other threads:[~2014-04-09 21:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 9:17 nftables-20140407 compilation error Nazim Wahid Djafar
2014-04-09 9:51 ` Florian Westphal
2014-04-09 12:31 ` Pablo Neira Ayuso
2014-04-09 15:29 ` Florian Westphal
2014-04-09 18:44 ` Pablo Neira Ayuso
2014-04-09 21:27 ` Florian Westphal [this message]
2014-04-10 10:16 ` Patrick McHardy
2014-04-10 10:41 ` Florian Westphal
2014-04-09 10:26 ` Arturo Borrero Gonzalez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140409212714.GA19579@breakpoint.cc \
--to=fw@strlen.de \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
--cc=nwd.dev@gmail.com \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).