linux-um archives
 help / color / mirror / Atom feed
From: Antoine Martin <antoine@nagafix.co.uk>
To: Blaisorblade <blaisorblade@yahoo.it>
Cc: UML devel <user-mode-linux-devel@lists.sourceforge.net>
Subject: [uml-devel] Re: pcap cross-linking [PATCH]
Date: Mon, 19 Dec 2005 18:33:39 +0000	[thread overview]
Message-ID: <1135017219.15991.131.camel@ant.internal> (raw)
In-Reply-To: <200512191716.06370.blaisorblade@yahoo.it>

[-- Attachment #1: Type: text/plain, Size: 2029 bytes --]

> > pcap builds and runs fine on amd64 but there is a problem when building
> > with SUBARCH=i386: it uses the wrong version of libpcap.a:
> > ld -r -dp -o arch/um/drivers/pcap.o arch/um/drivers/pcap_kern.o
> > arch/um/drivers/pcap_user.o  -m elf_i386
> > -r /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../libpcap.a
> 
> > Whereas the one it needs to link against is here:
> > /emul/linux/x86/usr/lib/libpcap.a
> 
> This is IMHO a Gentoo bug -
I'll ask the gentoo devs, for the time being I can copy this library
manually to /usr/lib32 (which is the standard location for 32-bit libs
on amd64)

But the problem remains, the linker should use:
-r /usr/lib32/libpcap.a
and not ../../../libpcap.a which ends up as /usr/lib (which points
to /usr/lib64 on standard distros)
But only when building with SUBARCH=i386. 

So I added this statement to the Makefile (patch attached) and now all
is well:
+ifeq ($(SUBARCH),i386)
+LDFLAGS_pcap.o := -r /usr/lib32/libpcap.a
+else

> Good thing, libnss_* is probably good - but don't forget /etc/nsswitch.conf 
> and /etc/pam.d/* - /etc/pam.conf
Yep, they're all there... see:
http://uml.nagafix.co.uk/SELinux/chroot/
This chroot example is here for SELinux but it applies just as well to
others.

I think I'll rebuild it with compartment and build su without pam to
trim it down even more.
> > (also lib/security so I can get into the chroot)
> That's for su, right? There are some tools (including "compartment") to 
> combine chroot + su together.
Yep, it's a shame compartment does not ship with all distros.
chroot without su is pointless (since you can use 'chroot-again' to
escape) changing uid/guid should really be included in chroot.

> Also, I see you're using SeLinux. I don't know anything about its library 
> handling, and possibly it's going to make the story more difficult.
It can do that... but the good thing is that it can be disabled.
>  However, 
> strace/ltrace as suggested above should diagnose any problem.
Cool - I'll try that and report back.

Many thanks
Antoine

[-- Attachment #2: uml-pcap-subarchi386-linkerfix.patch --]
[-- Type: text/x-patch, Size: 487 bytes --]

--- linux-2.6.15-rc6-x86-broken/arch/um/drivers/Makefile   2005-12-19 18:07:17.000000000 +0000
+++ linux-2.6.15-rc6-x86/arch/um/drivers/Makefile          2005-12-19 18:11:11.000000000 +0000
@@ -17,7 +17,11 @@
 port-objs := port_kern.o port_user.o
 harddog-objs := harddog_kern.o harddog_user.o

+ifeq ($(SUBARCH),i386)
+LDFLAGS_pcap.o := -r /usr/lib32/libpcap.a
+else
 LDFLAGS_pcap.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libpcap.a)
+endif

 targets := pcap_kern.o pcap_user.o


  reply	other threads:[~2005-12-19 18:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-18 19:03 [uml-devel] pcap cross-linking Antoine Martin
2005-12-19 16:16 ` [uml-devel] " Blaisorblade
2005-12-19 18:33   ` Antoine Martin [this message]
2005-12-19 19:27     ` [uml-devel] Re: pcap cross-linking [PATCH] Blaisorblade
2005-12-19 21:47       ` Antoine Martin
2005-12-20 14:23         ` Blaisorblade
2005-12-20 16:25           ` Antoine Martin
2005-12-20 19:24             ` Blaisorblade
2005-12-20 20:01     ` Rob Landley
2005-12-20 20:24       ` Antoine Martin
2005-12-20 20:43       ` Blaisorblade
2005-12-21 18:13         ` Blaisorblade
2005-12-22 17:57           ` Anthony Brock
2005-12-23 16:11             ` Blaisorblade
2005-12-26  7:47               ` Anthony Brock
2005-12-29 20:12               ` Rob Landley
2006-01-01 18:51                 ` Blaisorblade
2006-01-01 21:01                   ` Rob Landley
2006-01-02 20:10                     ` Blaisorblade
2005-12-19 18:39   ` [uml-devel] Re: pcap cross-linking Blaisorblade

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=1135017219.15991.131.camel@ant.internal \
    --to=antoine@nagafix.co.uk \
    --cc=blaisorblade@yahoo.it \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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