openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
4.01k stars 3.49k forks source link

lxc: Build failed with libseccomp in Openwrt 19.07 #11056

Closed falafalafala1668 closed 4 years ago

falafalafala1668 commented 4 years ago

Maintainer: @ratkaj marko.ratkaj@sartura.hr Environment: Ubuntu 19.10,openwrt 19.07-SNAPSHOT x86-64

Description: First build missing seccomp-syscalls.h

make[7]: Entering directory '/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1/src/lxc'
/bin/bash ../../libtool  --tag=CC   --mode=compile x86_64-openwrt-linux-musl-gcc -DHAVE_CONFIG_H -I. -I../../src   -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/include -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/usr/include -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/include/fortify -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/include  -fPIC -DPIC -DLXCROOTFSMOUNT=\"/usr/lib/lxc/rootfs\" -DLXCPATH=\"/var/lib/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\" -DLXCINITDIR=\"/usr/lib\" -DLIBEXECDIR=\"/usr/lib\" -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_SECCOMP -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include -pthread  -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1:lxc-2.1.1 -Wformat -Werror=format-security -fpic -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -Wall -Werror -MT liblxc_la-seccomp.lo -MD -MP -MF .deps/liblxc_la-seccomp.Tpo -c -o liblxc_la-seccomp.lo `test -f 'seccomp.c' || echo './'`seccomp.c
OpenWrt-libtool: compile:  x86_64-openwrt-linux-musl-gcc -DHAVE_CONFIG_H -I. -I../../src -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/include -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/usr/include -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/include/fortify -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/include -fPIC -DPIC -DLXCROOTFSMOUNT=\"/usr/lib/lxc/rootfs\" -DLXCPATH=\"/var/lib/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\" -DLXCINITDIR=\"/usr/lib\" -DLIBEXECDIR=\"/usr/lib\" -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_SECCOMP -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include -pthread -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1:lxc-2.1.1 -Wformat -Werror=format-security -fpic -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Wall -Werror -MT liblxc_la-seccomp.lo -MD -MP -MF .deps/liblxc_la-seccomp.Tpo -c seccomp.c  -fPIC -DPIC -o .libs/liblxc_la-seccomp.o
In file included from seccomp.c:28:0:
/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include/seccomp.h:705:10: fatal error: seccomp-syscalls.h: No such file or directory
 #include <seccomp-syscalls.h>
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[7]: *** [Makefile:1831: liblxc_la-seccomp.lo] Error 1
make[7]: Leaving directory '/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1/src/lxc'
make[6]: *** [Makefile:442: all-recursive] Error 1
make[6]: Leaving directory '/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1/src'
make[5]: *** [Makefile:381: all] Error 2
make[5]: Leaving directory '/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1/src'
make[4]: *** [Makefile:538: all-recursive] Error 1
make[4]: Leaving directory '/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1'
make[3]: *** [Makefile:288: /home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1/.built] Error 2
make[3]: Leaving directory '/home/user_name/openwrt-linux/repo/feeds/packages/utils/lxc'
time: package/feeds/packages/lxc/compile#0.29#0.07#0.34
make[2]: *** [package/Makefile:113: package/feeds/packages/lxc/compile] Error 2
make[2]: Leaving directory '/home/user_name/openwrt-linux/repo'
make[1]: *** [package/Makefile:107: /home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/user_name/openwrt-linux/repo'
make: *** [/home/user_name/openwrt-linux/repo/include/toplevel.mk:227: world] Error 2
make: Leaving directory '/home/user_name/openwrt-linux/repo'

When put seccomp-syscalls.h in staging_dir/target-x86_64_musl/usr/include

make[7]: Entering directory '/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1/src/lxc'
/bin/bash ../../libtool  --tag=CC   --mode=compile x86_64-openwrt-linux-musl-gcc -DHAVE_CONFIG_H -I. -I../../src   -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/include -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/usr/include -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/include/fortify -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/include  -fPIC -DPIC -DLXCROOTFSMOUNT=\"/usr/lib/lxc/rootfs\" -DLXCPATH=\"/var/lib/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\" -DLXCINITDIR=\"/usr/lib\" -DLIBEXECDIR=\"/usr/lib\" -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_SECCOMP -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include -pthread  -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1:lxc-2.1.1 -Wformat -Werror=format-security -fpic -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -Wall -Werror -MT liblxc_la-seccomp.lo -MD -MP -MF .deps/liblxc_la-seccomp.Tpo -c -o liblxc_la-seccomp.lo `test -f 'seccomp.c' || echo './'`seccomp.c
OpenWrt-libtool: compile:  x86_64-openwrt-linux-musl-gcc -DHAVE_CONFIG_H -I. -I../../src -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/include -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/usr/include -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/include/fortify -I/home/user_name/openwrt-linux/repo/staging_dir/toolchain-x86_64_gcc-7.5.0_musl/include -fPIC -DPIC -DLXCROOTFSMOUNT=\"/usr/lib/lxc/rootfs\" -DLXCPATH=\"/var/lib/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\" -DLXCINITDIR=\"/usr/lib\" -DLIBEXECDIR=\"/usr/lib\" -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_SECCOMP -I/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include -pthread -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -iremap/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1:lxc-2.1.1 -Wformat -Werror=format-security -fpic -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Wall -Werror -MT liblxc_la-seccomp.lo -MD -MP -MF .deps/liblxc_la-seccomp.Tpo -c seccomp.c  -fPIC -DPIC -o .libs/liblxc_la-seccomp.o
seccomp.c: In function 'parse_config_v1':
seccomp.c:52:7: error: passing argument 1 of 'seccomp_rule_add' makes pointer from integer without a cast [-Werror=int-conversion]
       SCMP_ACT_ALLOW, nr, 0);
       ^~~~~~~~~~~~~~
In file included from seccomp.c:28:0:
/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include/seccomp.h:613:5: note: expected 'scmp_filter_ctx {aka void *}' but argument is of type 'unsigned int'
 int seccomp_rule_add(scmp_filter_ctx ctx,
     ^~~~~~~~~~~~~~~~
seccomp.c:48:9: error: too few arguments to function 'seccomp_rule_add'
   ret = seccomp_rule_add(
         ^~~~~~~~~~~~~~~~
In file included from seccomp.c:28:0:
/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include/seccomp.h:613:5: note: declared here
 int seccomp_rule_add(scmp_filter_ctx ctx,
     ^~~~~~~~~~~~~~~~
seccomp.c: In function 'lxc_read_seccomp_config':
seccomp.c:756:44: error: passing argument 1 of 'seccomp_attr_set' makes pointer from integer without a cast [-Werror=int-conversion]
  check_seccomp_attr_set = seccomp_attr_set(SCMP_FLTATR_CTL_NNP, 0);
                                            ^~~~~~~~~~~~~~~~~~~
In file included from seccomp.c:28:0:
/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include/seccomp.h:531:5: note: expected 'scmp_filter_ctx {aka void *}' but argument is of type 'int'
 int seccomp_attr_set(scmp_filter_ctx ctx,
     ^~~~~~~~~~~~~~~~
seccomp.c:756:27: error: too few arguments to function 'seccomp_attr_set'
  check_seccomp_attr_set = seccomp_attr_set(SCMP_FLTATR_CTL_NNP, 0);
                           ^~~~~~~~~~~~~~~~
In file included from seccomp.c:28:0:
/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include/seccomp.h:531:5: note: declared here
 int seccomp_attr_set(scmp_filter_ctx ctx,
     ^~~~~~~~~~~~~~~~
seccomp.c: In function 'lxc_seccomp_load':
seccomp.c:785:8: error: too few arguments to function 'seccomp_load'
  ret = seccomp_load(
        ^~~~~~~~~~~~
In file included from seccomp.c:28:0:
/home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/usr/include/seccomp.h:506:5: note: declared here
 int seccomp_load(const scmp_filter_ctx ctx);
     ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[7]: *** [Makefile:1831: liblxc_la-seccomp.lo] Error 1
make[7]: Leaving directory '/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1/src/lxc'
make[6]: *** [Makefile:442: all-recursive] Error 1
make[6]: Leaving directory '/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1/src'
make[5]: *** [Makefile:381: all] Error 2
make[5]: Leaving directory '/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1/src'
make[4]: *** [Makefile:538: all-recursive] Error 1
make[4]: Leaving directory '/home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1'
make[3]: *** [Makefile:288: /home/user_name/openwrt-linux/repo/build_dir/target-x86_64_musl/lxc-2.1.1/.built] Error 2
make[3]: Leaving directory '/home/user_name/openwrt-linux/repo/feeds/packages/utils/lxc'
time: package/feeds/packages/lxc/compile#0.32#0.05#0.35
make[2]: *** [package/Makefile:113: package/feeds/packages/lxc/compile] Error 2
make[2]: Leaving directory '/home/user_name/openwrt-linux/repo'
make[1]: *** [package/Makefile:107: /home/user_name/openwrt-linux/repo/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/user_name/openwrt-linux/repo'
make: *** [/home/user_name/openwrt-linux/repo/include/toplevel.mk:227: world] Error 2
make: Leaving directory '/home/user_name/openwrt-linux/repo'

Thanks!

neheb commented 4 years ago

This should already be fixed. Update the feeds, make clean, and try again.