Re: load_policy.c:351:1: error: "MNT_DETACH" redefined

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2009-04-29 at 07:55 -0700, Justin Mattock wrote:
> On Wed, Apr 29, 2009 at 4:51 AM, Stephen Smalley <sds@xxxxxxxxxxxxx> wrote:
> > On Tue, 2009-04-28 at 22:17 -0700, Justin Mattock wrote:
> >> I get an error while compiling libselinux
> >> with a simple "make"
> >>
> >> load_policy.c:351:1: error: "MNT_DETACH" redefined
> >> In file included from load_policy.c:5:
> >> /usr/include/sys/mount.h:102:1: error: this is the location of the
> >> previous definition
> >> make[1]: *** [load_policy.o] Error 1
> >> make[1]: Leaving directory `/home/name/LFS/SELinux/libselinux-2.0.79/src'
> >> make: *** [all] Error 2
> >>
> >> but if I:
> >> make CC="/usr/bin/i686-pc-linux-gnu-gcc-4.4.0" CFLAGS="-march=core2
> >> -mtune=core2 -pipe -O2 -fomit-frame-pointer" CXXFLAGS="${CFLAGS}"
> >> MAKEOPTS="{-j3}"
> >> libselinux will compiled with just a:
> >>
> >> load_policy.c:351:1: warning: "MNT_DETACH" redefined
> >> In file included from load_policy.c:5:
> >> /usr/include/sys/mount.h:102:1: warning: this is the location of the
> >> previous definition
> >>
> >>
> >> if I change load_policy.c(to the best of my knowledge)
> >> with the attached patch
> >> and then run make normally
> >> libselinux will compile
> >
> > Your patch doesn't make sense - defining a symbol to itself.  If the
> > symbol were always defined in sys/mount.h, one would just remove the
> > duplicate definition from load_policy.c.  But it isn't defined in
> > sys/mount.h in any version of glibc that I can see, and thus has to at
> > least be conditionally defined in load_policy.c.  Now, you could bracket
> > it with:
> > #ifndef MNT_DETACH
> > #define MNT_DETACH 2
> > #endif
> >
> > Then it will build correctly with either set of headers.
> > Out of curiosity, where are you obtaining your sys/mount.h from?
> >
> > --
> > Stephen Smalley
> > National Security Agency
> >
> >
> 
> yeah I admit it, I frantically looked in sys/mount.h
> for any kind of hints(which lead to what I had created).
> 
> As for what version I have, sounds like these are headers
> from libc. In that case,  it's the latest from:
> ftp://sources.redhat.com/pub/glibc/snapshots/
> version glibc-2.9-20090427.tar.bz2

I see - the definition was added 5 days ago to the glibc source tree.
So, yes, we'll want to wrap the definition of MNT_DETACH as above, but
we still need to keep the fallback definition for older glibc and for
alternative libc implementations that lack the definition altogether.

> As for you're idea: bracketing it, well
> this is why you make the big bucks,
> and I'm stuck working at MCDonalds
> ;^)

Hey, at least you have happy customers.

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux