linux-vserver / util-vserver

http://linux-vserver.org/
GNU General Public License v2.0
15 stars 14 forks source link

undefined reference to `fstatat' (util-vserver-0.30.216-pre3119) #22

Open ghost opened 9 years ago

ghost commented 9 years ago

Fails to compile on Debian Jessie x64: ( ./configure --prefix=/usr/local/util-vserver-0.30.216-pre3119 && make ) >__build.log 2>&1

systemd/systemd-vserver-generator.c: In function ‘generate_units’: systemd/systemd-vserver-generator.c:435:2: warning: ‘dirfd’ is deprecated (declared at /usr/include/diet/dirent.h:57) [-Wdeprecated-declarations] int vcfg_fd = dirfd(vcfg_dir); ^ /bin/sh ./libtool --tag=CC --mode=link diet -Os gcc -g -O2 -std=c99 -Wall -pedantic -W -funit-at-a-time -o systemd/systemd-vserver-generator systemd/systemd-vserver-generator.o
libtool: link: diet -Os gcc -g -O2 -std=c99 -Wall -pedantic -W -funit-at-a-time -o systemd/systemd-vserver-generator systemd/systemd-vserver-generator.o systemd/systemd-vserver-generator.o: In function read_file': /usr/local/src/vserver/util-vserver-0.30.216-pre3119/systemd/systemd-vserver-generator.c:309: undefined reference tofstatat' systemd/systemd-vserver-generator.o: In function systemd_escape': /usr/local/src/vserver/util-vserver-0.30.216-pre3119/systemd/systemd-vserver-generator.c:99: undefined reference tostpcpy' systemd/systemd-vserver-generator.o: In function generate_units': /usr/local/src/vserver/util-vserver-0.30.216-pre3119/systemd/systemd-vserver-generator.c:471: undefined reference tofstatat' systemd/systemd-vserver-generator.o: In function generate_units_for_vserver': /usr/local/src/vserver/util-vserver-0.30.216-pre3119/systemd/systemd-vserver-generator.c:395: undefined reference tofstatat' /usr/local/src/vserver/util-vserver-0.30.216-pre3119/systemd/systemd-vserver-generator.c:399: undefined reference to `fstatat' collect2: error: ld returned 1 exit status Makefile:4977: recipe for target 'systemd/systemd-vserver-generator' failed make[2]: * [systemd/systemd-vserver-generator] Error 1 make[2]: Leaving directory '/usr/local/src/vserver/util-vserver-0.30.216-pre3119' Makefile:10171: recipe for target 'all-recursive' failed make[1]: * [all-recursive] Error 1 make[1]: Leaving directory '/usr/local/src/vserver/util-vserver-0.30.216-pre3119' Makefile:3152: recipe for target 'all' failed make: *\ [all] Error 2

Thankyou!

clopez commented 9 years ago

This seems to have caused by 3fb8a2b6

The issue is the following: The version of dietlibc shipped on Debian (0.33~cvs20120325-6) still don't has the support for this syscall.

If you don't need systemd support you can workaround this by adding to the configure:

--disable-systemd
clopez commented 9 years ago

I mean, support for fstatat

ghost commented 9 years ago

Thankyou and yes... I realized as well that debian jessie doesn't ship a recent enough dietlibc. However... since dietlibc seems to be (in fact 'is' ...as it seems) only a compile time dependency I simply worked it around like:

01) checkout current dietlibc from fefe 02) build + install it [ make prefix=/usr/local/dietlibc-0.34 && make prefix=/usr/local/dietlibc-0.34 install ] 03) build + install util-vserver [ ./configure DIET=/usr/local/dietlibc-0.34/bin/diet --prefix=/ && make && make install ]

... for the systemd part itself later then... I currently dropped the idea to have systemd on both the host system and the vserver guests (everything debian jessie) since it simply doesn't really work as intended as the linux vserver irc channel suggests.