WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 0 of 4] tools: build system fix indirect library

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 0 of 4] tools: build system fix indirect library usage and --as-needed
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Tue, 15 Mar 2011 16:18:41 +0000
Delivery-date: Tue, 15 Mar 2011 09:23:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1300205763@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <patchbomb.1300205763@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2011-03-15 at 16:16 +0000, Ian Campbell wrote:
> This series arranges for all libraries and binaries to only link
> against those shared libraries which they use directly, relying on the
> dynamic linker to do the right thing for indirect dependencies.
> 
> In order to do this I've pushed the tools/blktap2 UUID abstraction
> down into libvhd and out of line to encapsulate all knowledge
> regarding this abstraction into libvhd rather than expecting the users
> of the library to do the right thing.
> 
> Having done this supporting --as-needed becomes a pretty trivial case
> of ensuring links lines have the libraries in the correct order.
> 
> Tested by:
>       * running xl, start/stop a guest
>       * running xend, start/stop a guest
>       * manually importing each python extension and calling
>           whatever initialisation function I could find.

Also, the output of:
        find tools/ -perm +111 -type f | while read i ; do
            file $i | grep -q ELF || continue
            echo $i
            objdump -p $i | grep NEEDED
            echo
        done
before and after is attached. The diff is below.

Ian.

--- BEFORE
+++ AFTER
@@ -35,7 +35,6 @@
 
 tools/console/xenconsole
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenstore.so.3.0
   NEEDED      libutil.so.1
   NEEDED      librt.so.1
@@ -43,7 +42,6 @@
 
 tools/console/xenconsoled
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenstore.so.3.0
   NEEDED      libutil.so.1
   NEEDED      librt.so.1
@@ -51,12 +49,10 @@
 
 tools/xenmon/xentrace_setmask
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libc.so.6
 
 tools/xenmon/xenbaked
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libc.so.6
 
 tools/remus/imqebt/imqebt
@@ -107,7 +103,6 @@
 
 tools/xenstore/xenstored
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libc.so.6
 
 tools/xenstore/xenstore-control
@@ -115,12 +110,7 @@
   NEEDED      libc.so.6
 
 tools/python/build/lib.linux-i686-2.5/xen/lowlevel/xl.so
-  NEEDED      libxenctrl.so.4.0
-  NEEDED      libxenguest.so.4.0
-  NEEDED      libxenstore.so.3.0
   NEEDED      libxenlight.so.1.0
-  NEEDED      libblktapctl.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libpthread.so.0
   NEEDED      libc.so.6
 
@@ -133,8 +123,6 @@
   NEEDED      libc.so.6
 
 tools/python/build/lib.linux-i686-2.5/xen/lowlevel/xs.so
-  NEEDED      libxenctrl.so.4.0
-  NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libpthread.so.0
   NEEDED      libc.so.6
@@ -142,36 +130,25 @@
 tools/python/build/lib.linux-i686-2.5/xen/lowlevel/xc.so
   NEEDED      libxenctrl.so.4.0
   NEEDED      libxenguest.so.4.0
-  NEEDED      libxenstore.so.3.0
   NEEDED      libpthread.so.0
   NEEDED      libc.so.6
 
 tools/python/build/lib.linux-i686-2.5/xen/lowlevel/acm.so
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libxenguest.so.4.0
-  NEEDED      libxenstore.so.3.0
   NEEDED      libpthread.so.0
   NEEDED      libc.so.6
 
 tools/python/build/lib.linux-i686-2.5/xen/lowlevel/flask.so
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libxenguest.so.4.0
-  NEEDED      libxenstore.so.3.0
   NEEDED      libflask.so.1.0
   NEEDED      libpthread.so.0
   NEEDED      libc.so.6
 
 tools/python/build/lib.linux-i686-2.5/xen/lowlevel/netlink.so
-  NEEDED      libxenctrl.so.4.0
-  NEEDED      libxenguest.so.4.0
-  NEEDED      libxenstore.so.3.0
   NEEDED      libpthread.so.0
   NEEDED      libc.so.6
 
 tools/python/build/lib.linux-i686-2.5/xen/lowlevel/ptsname.so
-  NEEDED      libxenctrl.so.4.0
-  NEEDED      libxenguest.so.4.0
-  NEEDED      libxenstore.so.3.0
   NEEDED      libpthread.so.0
   NEEDED      libc.so.6
 
@@ -179,35 +156,29 @@
 
 tools/xentrace/xenctx
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libc.so.6
 
 tools/xentrace/xentrace
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libc.so.6
 
 tools/xentrace/xentrace_setsize
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libc.so.6
 
 tools/flask/utils/flask-setenforce
   NEEDED      libflask.so.1.0
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libc.so.6
 
 tools/flask/utils/flask-loadpolicy
   NEEDED      libflask.so.1.0
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libc.so.6
 
 tools/flask/utils/flask-getenforce
   NEEDED      libflask.so.1.0
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libc.so.6
 
 tools/flask/libflask/libflask.so.1.0.0
@@ -261,28 +232,24 @@
 
 tools/xcutils/lsevtchn
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
 
 tools/xcutils/xc_save
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
 
 tools/xcutils/readnotes
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
 
 tools/xcutils/xc_restore
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
@@ -290,8 +257,12 @@
 tools/libxl/xl
   NEEDED      libxlutil.so.1.0
   NEEDED      libxenlight.so.1.0
+  NEEDED      libc.so.6
+  NEEDED      libxenctrl.so.4.0
+  NEEDED      libuuid.so.1
+
+tools/libxl/libxenlight.so.1.0.0
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libblktapctl.so.1.0
@@ -299,20 +270,15 @@
   NEEDED      libuuid.so.1
   NEEDED      libc.so.6
 
-tools/libxl/libxenlight.so.1.0.0
-  NEEDED      libc.so.6
-
 tools/libxl/libxlutil.so.1.0.0
   NEEDED      libc.so.6
 
 tools/blktap2/vhd/vhd-update
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libc.so.6
 
 tools/blktap2/vhd/vhd-util
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libc.so.6
 
 tools/blktap2/vhd/lib/libvhd.so.1.0.0
@@ -330,9 +296,7 @@
   NEEDED      librt.so.1
   NEEDED      libz.so.1
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libpthread.so.0
   NEEDED      libm.so.6
   NEEDED      libc.so.6
@@ -341,9 +305,7 @@
   NEEDED      librt.so.1
   NEEDED      libz.so.1
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libpthread.so.0
   NEEDED      libm.so.6
   NEEDED      libc.so.6
@@ -352,16 +314,13 @@
   NEEDED      librt.so.1
   NEEDED      libz.so.1
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libc.so.6
 
 tools/blktap2/drivers/qcow2raw
   NEEDED      librt.so.1
   NEEDED      libz.so.1
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libpthread.so.0
   NEEDED      libm.so.6
   NEEDED      libc.so.6
@@ -370,9 +329,7 @@
   NEEDED      librt.so.1
   NEEDED      libz.so.1
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libpthread.so.0
   NEEDED      libm.so.6
   NEEDED      libc.so.6
@@ -381,9 +338,7 @@
   NEEDED      librt.so.1
   NEEDED      libz.so.1
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libpthread.so.0
   NEEDED      libm.so.6
   NEEDED      libc.so.6
@@ -392,9 +347,7 @@
   NEEDED      librt.so.1
   NEEDED      libz.so.1
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libpthread.so.0
   NEEDED      libm.so.6
   NEEDED      libc.so.6
@@ -403,9 +356,7 @@
   NEEDED      librt.so.1
   NEEDED      libz.so.1
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libpthread.so.0
   NEEDED      libm.so.6
   NEEDED      libc.so.6
@@ -414,9 +365,7 @@
   NEEDED      librt.so.1
   NEEDED      libz.so.1
   NEEDED      libvhd.so.1.0
-  NEEDED      libuuid.so.1
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libpthread.so.0
   NEEDED      libm.so.6
   NEEDED      libc.so.6
@@ -450,13 +399,6 @@
 tools/ocaml/libs/log/dllsyslog_stubs.so
   NEEDED      libc.so.6
 
-tools/ocaml/xenstored/oxenstored
-  NEEDED      libxenctrl.so.4.0
-  NEEDED      libxenguest.so.4.0
-  NEEDED      libm.so.6
-  NEEDED      libdl.so.2
-  NEEDED      libc.so.6
-
 tools/xenstat/xentop/xentop
   NEEDED      libxenstore.so.3.0
   NEEDED      libxenctrl.so.4.0
@@ -483,7 +425,6 @@
 
 tools/misc/xenlockprof
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
@@ -493,28 +434,24 @@
 
 tools/misc/xenpm
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
 
 tools/misc/gtracestat
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
 
 tools/misc/xenwatchdogd
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
 
 tools/misc/xen-hvmcrash
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
@@ -524,21 +461,18 @@
 
 tools/misc/xen-hvmctx
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
 
 tools/misc/xenperf
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
 
 tools/misc/xen-hptool
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenguest.so.4.0
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
@@ -549,7 +483,6 @@
 
 tools/xenpaging/xenpaging
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenstore.so.3.0
   NEEDED      libc.so.6
 
@@ -558,7 +491,6 @@
 
 tools/debugger/kdd/kdd
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libc.so.6
 
 tools/debugger/gdbsx/gdbsx
@@ -578,7 +510,6 @@
 
 tools/blktap/drivers/blktapctrl
   NEEDED      libxenctrl.so.4.0
-  NEEDED      libdl.so.2
   NEEDED      libxenstore.so.3.0
   NEEDED      libblktap.so.3.0
   NEEDED      librt.so.1

Attachment: BEFORE
Description: Text document

Attachment: AFTER
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel