1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

fix static linking

Static linking fails currently, as -lm and -lpthread are missing:

gcc -O2  -fPIC -O2  -L../libdm -L../lib -L../libdaemon/client -static
-L../libdm/ioctl \
      -o dmsetup.static dmsetup.o -ldevmapper    -lrt
../libdm/ioctl/libdevmapper.a(libdm-stats.o): In function
`dm_stats_create_region':
libdm-stats.c:(.text+0x2d69): undefined reference to `log10'
libdm-stats.c:(.text+0x2d6e): undefined reference to `lround'
../libdm/ioctl/libdevmapper.a(pool.o): In function `dm_pool_create':
pool.c:(.text+0x134): undefined reference to `pthread_mutex_lock'
pool.c:(.text+0x14f): undefined reference to `pthread_mutex_unlock'

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
This commit is contained in:
Riku Voipio 2015-12-08 16:40:08 +02:00 committed by Zdenek Kabelac
parent 0688dbbc53
commit 7a4badc07f
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.114 - Version 1.02.114 -
==================================== ====================================
Better support for dmsetup static linkage.
Extend validity checks on dmeventd client socket. Extend validity checks on dmeventd client socket.
Version 1.02.113 - 5th December 2015 Version 1.02.113 - 5th December 2015

View File

@ -130,7 +130,7 @@ dmsetup: dmsetup.o $(top_builddir)/libdm/libdevmapper.$(LIB_SUFFIX)
dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
$(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \ $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
-o $@ dmsetup.o -ldevmapper $(STATIC_LIBS) $(LIBS) -o $@ dmsetup.o -ldevmapper $(M_LIBS) $(PTHREAD_LIBS) $(STATIC_LIBS) $(LIBS)
all: device-mapper all: device-mapper