Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 133375 - xdtv fail to compile on hardened
Summary: xdtv fail to compile on hardened
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-15 05:25 UTC by Alexandre Carsac
Modified: 2006-06-26 01:06 UTC (History)
1 user (show)

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


Attachments
is patch broken ? (3682-xdtv-2.3.2-r1.log,104.09 KB, text/x-log)
2006-06-24 08:35 UTC, Alexandre Carsac
Details
patch 2 (correct race install condition) (a.txt,407 bytes, patch)
2006-06-25 11:33 UTC, Alexandre Carsac
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Carsac 2006-05-15 05:25:43 UTC
Hi, 

I meet the following compilation problem (see below) while emerging version 2.3.2 with hardened. 
I precise that i try with ffmpeg 0.4.9_p20060302 and 0.4.9_p20051216.

---------------------------------------------------------------------------
emerge -av media-tv/xdtvThese are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] media-tv/xdtv-2.3.2  +X -Xaw3d +aac +alsa -aqua_theme -carbone_theme -debug -dvb +encode +ffmpeg +jpeg -linguas_ca -linguas_de -linguas_en -linguas_es -linguas_fr -lin
guas_gl -linguas_it -linguas_ja -linguas_pl -linguas_ru -lirc +mmx +neXt +nls +ogg +png +xinerama +xv +xvid -zvbi 0 kB
....

i686-pc-linux-gnu-gcc -O3 -Wall -Wno-switch -DHAVE_AV_CONFIG_H -I.. -I'../'/libavutil -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE   -c -o msmpeg4.o msmpeg4.c
msmpeg4.c: In function `msmpeg4_encode_dc':
msmpeg4.c:729: error: can't find a register in class `BREG' while reloading `asm'
make[2]: *** [msmpeg4.o] Error 1
make[2]: *** Waiting for unfinished jobs....
h263.c: In function `h263_decode_block':
h263.c:4552: warning: 'level' might be used uninitialized in this function
---------------------------------------------------------------------------

FFMPEG have been added natively to xdtv since version 2.3.1. Version 2.3.0 is threfore not affected, but has been deleted from portage tree. Older stable version like 2.2.0-r1 does not have been patched for PaX and do not compile either : 

---------------------------------------------------------------------------
memcpy.c: In function `sse_copie':
memcpy.c:365: error: PIC register `ebx' clobbered in `asm'
memcpy.c: In function `mmx2_copie':
memcpy.c:503: error: PIC register `ebx' clobbered in `asm'
memcpy.c: In function `mmx_copie':
memcpy.c:641: error: PIC register `ebx' clobbered in `asm'
memcpy.c: In function `fpu_copie':
memcpy.c:773: error: PIC register `ebx' clobbered in `asm'
make[2]: *** [memcpy.o] Error 1
make[2]: *** Waiting for unfinished jobs....
main.c: In function `set_float':
main.c:1439: warning: dereferencing type-punned pointer will break strict-aliasing rule
---------------------------------------------------------------------------

ffmpeg compile fine as a shared library for mplayer, so perhaps the problem is more related on some specific flag to put in the configure script. 

emerge --info
Portage 2.0.54-r2 (hardened/x86/2.6, gcc-3.4.5, glibc-2.3.6-r3, 2.6.14-hardened-r7 i686)
=================================================================
System uname: 2.6.14-hardened-r7 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5, 2.4.2
dev-python/pycrypto: [Not Present]
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
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="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4"
CHOST="i686-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/lib/mozilla/defaults/pref /
usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage//packages/x86/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage/"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 7zip X aac alsa ao apm asf audiofile bash-completion berkdb bitmap-fonts bzip2 crypt cups curl dbus directfb dlloader doc dri dv eds encode esd exif expat fam fbcon fbdev f
fmpeg fftw firefox flac gd gif glut gnome gpm gstreamer gtk gtkhtml hal hardened howl idn imagemagick imlib inkjar java jpeg jpeg2k junit kerberos lcms ldap libvisual libwww mad matro
ska mikmod mime mmx mng mozilla mp3 mpeg multicall nas ncurses network nls nptl nsplugin ogg opengl oss pam pcre perl pic png python quicktime readline real rtc ruby sdl shorten sourc
e speex spell sse ssl tcltk tcpd teamarena tiff truetype udev usb userlocales v4l2 vcd vfat vim-with-x vorbis wifi win32codecs wmf x86 xine xml xml2 xmms xv xvid xvmc yaepg zlib userl
and_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS
Comment 1 Alexandre Carsac 2006-05-15 08:21:04 UTC
(In reply to comment #0)
It compiles when i disable ffmpeg USE flag.
Comment 2 Alexandre Carsac 2006-06-23 13:59:56 UTC
The problem seems to be in the ebuild. I succeded to compile by :
1) disabling mmx use flag and enabling ffmpeg use flag.
2) cd to the unpacked and patched source in /var/tmp/portage/xdtv-2.3.2/work/xdtv-2.3.2.
3) do edit by hand ./config.mak by appending "-DPIC" in OPTFLAGS.

i am not a specialist of ebuild. i try to patch the ebuild with econf and append-flag without any success.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-06-23 15:24:25 UTC
Thanks for the suggestion, I think now I have an idea of what the problem is :)

Basically, FFmpeg uses PIC definition for PIC handling, and we already work that around in xine-lib and ffmpeg proper by replacing it with __PIC__ (compiler generated). I'm now trying to build it with that enabled, and I'll see the result, if tomorrow you can sync, check if there's a related comment in the ChangeLog, and tell me if it works, it will be appreciated :)
Comment 4 Alexandre Carsac 2006-06-24 08:35:36 UTC
Created attachment 90033 [details]
is patch broken ?

Thanks for your patch, it seem to solve compilation problem but i encounter another perhaps masked by the compilation problem :

The ebuild fail to do the make install part, as you can see in the attachment.

Hope it help. i will look tommorrow if i can can explain what's going on.
Comment 5 Alexandre Carsac 2006-06-25 11:33:12 UTC
Created attachment 90130 [details, diff]
patch 2 (correct race install condition)

It seems there is a race condition with emake when trying to do a chmod on some file (see attachement "is patch broken ?") while not there yet (but would be too late).

So pragmaticaly, i succeded to emerge by modifing the ebuild and turn emake back into make for the src_install part. 

i give the diff file for the new ebuild in "patch 2" attachement.

I think this is not the best way to correct the problem, but while waiting for best solution, i provide this one.
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-06-26 01:06:01 UTC
Uh no, that is not a fix at all :) I'll see to fix it in the proper way, in the mean time this specific bug can be considered closed.