Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 508522 - sys-apps/util-linux-2.24.1 - sys-utils/unshare.c:151:36: error: 'MS_PRIVATE' undeclared (first use in this function)
Summary: sys-apps/util-linux-2.24.1 - sys-utils/unshare.c:151:36: error: 'MS_PRIVATE' ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
: 510166 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-04-23 14:25 UTC by Anthony Basile
Modified: 2014-05-12 17:48 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2014-04-23 14:25:50 UTC
The build fails with:

  CC       sys-utils/fallocate.o
  CCLD     fallocate
  CC       sys-utils/unshare.o
sys-utils/unshare.c: In function 'main':
sys-utils/unshare.c:151:36: error: 'MS_PRIVATE' undeclared (first use in this function)
sys-utils/unshare.c:151:36: note: each undeclared identifier is reported only once for each function it appears in
sys-utils/unshare.c:151:47: error: 'MS_REC' undeclared (first use in this function)
make[2]: *** [sys-utils/unshare.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/sys-apps/util-linux-2.24.1-r2/work/util-linux-2.24.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-apps/util-linux-2.24.1-r2/work/util-linux-2.24.1'
make: *** [all] Error 2


MS_PRIVATE and MS_REC are defined in <linux/fs.h> which is not included in sys-utils/unshare.c.  Simply adding the include fixes the problem.  Here's an inlined patch:


--- sys-utils/unshare.c.orig	2014-04-23 14:12:11.980077504 +0000
+++ sys-utils/unshare.c	2014-04-23 14:12:22.330077508 +0000
@@ -26,6 +26,7 @@
 #include <unistd.h>
 #include <sys/wait.h>
 #include <sys/mount.h>
+#include <linux/fs.h>
 
 #include "nls.h"
 #include "c.h"


I'm using linux-headers-3.13.

Note: this also compiles on glibc so its a harmless patch.

Reproducible: Always

Steps to Reproduce:
1. download any armv7a uclibc tarball from http://distfiles.gentoo.org/experimental/arm/uclibc/
2. In a chroot try to upgrade to util-linux-2.24.1-r2
3. You should hit the bug.
Comment 1 Anthony Basile gentoo-dev 2014-04-23 15:17:13 UTC
once sec ... this is probably a uclibc issue with <sys/mount.h>.  The following commit should fix it:

http://git.uclibc.org/uClibc/commit/include/sys/mount.h?id=76ff037059f6d387bde9d540f7e27a2b376d7cd7

I'll test and report back.
Comment 2 Anthony Basile gentoo-dev 2014-04-23 15:38:17 UTC
(In reply to Anthony Basile from comment #1)
> once sec ... this is probably a uclibc issue with <sys/mount.h>.  The
> following commit should fix it:
> 
> http://git.uclibc.org/uClibc/commit/include/sys/mount.
> h?id=76ff037059f6d387bde9d540f7e27a2b376d7cd7
> 
> I'll test and report back.

@vapier: The correct fix is to backport 76ff037059f6d387bde9d540f7e27a2b376d7cd7 to uclibc's patchset.
Comment 3 SpanKY gentoo-dev 2014-04-27 19:37:30 UTC
(In reply to Anthony Basile from comment #2)

that is the master branch.  the 0.9.33 branch is 641a5356a021f90ee922229bd8e1aa6eafe152bc.  i've added that to uclibc-0.9.33.2-r11 now.

http://sources.gentoo.org/gentoo/src/patchsets/uclibc/0.9.33.2/18_all_mount.h.patch?rev=1.1
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2014-05-12 17:48:18 UTC
*** Bug 510166 has been marked as a duplicate of this bug. ***