[linux-lvm] Problems with linking lvm statically with musl

KARBOWSKI Piotr piotr.karbowski at gmail.com
Sun Dec 24 14:36:02 UTC 2017


Hello,

I am facing some problems with linking LVM2.2.02.177 statically with 
musl, using Alpine Linux as a sysroot/chroot.

I needed to apply two patches:
- 
https://git.alpinelinux.org/cgit/aports/tree/main/lvm2/fix-stdio-usage.patch?h=3.7-stable
- 
https://git.alpinelinux.org/cgit/aports/tree/main/lvm2/mallinfo.patch?h=3.7-stable

It would be nice if you guys could upsptream it.

I've noticed that I am unable to link tools/dmsetup, as with 
LDFLAGs='-static' CFLAGS='-static' it's unable to find libdevmapper.a. 
It passes multiple -L directories, one of them is ../libdm, however, the 
libdevmapper is under ../libdm/ioctl directory, adding another -L or 
symlinking libdevmapper.a -> ioctl/libdevmapper.a does the trick

Is the ioctl location intentional or it's like that by bug?

-- Piotr.




More information about the linux-lvm mailing list