Re: Compiling losetup statically?

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

 



On Fri, Jan 09, 2009 at 01:09:19AM +0100, markus reichelt wrote:
> * Karel Zak <kzak@xxxxxxxxxx> wrote:
> 
> > > FWIW, I cannot get util-linux-ng 1.4.1 to compile losetup
> > > statically, even with "./configure
> > > --enable-static-programs=losetup"
> > 
> >  Please, more details -- for example make output or so...
> 
> On both a clean Slackware 12.2 and an upgraded system (gcc 4.2.4,
> glibc 2.7):
> 
> 
> there are no errors with just "./configure
>  --enable-static-programs=losetup"
> 
> make just does its job and a dynamically linked binary is produced
> just like w/o that configure option:
> 
> ldd mount/losetup
>         linux-gate.so.1 =>  (0xffffe000)
>         libc.so.6 => /lib/libc.so.6 (0xb7ed6000)
>         /lib/ld-linux.so.2 (0xb8047000)

 It always produces the dynamically linked losetup, and also
 "losetup.static" binary (when compiled with --enable-static-programs).

> LDFLAGS="-static -s" ./configure --enable-static-programs=losetup

 You needn't to redefine global LDFLAGS=, the configure script should
 be smart enough to define proper compile flags.

> /usr/lib/gcc/i486-slackware-linux/4.2.4/../../../libblkid.a(probe.o):
> /In function `set_uuid':
> probe.c:(.text+0x43a): undefined reference to `uuid_is_null'
> probe.c:(.text+0x45b): undefined reference to `uuid_unparse'
> /usr/lib/gcc/i486-slackware-linux/4.2.4/../../../libblkid.a(probe.o):
> In function `get_ext2_info':
> probe.c:(.text+0x77f): undefined reference to `uuid_is_null'
> collect2: ld returned 1 exit status

 You also need libuuid.a, the problem is that the configure script
 does not set -luuid for the static build (depends on "pkg-config blkid
 --libs --static"), workaround is:

   BLKID_LIBS_STATIC="-lblkid -luuid" ./configure ....

 this problem should be fixed in util-linux-ng 2.14.2-rc1 (try it:-)

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>

-
Linux-crypto:  cryptography in and on the Linux system
Archive:       http://mail.nl.linux.org/linux-crypto/


[Index of Archives]     [Kernel]     [Linux Crypto]     [Gnu Crypto]     [Gnu Classpath]     [Netfilter]     [Bugtraq]
  Powered by Linux