All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Craig <philipc@snapgear.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Netfilter Developer Mailing List <netfilter-devel@vger.kernel.org>
Subject: Re: Only use libdl when shared builds are enabled (was: Only build iptables-xml)
Date: Tue, 21 Jul 2009 10:22:29 +1000	[thread overview]
Message-ID: <4A650A45.9070300@snapgear.com> (raw)
In-Reply-To: <alpine.LSU.2.00.0907201108470.27235@fbirervta.pbzchgretzou.qr>

Jan Engelhardt wrote:
> Hi Philip,
> 
> 
> try this one instead.

Doesn't work:

ucfront-gcc m68k-uclinux-gcc -m5307 -DCONFIG_COLDFIRE 
-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_REENTRANT 
-Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wshadow -Wstrict-prototypes -Winline -pipe 
-DXTABLES_LIBDIR=\"/libexec/xtables\" -DXTABLES_INTERNAL -I./include 
-I../include -Os -g -fomit-frame-pointer -pipe -fno-common -fno-builtin 
-Wall -DCONFIG_SECUREEDGE -DEMBED -msep-data -Dlinux -D__linux__ -Dunix 
-D__uClinux__ -Wl,-elf2flt -Wl,-move-rodata -msep-data -Wl,-elf2flt 
-Wl,-move-rodata -msep-data -o iptables-xml iptables-xml.o 
./.libs/libxtables.a
iptables-xml.elf2flt: In function `xtables_find_match':
/home/gerg/uClinux-dist/user/iptables/build/../xtables.c:579: undefined 
reference to `dlerror'
iptables-xml.elf2flt: In function `load_extension':
/home/gerg/uClinux-dist/user/iptables/build/../xtables.c:502: undefined 
reference to `dlopen'
/home/gerg/uClinux-dist/user/iptables/build/../xtables.c:511: undefined 
reference to `dlerror'
/home/gerg/uClinux-dist/user/iptables/build/../xtables.c:519: undefined 
reference to `dlopen'
/home/gerg/uClinux-dist/user/iptables/build/../xtables.c:526: undefined 
reference to `dlerror'
iptables-xml.elf2flt: In function `xtables_find_target':
/home/gerg/uClinux-dist/user/iptables/build/../xtables.c:633: undefined 
reference to `dlerror'
collect2: ld returned 1 exit status


The problem is that iptables-xml links against libxtables.la, and we never
build a version of libxtables.la that has -DNO_SHARED_LIBS=1.  This isn't
a problem for iptables-static because we build xtables.c separately for it,
rather than linking against libxtables.la.

Also we can't just add -DNO_SHARED_LIBS=1 to the cflags for libxtables.la
because that would break when both --enable-static and --enable-shared
are specified.


> parent efebafa0021f36f4547b7fcc47620274f333e001 (v1.4.4-2-gefebafa)
> commit 906025e7be97f760cd11cc0f93f769f827bf6f70
> Author: Jan Engelhardt <jengelh@medozas.de>
> Date:   Mon Jul 20 11:08:14 2009 +0200
> 
> build: only use libdl when shared builds are enabled
> 
> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
> ---
>  Makefile.am |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index fd99098..5608bde 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -21,7 +21,10 @@ libiptc_libiptc_la_LDFLAGS = -version-info 0:0:0
>  lib_LTLIBRARIES      += libxtables.la
>  libxtables_la_SOURCES = xtables.c
>  libxtables_la_LDFLAGS = -version-info ${libxtables_vcurrent}:0:${libxtables_vage}
> -libxtables_la_LIBADD  = -ldl
> +libxtables_la_LIBADD  =
> +if ENABLE_SHARED
> +libxtables_la_LIBADD += -ldl
> +endif
>  
>  # iptables, dynamic
>  iptables_SOURCES          = iptables-standalone.c iptables.c


  reply	other threads:[~2009-07-21  0:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-20  9:10 Only use libdl when shared builds are enabled (was: Only build iptables-xml) Jan Engelhardt
2009-07-21  0:22 ` Philip Craig [this message]
2009-07-22 11:54   ` Henrik Nordstrom
2009-07-22 12:50     ` Jan Engelhardt
2009-07-23  0:07       ` Only use libdl when shared builds are enabled Philip Craig
2009-07-23  1:06         ` Jan Engelhardt
2009-07-23 15:50         ` Jan Engelhardt
2009-07-24  9:02           ` Philip Craig
2009-07-24  9:26             ` Jan Engelhardt

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=4A650A45.9070300@snapgear.com \
    --to=philipc@snapgear.com \
    --cc=jengelh@medozas.de \
    --cc=netfilter-devel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.