Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 639502 - app-emulation/lxc-1.0.8 sets -Werror - bdev.c:821:13: error: In the GNU C Library, "major" is defined [...] [-Werror]
Summary: app-emulation/lxc-1.0.8 sets -Werror - bdev.c:821:13: error: In the GNU C Lib...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Virgil Dupras (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-02 13:52 UTC by Alix
Modified: 2018-06-14 10:53 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,29.12 KB, text/plain)
2017-12-02 13:52 UTC, Alix
Details
emerge --info '=app-emulation/lxc-1.0.8::gentoo' (emerge-info.txt,5.66 KB, text/plain)
2017-12-02 13:52 UTC, Alix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alix 2017-12-02 13:52:11 UTC
Created attachment 507692 [details]
build.log

... snip ...
bdev.c: In function ‘lvm_detect’:
bdev.c:821:13: error: In the GNU C Library, "major" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "major", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including <sys/types.h>. [-Werror]
    major(statbuf.st_rdev), minor(statbuf.st_rdev));
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

bdev.c:821:13: error: In the GNU C Library, "minor" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "minor", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including <sys/types.h>. [-Werror]
    major(statbuf.st_rdev), minor(statbuf.st_rdev));
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

bdev.c: In function ‘find_free_loopdev_no_control’:
bdev.c:1900:2: error: ‘readdir_r’ is deprecated [-Werror=deprecated-declarations]
  while (!readdir_r(dir, &dirent, &direntp)) {
  ^~~~~
In file included from bdev.c:43:0:
/usr/include/dirent.h:183:12: note: declared here
 extern int readdir_r (DIR *__restrict __dirp,
            ^~~~~~~~~
i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../src    -fPIC -DPIC -I../../src -DLXCROOTFSMOUNT=\"/usr/lib/lxc/rootfs\" -DLXCPATH=\"/etc/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\" -DLXCINITDIR=\"/usr/libexec\" -DLIBEXECDIR=\"/usr/libex
ec\" -DLXCTEMPLATEDIR=\"/usr/share/lxc/templates\" -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\"     -DHAVE_SECCOMP  -pthread  -march=i686 -mtune=i686 -msse -msse2 -mssse3 -mmmx -O2 -fomit-frame-pointer -pipe -mfpmath=sse -fno-strict-aliasing -Wall -Werror -c -o liblxc_so-start.o `test -
f 'start.c' || echo './'`start.c
start.c: In function ‘lxc_check_inherited’:
start.c:190:2: error: ‘readdir_r’ is deprecated [-Werror=deprecated-declarations]
  while (!readdir_r(dir, &dirent, &direntp)) {
  ^~~~~
In file included from start.c:29:0:
/usr/include/dirent.h:183:12: note: declared here
 extern int readdir_r (DIR *__restrict __dirp,
            ^~~~~~~~~
... snip ...
Comment 1 Alix 2017-12-02 13:52:53 UTC
Created attachment 507694 [details]
emerge --info '=app-emulation/lxc-1.0.8::gentoo'
Comment 2 Alix 2017-12-04 08:29:41 UTC
managed to compile it by replacing -Werror with -Wno-error, but resulting binaries produce segmentation fault instead of useful work (kernel 4.9.52-gentoo)

tracking down this https://bugs.gentoo.org/634866, I packaged lxc-1.0.11 with the same -Wno-error modification, and it works.
Comment 3 Virgil Dupras (RETIRED) gentoo-dev 2018-06-14 01:01:32 UTC
The 1.x line isn't in the portage tree anymore and I had some problems make LXC work when we made the last bump of that line (1.0.11). Do you have the same problems trying to compile LXC 2.x?
Comment 4 Alix 2018-06-14 07:23:39 UTC
(In reply to Virgil Dupras from comment #3)
> The 1.x line isn't in the portage tree anymore and I had some problems make
> LXC work when we made the last bump of that line (1.0.11). Do you have the
> same problems trying to compile LXC 2.x?

No I haven't tried upgrading to 2.x yet, so with removal of 1.0.x packages the bug kind of resolved itself.

I wonder why 1.0.x ebuilds were removed though, according to https://linuxcontainers.org/lxc/downloads/ 1.0.x is a lts release and is recommended to be used in production environment and is supported up to april 2019.
Comment 5 Alix 2018-06-14 07:35:45 UTC
Follow up: app-emulation/lxc-2.1.1 builds fine on up to date system.
Comment 6 Virgil Dupras (RETIRED) gentoo-dev 2018-06-14 10:53:48 UTC
Maintenance burden probably. If none of the maintainers can make it work on an up-to-date system without great effort (I couldn't), it might not be worth keeping around.