Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 119271 - libselinux-1.28 does not compile
Summary: libselinux-1.28 does not compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Chris PeBenito (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-17 02:56 UTC by Paolo Pedroni
Modified: 2006-04-28 07:29 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 Paolo Pedroni 2006-01-17 02:56:43 UTC
libselinux-1.28 fails compilation on my AMD64 X2 4600+ system, yielding the following error:

cc  -shared -o libselinux.so.1 avc.lo avc_internal.lo avc_sidtab.lo booleans.lo canonicalize_context.lo checkAccess.lo check_context.lo compute_av.lo compute_create.lo compute_member.lo compute_relabel.lo compute_user.lo context.lo disable.lo enabled.lo fgetfilecon.lo freeconary.lo freecon.lo fsetfilecon.lo getcon.lo get_context_list.lo get_default_type.lo getenforce.lo getexeccon.lo getfilecon.lo getfscreatecon.lo getpeercon.lo getpidcon.lo getprevcon.lo init.lo is_customizable_type.lo lgetfilecon.lo load_policy.lo lsetfilecon.lo matchmediacon.lo matchpathcon.lo policyvers.lo query_user_context.lo rpm.lo selinux_config.lo setcon.lo setenforce.lo setexeccon.lo setfilecon.lo setfscreatecon.lo seusers.lo trans.lo -ldl -lsepol -L/usr/lib64 -Wl,-soname,libselinux.so.1,-z,defs
cc  -shared -o _selinux.so selinuxswig_wrap.lo -L. -lselinux -L/usr/lib64 -Wl,-soname,_selinux.so
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: ./libselinux.a(booleans.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
./libselinux.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
distcc[21656] ERROR: compile (null) on localhost failed
make[1]: *** [_selinux.so] Error 1
make[1]: *** Waiting for unfinished jobs....
ln -sf libselinux.so.1 libselinux.so
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/libselinux-1.28/work/libselinux-1.28/src'
make: *** [all] Error 2

My "emerge --info" output is as follows:

Portage 2.0.53 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r5 x86_64)
=================================================================
System uname: 2.6.14-gentoo-r5 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
Gentoo Base System version 1.6.14
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O3 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k8 -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distcc distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.switch.ch/mirror/gentoo/ http://pandemonium.tiscali.de/pub/gentoo/ http://gentoo.ngi.it http://gentoo.intergenia.de http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://linuv.uv.es/mirror/gentoo/ http://ftp.ntua.gr/pub/linux/gentoo/"
LANG="it_IT.UTF-8"
LC_ALL="it_IT.UTF-8"
LINGUAS="it"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="amd64 X Xaw3d aalib acpi alsa arts audiofile avi bash-completion berkdb bitmap-fonts bzip2 caps cdparanoia cdr crypt cups curl dbus dio dri dvd dvdr dvdread emboss emul-linux-x86 encode exif expat fam fbcon ffmpeg fftw flac foomaticdb fortran ftp gcj gd gif glut gmp gnutls gphoto2 gpm gstreamer gtk2 hal iconv idn ieee1394 imagemagick java javascript jpeg kde kdeenablefinal lcms libcaca lm_sensors lzw lzw-tiff mad maildir matroska memlimit mime mmap mng mozilla mp3 mpeg mpi ncurses nls nptl nsplugin offensive ogg openal opengl oss pam pcre pdflib perl png posix ppds python qt quicktime readline recode samba sasl scanner sdl sharedmem shorten slang sndfile sockets sox speex spell ssl svg symlink sysvipc tcpd threads tidy tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales vcd vorbis wmf xine xml2 xosd xpm xv xvid zlib linguas_it userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS, PORTDIR_OVERLAY
Comment 1 Paolo Pedroni 2006-01-18 04:15:42 UTC
By the way... libselinux-1.24 compiled just fine.
Comment 2 Paolo Pedroni 2006-01-18 04:24:55 UTC
Hmmm... I tried with:
# FEATURES="-distcc" emerge -1 libselinux

and it worked. This is kind of strange because I have emerged distcc but not yet enabled it (since I don't have any other nodes available yet). I might suggest to filter the distcc feature for the time being, anyway.
Comment 3 Christopher Mire 2006-01-20 23:14:16 UTC
I recieved the same error as Chris PeBenit, 1.24 had compiled fine for me also.

/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: ./libselinux.a(booleans.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
./libselinux.a: could not read symbols: Bad value

Portage 2.0.54 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r5 x86_64)
=================================================================
System uname: 2.6.14-gentoo-r5 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=athlon64 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib64/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -march=athlon64 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/ ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ ftp://gentoo.mirrors.pair.com/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="amd64 X acpi aim alsa audiofile avi bash-completion berkdb bitmap-fonts browserplugin bzip2 cairo cdr crypt cups curl doc dvd dvdr eds emacs emboss emul-linux-x86 encode esd examples exif expat fam foomaticdb fortran ftp gd gdbm gif glitz glut gnome gpm gstreamer gtk gtk2 gtkhtml hal idn ieee1394 imagemagick imlib ipv6 java javascript jpeg kde lcms libwww lm_sensors lzw lzw-tiff mng mozilla mp3 mpeg ncurses nls nsplugin openal opengl pam pdf pdflib perl png posix python qt quicktime readline samba sdl sharedmem sockets spell ssl svg tcltk tcpd tetex threads tiff truetype truetype-fonts type1-fonts udev usb userlocales xml2 xmms xpm xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

Comment 4 Igor Alekseev 2006-01-28 14:01:06 UTC
libselinux-1.28 fails compilation on my system

# emerge --info
Portage 2.0.54 (selinux/2005.1/x86/hardened, gcc-3.4.4, glibc-2.3.5-r2, 2.6.11-hardened-r15-selinux i686)
=================================================================
System uname: 2.6.11-hardened-r15-selinux i686 Intel(R) Celeron(TM) CPU                1300MHz
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  [Not Present]
sys-devel/automake:  [Not Present]
sys-devel/binutils:  2.16.1
sys-devel/libtool:   [Not Present]
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-mcpu=i686 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-mcpu=i686 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox selinux sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="berkdb bzip2 chroot crypt dlloader hardened ncurses nls nptl nptlonly pam pam_chroot pam_console pam_timestamp pic python readline selinux sftplogging slang ssl unicode userlocales x86 zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

# emerge libselinux
...
make[1]: Entering directory `/var/tmp/portage/libselinux-1.28/work/libselinux-1.28/src'
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o avc.o avc.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o avc_internal.o avc_internal.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o avc_sidtab.o avc_sidtab.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o booleans.o booleans.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o canonicalize_context.o canonicalize_context.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o checkAccess.o checkAccess.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o check_context.o check_context.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o compute_av.o compute_av.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o compute_create.o compute_create.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o compute_member.o compute_member.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o compute_relabel.o compute_relabel.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o compute_user.o compute_user.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
cc -O2 -mcpu=i686 -pipe -I../include -I/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -c -o context.o context.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
...
...
selinuxswig_wrap.c:3359: error: `PyExc_TypeError' undeclared (first use in this function)
selinuxswig_wrap.c:3363: error: `o' undeclared (first use in this function)
selinuxswig_wrap.c:3372: error: `PyExc_SystemError' undeclared (first use in this function)
selinuxswig_wrap.c:3376: error: `name' undeclared (first use in this function)
selinuxswig_wrap.c: In function `SWIG_Python_SetTypeListHandle':
selinuxswig_wrap.c:3385: error: syntax error before "swig_empty_runtime_method_table"
selinuxswig_wrap.c: At top level:
selinuxswig_wrap.c:3391: error: parse error before '*' token
selinuxswig_wrap.c:3392: error: `swig_empty_runtime_method_table' undeclared here (not in a function)
selinuxswig_wrap.c:3392: warning: initialization makes pointer from integer without a cast
selinuxswig_wrap.c:3392: error: initializer element is not constant
selinuxswig_wrap.c:3392: warning: data definition has no type or storage class
selinuxswig_wrap.c:3393: error: parse error before '*' token
selinuxswig_wrap.c:3393: error: `type_list_handle' undeclared here (not in a function)
selinuxswig_wrap.c:3393: warning: initialization makes pointer from integer without a cast
selinuxswig_wrap.c:3393: error: initializer element is not constant
selinuxswig_wrap.c:3393: warning: data definition has no type or storage class
selinuxswig_wrap.c:3394: error: parse error before "if"
selinuxswig_wrap.c: In function `init_selinux':
selinuxswig_wrap.c:3433: error: syntax error before '*' token
selinuxswig_wrap.c:3435: error: `PyObject' undeclared (first use in this function)
selinuxswig_wrap.c:3435: error: `m' undeclared (first use in this function)
selinuxswig_wrap.c:3435: error: `d' undeclared (first use in this function)
selinuxswig_wrap.c:3437: error: `SWIG_globals' undeclared (first use in this function)
make[1]: *** [selinuxswig_wrap.lo] Error 1
make[1]: Leaving directory `/var/tmp/portage/libselinux-1.28/work/libselinux-1.28/src'
make: *** [all] Error 2

!!! ERROR: sys-libs/libselinux-1.28 failed.
!!! Function src_compile, Line 38, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.
Comment 5 Chris PeBenito (RETIRED) gentoo-dev 2006-01-28 22:14:01 UTC
Igor, do you have dev-lang/swig installed?  If not can you merge it and then try again?
Comment 6 Igor Alekseev 2006-01-29 01:52:49 UTC
(In reply to comment #5)
> Igor, do you have dev-lang/swig installed?  If not can you merge it and then
> try again?
> 
Chris, I emerged dev-lang/swig, but I have this problem also. 
Comment 7 Chris PeBenito (RETIRED) gentoo-dev 2006-01-29 08:55:52 UTC
Igor, does that mean that it gets past your problem and now hits this bug, or do you still get the selinuxswig_wrap.c errors?
Comment 8 Ed Wildgoose 2006-01-29 09:53:06 UTC
Igor, I suspect that your bug is the same one that I have just posted some details on:
http://bugs.gentoo.org/show_bug.cgi?id=120829

If so then you failed to post the important first error message which highlights that the problem is in a hardcoded Python path

Please check that you don't have Python 2.4 and if not then upgrade to Python 2.4 and see if your problem goes away.  I don't think the Igor's problem (and my problem) are related to the original posters issue (I am on intel 32bit for a start)
Comment 9 Chris PeBenito (RETIRED) gentoo-dev 2006-01-29 12:03:42 UTC
I updated the ebuild, the python version handling should now be fixed, to fix Igor's problem.  I added -fPIC to LDFLAGS, which should fix the originally reported problem.  Please test.
Comment 10 Igor Alekseev 2006-01-29 20:59:44 UTC
(In reply to comment #9)
> I updated the ebuild, the python version handling should now be fixed, to fix
> Igor's problem.  I added -fPIC to LDFLAGS, which should fix the originally
> reported problem.  Please test.
> 
Thank you, I compiled libselinux successfully, but warnings "
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead." remained.
Comment 11 Chris PeBenito (RETIRED) gentoo-dev 2006-04-28 07:29:45 UTC
closing.  your "-mcpu= is deprecated" just means you have to change your cflags "-mcpu=i686" to "-mtune=i686".  Its not libselinux specific, its just something with newer gccs.