ganto / copr-lxc

RPM spec files for building lxc-2.1 on Fedora COPR
MIT License
0 stars 0 forks source link

lxc-2.1.0-1 fails to build on EPEL 6: ./.libs/liblxc.so: undefined reference to `prlimit' #1

Closed ganto closed 7 years ago

ganto commented 7 years ago

In a mock EPEL 6 build environment the build of lxc-2.1.0-1 fails with the following messages related to prlimit:

Mock Version: 1.4.4
ENTER ['do'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/lxc.spec'], chrootPath='/var/lib/mock/608113-epel-6-x86_64/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'}shell=Falselogger=<mockbuild.trace_decorator.getLog object at 0x7fadc837d208>timeout=0uid=1001gid=135user='mockbuild'nspawn_args=[]printOutput=True)
Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/lxc.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'} and shell False
warning: Could not canonicalize hostname: copr-builder-434421984.novalocal
Building target platforms: x86_64
Building for target x86_64
Wrote: /builddir/build/SRPMS/lxc-2.1.0-1.el6.src.rpm
Child return code was: 0
[...]
+ cd lxc-2.1.0
+ LANG=C
+ export LANG
+ unset DISPLAY
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-distro=fedora --enable-doc --enable-api-docs --disable-silent-rules --docdir=/usr/share/doc/lxc-2.1.0 --disable-rpath --disable-apparmor --disable-cgmanager --enable-selinux --enable-lua --disable-python --with-init-script=sysvinit --disable-werror
[...]
checking for prlimit... no
[...]
----------------------------
Environment:
 - compiler: gcc
 - distribution: fedora
 - init script type(s): sysvinit
 - rpath: no
 - GnuTLS: no
 - Bash integration: yes
Security features:
 - Apparmor: no
 - Linux capabilities: yes
 - seccomp: no
 - SELinux: yes
 - cgmanager: no
Bindings:
 - lua: yes
 - python3: no
Documentation:
 - examples: yes
 - API documentation: yes
 - user documentation: yes
Debugging:
 - tests: no
 - mutex debugging: no
Paths:
 - Logs in configpath: no
[...]
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../src -fPIC -DPIC -DLXCROOTFSMOUNT=\"/usr/lib64/lxc/rootfs\" -DLXCPATH=\"/var/lib/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\" -DLXCINITDIR=\"/usr/libexec\" -DLIBEXECDIR=\"/usr/libexec\" -DLXCTEMPLATEDIR=\"/usr/share/lxc/templates\" -DLXCTEMPLATECONFIG=\"/usr/share/lxc/config\" -DLOGPATH=\"/var/log/lxc\" -DLXC_DEFAULT_CONFIG=\"/etc/lxc/default.conf\" -DLXC_USERNIC_DB=\"/run/lxc/nics\" -DLXC_USERNIC_CONF=\"/etc/lxc/lxc-usernet\" -DDEFAULT_CGROUP_PATTERN=\"lxc/%n\" -DRUNTIME_PATH=\"/run\" -DSBINDIR=\"/usr/sbin\" -I ../../src -I ../../src/lxc -I ../../src/lxc/storage -I ../../src/lxc/cgroups -DHAVE_SELINUX -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -MT liblxc_la-confile.lo -MD -MP -MF .deps/liblxc_la-confile.Tpo -c confile.c  -fPIC -DPIC -o .libs/liblxc_la-confile.o
conf.c: In function 'setup_resource_limits':
conf.c:2461: warning: implicit declaration of function 'prlimit'
[...]
libtool: link: DIE_RPATH_DIE="/usr/lib64:" gcc -DLXCROOTFSMOUNT=\"/usr/lib64/lxc/rootfs\" -DLXCPATH=\"/var/lib/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\" -DLXCINITDIR=\"/usr/libexec\" -DLIBEXECDIR=\"/usr/libexec\" -DLXCTEMPLATEDIR=\"/usr/share/lxc/templates\" -DLXCTEMPLATECONFIG=\"/usr/share/lxc/config\" -DLOGPATH=\"/var/log/lxc\" -DLXC_DEFAULT_CONFIG=\"/etc/lxc/default.conf\" -DLXC_USERNIC_DB=\"/run/lxc/nics\" -DLXC_USERNIC_CONF=\"/etc/lxc/lxc-usernet\" -DDEFAULT_CGROUP_PATTERN=\"lxc/%n\" -DRUNTIME_PATH=\"/run\" -DSBINDIR=\"/usr/sbin\" -I ../../src -I ../../src/lxc -I ../../src/lxc/storage -I ../../src/lxc/cgroups -DHAVE_SELINUX -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -Wl,-E -o .libs/lxc-attach tools/lxc_attach.o  ./.libs/liblxc.so -lselinux -lrt -lutil -lpthread -lcap -pthread
./.libs/liblxc.so: undefined reference to `prlimit'
collect2: ld returned 1 exit status
make[3]: *** [lxc-autostart] Error 1
make[3]: *** Waiting for unfinished jobs....
./.libs/liblxc.so: undefined reference to `prlimit'
collect2: ld returned 1 exit status
make[3]: *** [lxc-attach] Error 1
make[3]: Leaving directory `/builddir/build/BUILD/lxc-2.1.0/src/lxc'
make[2]: Leaving directory `/builddir/build/BUILD/lxc-2.1.0/src'
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make[1]: Leaving directory `/builddir/build/BUILD/lxc-2.1.0/src'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.JvyxTY (%build)
    Bad exit status from /var/tmp/rpm-tmp.JvyxTY (%build)
RPM build errors:
Child return code was: 1
EXCEPTION: [Error()]
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 96, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/util.py", line 590, in do
    raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
mockbuild.exception.Error: Command failed: 
 # bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/lxc.spec
ganto commented 7 years ago

prlimit() as requested by configure is not defined on the system therefore it should include a custom header defining it src/lxc/conf.c

#if IS_BIONIC
#include <../include/lxcmntent.h>
#ifndef HAVE_PRLIMIT
#include <../include/prlimit.h>
#endif
#else
#include <mntent.h>
#endif

As you can see this only happens when the Bionic C library is detected. However, we have a glibc here.

According to prlimit not found centos6.3 it might be, that the prlimit() syscall ist not supported on CentOS 6 as it was only introduced in 2.6.36.

ganto commented 7 years ago

Will drop support for EPEL 6 builds