2009-04-07 19:17:42

by Justin P. Mattock

[permalink] [raw]
Subject: [refpolicy] SELinux userpace compile errors

compiling the userspace tools
I'm receiving some errors:
(the first is just a simple "make" instead of "sudo make")


make[1]: Entering directory `/home/name/LFS/SELinux/selinux/libsepol'
make -C include install
make[2]: Entering directory `/home/name/LFS/SELinux/selinux/libsepol/include'
test -d /usr/include/sepol || install -m 755 -d /usr/include/sepol
test -d /usr/include/sepol/policydb || install -m 755 -d
/usr/include/sepol/policydb
install -m 644 sepol/boolean_record.h sepol/booleans.h sepol/context.h
sepol/context_record.h sepol/debug.h sepol/errcodes.h sepol/handle.h
sepol/iface_record.h sepol/interfaces.h sepol/module.h
sepol/node_record.h sepol/nodes.h sepol/policydb.h sepol/port_record.h
sepol/ports.h sepol/roles.h sepol/sepol.h sepol/user_record.h
sepol/users.h /usr/include/sepol
install: cannot remove `/usr/include/sepol/boolean_record.h': Permission denied
install: cannot remove `/usr/include/sepol/booleans.h': Permission denied
install: cannot remove `/usr/include/sepol/context.h': Permission denied
install: cannot remove `/usr/include/sepol/context_record.h': Permission denied
install: cannot remove `/usr/include/sepol/debug.h': Permission denied
install: cannot remove `/usr/include/sepol/errcodes.h': Permission denied
install: cannot remove `/usr/include/sepol/handle.h': Permission denied
install: cannot remove `/usr/include/sepol/iface_record.h': Permission denied
install: cannot remove `/usr/include/sepol/interfaces.h': Permission denied
install: cannot remove `/usr/include/sepol/module.h': Permission denied
install: cannot remove `/usr/include/sepol/node_record.h': Permission denied
install: cannot remove `/usr/include/sepol/nodes.h': Permission denied
install: cannot remove `/usr/include/sepol/policydb.h': Permission denied
install: cannot remove `/usr/include/sepol/port_record.h': Permission denied
install: cannot remove `/usr/include/sepol/ports.h': Permission denied
install: cannot remove `/usr/include/sepol/roles.h': Permission denied
install: cannot remove `/usr/include/sepol/sepol.h': Permission denied
install: cannot remove `/usr/include/sepol/user_record.h': Permission denied
install: cannot remove `/usr/include/sepol/users.h': Permission denied
make[2]: *** [install] Error 1
make[2]: Leaving directory `/home/name/LFS/SELinux/selinux/libsepol/include'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/name/LFS/SELinux/selinux/libsepol'
make: *** [install] Error 1

the second seems to maybe be with the gcc
(which is 4.5.0)



policy_define.c: In function 'set_types':
policy_define.c:1304: error: offset '3' outside bounds of constant string
policy_define.c:1316: error: offset '3' outside bounds of constant string
policy_define.c:1328: error: offset '3' outside bounds of constant string
policy_define.c: In function 'define_te_avtab_helper':
policy_define.c:1679: error: offset '3' outside bounds of constant string
policy_define.c:1685: error: offset '3' outside bounds of constant string
policy_define.c: In function 'set_roles':
policy_define.c:2024: error: offset '3' outside bounds of constant string
policy_define.c:2030: error: offset '3' outside bounds of constant string
policy_define.c: In function 'set_user_roles':
policy_define.c:2854: error: offset '3' outside bounds of constant string
policy_define.c:2860: error: offset '3' outside bounds of constant string
make[1]: *** [policy_define.o] Error 1
make[1]: Leaving directory `/home/name/LFS/SELinux/selinux/checkpolicy'
make: *** [install] Error 1


I've seen this offset 3 message with different
apps.
(maybe I just need to set the "warnings treated as error"
flag somewhere).

regards,

--
Justin P. Mattock


2009-04-07 19:26:31

by Stephen Smalley

[permalink] [raw]
Subject: [refpolicy] SELinux userpace compile errors

On Tue, 2009-04-07 at 12:17 -0700, Justin Mattock wrote:
> compiling the userspace tools
> I'm receiving some errors:
> (the first is just a simple "make" instead of "sudo make")

The default top-level target is 'install'. So you either need to do it
as root or specify DESTDIR=/path/to/root for a writable tree.

> the second seems to maybe be with the gcc
> (which is 4.5.0)
>
>
>
> policy_define.c: In function 'set_types':
> policy_define.c:1304: error: offset '3' outside bounds of constant string
> policy_define.c:1316: error: offset '3' outside bounds of constant string
> policy_define.c:1328: error: offset '3' outside bounds of constant string

Bug in gcc, already known to gcc folks.

--
Stephen Smalley
National Security Agency

2009-04-07 19:40:57

by Stephen Smalley

[permalink] [raw]
Subject: [refpolicy] SELinux userpace compile errors

On Tue, 2009-04-07 at 15:26 -0400, Stephen Smalley wrote:
> On Tue, 2009-04-07 at 12:17 -0700, Justin Mattock wrote:
> > compiling the userspace tools
> > I'm receiving some errors:
> > (the first is just a simple "make" instead of "sudo make")
>
> The default top-level target is 'install'. So you either need to do it
> as root or specify DESTDIR=/path/to/root for a writable tree.
>
> > the second seems to maybe be with the gcc
> > (which is 4.5.0)
> >
> >
> >
> > policy_define.c: In function 'set_types':
> > policy_define.c:1304: error: offset '3' outside bounds of constant string
> > policy_define.c:1316: error: offset '3' outside bounds of constant string
> > policy_define.c:1328: error: offset '3' outside bounds of constant string
>
> Bug in gcc, already known to gcc folks.

Reference:
http://gcc.gnu.org/ml/gcc-patches/2009-03/msg01645.html

Who knew that strcmp() was so complex?

--
Stephen Smalley
National Security Agency

2009-04-07 19:56:37

by Justin P. Mattock

[permalink] [raw]
Subject: [refpolicy] SELinux userpace compile errors

On Tue, Apr 7, 2009 at 12:40 PM, Stephen Smalley <[email protected]> wrote:
> On Tue, 2009-04-07 at 15:26 -0400, Stephen Smalley wrote:
>> On Tue, 2009-04-07 at 12:17 -0700, Justin Mattock wrote:
>> > compiling the userspace tools
>> > I'm receiving some errors:
>> > (the first is just a simple "make" instead of "sudo make")
>>
>> The default top-level target is 'install'. ?So you either need to do it
>> as root or specify DESTDIR=/path/to/root for a writable tree.
>>
>> > the second seems to maybe be with the gcc
>> > (which is 4.5.0)
>> >
>> >
>> >
>> > policy_define.c: In function 'set_types':
>> > policy_define.c:1304: error: offset '3' outside bounds of constant string
>> > policy_define.c:1316: error: offset '3' outside bounds of constant string
>> > policy_define.c:1328: error: offset '3' outside bounds of constant string
>>
>> Bug in gcc, already known to gcc folks.
>
> Reference:
> http://gcc.gnu.org/ml/gcc-patches/2009-03/msg01645.html
>
> Who knew that strcmp() was so complex?
>
> --
> Stephen Smalley
> National Security Agency
>
>

cool thanks for the url.
(I'll have to recompile gcc)
as for the error itself(as an example)
just compiled libc and noticed
this error(but with libc it was treated as a warning).

in any case as long as people are aware
of the situation.

--
Justin P. Mattock