Gentoo Archives: gentoo-user

From: Samuli Suominen <ssuominen@g.o>
To: gentoo-user@l.g.o, udev-bugs@g.o, eudev@g.o
Subject: Re: [gentoo-user] LVM2 compile error. Clock_gettime
Date: Wed, 26 Jun 2013 05:20:51
Message-Id: 51CA7A0F.7060505@gentoo.org
In Reply to: [gentoo-user] LVM2 compile error. Clock_gettime by Dale
1 On 26/06/13 07:58, Dale wrote:
2 > I can't seem to get lvm2 to compile. I get this error:
3 >
4 > FILE=`echo lvchange.d | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
5 > DEPS=`echo ../make.tmpl ../VERSION ../Makefile
6 > ../include/.symlinks_created | sed -e 's/\\//\\\\\\//g'`; \
7 > x86_64-pc-linux-gnu-gcc -MM -I. -I../include
8 > -DLVM_SHARED_PATH=\"/usr/sbin/lvm\" -DHAVE_CONFIG_H -DDM_IOCTLS -o
9 > lvchange.d lvchange.c; \
10 > sed -i "s/\(.*\)\.o[ :]*/$FILE.o $FILE.d $FILE.pot: $DEPS /g" lvchange.d; \
11 > [ -s lvchange.d ] || rm -f lvchange.d
12 > /bin/mkdir -p ./; \
13 > set -e; \
14 > FILE=`echo formats.d | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
15 > DEPS=`echo ../make.tmpl ../VERSION ../Makefile
16 > ../include/.symlinks_created | sed -e 's/\\//\\\\\\//g'`; \
17 > x86_64-pc-linux-gnu-gcc -MM -I. -I../include
18 > -DLVM_SHARED_PATH=\"/usr/sbin/lvm\" -DHAVE_CONFIG_H -DDM_IOCTLS -o
19 > formats.d formats.c; \
20 > sed -i "s/\(.*\)\.o[ :]*/$FILE.o $FILE.d $FILE.pot: $DEPS /g" formats.d; \
21 > [ -s formats.d ] || rm -f formats.d
22 > /bin/mkdir -p ./; \
23 > set -e; \
24 > FILE=`echo dumpconfig.d | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
25 > DEPS=`echo ../make.tmpl ../VERSION ../Makefile
26 > ../include/.symlinks_created | sed -e 's/\\//\\\\\\//g'`; \
27 > x86_64-pc-linux-gnu-gcc -MM -I. -I../include
28 > -DLVM_SHARED_PATH=\"/usr/sbin/lvm\" -DHAVE_CONFIG_H -DDM_IOCTLS -o
29 > dumpconfig.d dumpconfig.c; \
30 > sed -i "s/\(.*\)\.o[ :]*/$FILE.o $FILE.d $FILE.pot: $DEPS /g"
31 > dumpconfig.d; \
32 > [ -s dumpconfig.d ] || rm -f dumpconfig.d
33 > make[1]: Leaving directory
34 > `/var/tmp/portage/sys-fs/lvm2-2.02.98/work/LVM2.2.02.98/tools'
35 > make[1]: Entering directory
36 > `/var/tmp/portage/sys-fs/lvm2-2.02.98/work/LVM2.2.02.98/tools'
37 > x86_64-pc-linux-gnu-gcc -c -I. -I../include
38 > -DLVM_SHARED_PATH=\"/usr/sbin/lvm\" -DHAVE_CONFIG_H -DDM_IOCTLS -Wall
39 > -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes
40 > -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn
41 > -Wformat-security -Wredundant-decls -Wpointer-arith -march=native -O2
42 > -pipe -march=native -O2 -pipe -fPIC -O2 -march=native -O2 -pipe -fPIC
43 > -O2 dmsetup.c -o dmsetup.o
44 > x86_64-pc-linux-gnu-gcc -shared -Wl,-soname,libdevmapper-event.so.1.02 \
45 > -march=native -O2 -pipe -march=native -O2 -pipe -fPIC -O2
46 > -march=native -O2 -pipe -fPIC -O2 -march=native -O2 -pipe -fPIC -O2
47 > -Wl,-O1 -Wl,--as-needed -Wl,--version-script,.export.sym -L../../libdm
48 > -L../../lib -L../../libdaemon/client -L../../daemons/dmeventd
49 > libdevmapper-event.o -ldevmapper -o libdevmapper-event.so.1.02
50 > rm -f libdevmapper-event.a
51 > x86_64-pc-linux-gnu-ar rs libdevmapper-event.a libdevmapper-event.o
52 > x86_64-pc-linux-gnu-ar: creating libdevmapper-event.a
53 > ln -s -f libdevmapper-event.so.1.02 libdevmapper-event.so
54 > x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -march=native -O2 -pipe
55 > -fPIC -O2 -march=native -O2 -pipe -fPIC -O2 -march=native -O2 -pipe
56 > -fPIC -O2 -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -O2 -L./libdm
57 > -L./lib -L./libdaemon/client -L./daemons/dmeventd -Wl,-O1
58 > -Wl,--as-needed -O2 -L../libdm -L../lib -L../libdaemon/client
59 > -L../daemons/dmeventd -Wl,-O1 -Wl,--as-needed -O2 -L../../libdm
60 > -L../../lib -L../../libdaemon/client -L../../daemons/dmeventd
61 > -Wl,--export-dynamic -L. -o dmeventd dmeventd.o \
62 > -ldl -ldevmapper-event -lpthread -ldevmapper -rdynamic
63 > x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -march=native -O2 -pipe
64 > -fPIC -O2 -march=native -O2 -pipe -fPIC -O2 -march=native -O2 -pipe
65 > -fPIC -O2 -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -O2 -L./libdm
66 > -L./lib -L./libdaemon/client -L./daemons/dmeventd -Wl,-O1
67 > -Wl,--as-needed -O2 -L../libdm -L../lib -L../libdaemon/client
68 > -L../daemons/dmeventd -Wl,-O1 -Wl,--as-needed -O2 -L../../libdm
69 > -L../../lib -L../../libdaemon/client -L../../daemons/dmeventd
70 > -Wl,--export-dynamic -Wl,--no-export-dynamic -static -L.
71 > -L../../libdm/ioctl -o dmeventd.static \
72 > dmeventd.o -ldl -ldevmapper-event -lpthread -ldevmapper -ludev
73 > dmeventd.o: In function `_register_for_event':
74 > dmeventd.c:(.text+0xfb1): warning: Using 'dlopen' in statically linked
75 > applications requires at runtime the shared libraries from the glibc
76 > version used for linking
77 > /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libudev.a(libudev-util.o):
78 > In function `util_lookup_group':
79 > (.text+0x4d6): warning: Using 'getgrnam_r' in statically linked
80 > applications requires at runtime the shared libraries from the glibc
81 > version used for linking
82 > /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libudev.a(libudev-util.o):
83 > In function `util_lookup_user':
84 > (.text+0x3a3): warning: Using 'getpwnam_r' in statically linked
85 > applications requires at runtime the shared libraries from the glibc
86 > version used for linking
87 > /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libudev.a(util.o):
88 > In function `now':
89 > (.text+0x148): undefined reference to `clock_gettime'
90 > collect2: ld returned 1 exit status
91 > make[2]: *** [dmeventd.static] Error 1
92 > make[2]: Leaving directory
93 > `/var/tmp/portage/sys-fs/lvm2-2.02.98/work/LVM2.2.02.98/daemons/dmeventd'
94 > make[1]: *** [dmeventd.device-mapper] Error 2
95 > make[1]: Leaving directory
96 > `/var/tmp/portage/sys-fs/lvm2-2.02.98/work/LVM2.2.02.98/daemons'
97 > make: *** [daemons.device-mapper] Error 2
98 > make: *** Waiting for unfinished jobs....
99 > x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -march=native -O2 -pipe
100 > -fPIC -O2 -march=native -O2 -pipe -fPIC -O2 -Wl,-O1 -Wl,--as-needed
101 > -Wl,-O1 -Wl,--as-needed -O2 -L./libdm -L./lib -L./libdaemon/client
102 > -L./daemons/dmeventd -Wl,-O1 -Wl,--as-needed -O2 -L../libdm -L../lib
103 > -L../libdaemon/client -L../daemons/dmeventd -L../libdm \
104 > -o dmsetup dmsetup.o -ldevmapper -ludev
105 > x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -march=native -O2 -pipe
106 > -fPIC -O2 -march=native -O2 -pipe -fPIC -O2 -Wl,-O1 -Wl,--as-needed
107 > -Wl,-O1 -Wl,--as-needed -O2 -L./libdm -L./lib -L./libdaemon/client
108 > -L./daemons/dmeventd -Wl,-O1 -Wl,--as-needed -O2 -L../libdm -L../lib
109 > -L../libdaemon/client -L../daemons/dmeventd -Wl,--no-export-dynamic
110 > -static -L../libdm/ioctl \
111 > -o dmsetup.static dmsetup.o -ldevmapper -ludev -ludev
112 > /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libudev.a(libudev-util.o):
113 > In function `util_lookup_group':
114 > (.text+0x4d6): warning: Using 'getgrnam_r' in statically linked
115 > applications requires at runtime the shared libraries from the glibc
116 > version used for linking
117 > /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libudev.a(libudev-util.o):
118 > In function `util_lookup_user':
119 > (.text+0x3a3): warning: Using 'getpwnam_r' in statically linked
120 > applications requires at runtime the shared libraries from the glibc
121 > version used for linking
122 > /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libudev.a(util.o):
123 > In function `now':
124 > (.text+0x148): undefined reference to `clock_gettime'
125 > collect2: ld returned 1 exit status
126 > make[1]: *** [dmsetup.static] Error 1
127 > make[1]: Leaving directory
128 > `/var/tmp/portage/sys-fs/lvm2-2.02.98/work/LVM2.2.02.98/tools'
129 > make: *** [tools.device-mapper] Error 2
130 > * ERROR: sys-fs/lvm2-2.02.98 failed (compile phase):
131 > * emake failed
132 >
133 >
134 > The short error is this:
135 >
136 > (.text+0x148): undefined reference to `clock_gettime'
137 >
138 > I googled and it seems udev is supposed to deal with this. I'm using
139 > eudev. I have tried a masked version of lvm2 to see if it has a fix but
140 > same error. I'm on the latest eudev except for the *9999 version. This
141 > is current version of eudev:
142 >
143 > [IP-] [ ] sys-fs/eudev-1.0:0
144 >
145 > Current installed gcc:
146 >
147 > [IP-] [ ] sys-devel/gcc-4.4.7:4.4.7
148 > [IP-] [ ] sys-devel/gcc-4.5.4:4.5.4
149 > [IP-] [ ] sys-devel/gcc-4.6.3:4.6.3
150 >
151 > I'm set to use 4.6.3 gcc according to gcc-config. This is part of a
152 > emerge -e world hoping to fix the seamonkey/firefox issue, hoping.
153 > Everything else compiled except googleearth and ppp. I'm not using
154 > those at the moment so I'm not worried about those. Maybe later.
155 >
156 > Thoughts? Ideas?
157
158 With sys-fs/udev-204 installed I get:
159
160 $ pkg-config --libs --static libudev
161 -ludev -lrt
162 $ grep lrt /usr/lib64/pkgconfig/libudev.pc
163 Libs.private: -lrt
164
165 In which the -lrt is the important bit. It's required for clock_gettime.
166
167 So either eudev is broken and doesn't contain proper Libs.private: in
168 libudev.pc file, or sys-fs/lvm2's build system is broken and doesn't
169 query proper Libs.private: from libudev.pc when building lvm2 with static.
170
171 For the record. There is no reason to use sys-fs/eudev at this time, it
172 doesn't bring anything to the table sys-fs/udev doesn't have. In fact,
173 sys-fs/eudev has broken USE="+rule-generator" which leads to random
174 interface names.
175
176 - Samuli

Replies

Subject Author
Re: [gentoo-user] LVM2 compile error. Clock_gettime Dale <rdalek1967@×××××.com>