From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from skinny.southernlinux.net (ns2.rednecks.net [64.192.52.5])
	by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j4THisAx024069
	for <gentoo-hardened@lists.gentoo.org>; Sun, 29 May 2005 17:44:55 GMT
Received: (qmail 4749 invoked by uid 210); 29 May 2005 13:43:05 -0400
Received: from 10.10.10.188 by skinny (envelope-from <solar@gentoo.org>, uid 201) with qmail-scanner-1.25st 
 (clamdscan: 0.82/898. f-prot: 4.4.2/3.14.11. spamassassin: 3.0.2. perlscan: 1.25st.  
 Clear:RC:1(10.10.10.188):. 
 Processed in 0.391929 secs); 29 May 2005 17:43:05 -0000
Received: from unknown (HELO ?10.10.10.188?) (10.10.10.188)
  by 0 with SMTP; 29 May 2005 13:43:04 -0400
Subject: Re: [gentoo-hardened] removing .text relocations from mplayer and
	xine-lib
From: Ned Ludd <solar@gentoo.org>
To: gentoo-hardened@lists.gentoo.org
In-Reply-To: <35572ca8050529082739b7c9f5@mail.gmail.com>
References: <35572ca8050529082739b7c9f5@mail.gmail.com>
Content-Type: multipart/mixed; boundary="=-ILpreVqqy0lrWnyP5V5V"
Date: Sun, 29 May 2005 13:24:50 -0400
Message-Id: <1117387490.8036.18.camel@localhost>
Precedence: bulk
List-Post: <mailto:gentoo-hardened@lists.gentoo.org>
List-Help: <mailto:gentoo-hardened+help@gentoo.org>
List-Unsubscribe: <mailto:gentoo-hardened+unsubscribe@gentoo.org>
List-Subscribe: <mailto:gentoo-hardened+subscribe@gentoo.org>
List-Id: Gentoo Linux mail <gentoo-hardened.gentoo.org>
X-BeenThere: gentoo-hardened@gentoo.org
Reply-to: gentoo-hardened@lists.gentoo.org
Mime-Version: 1.0
X-Mailer: Evolution 2.2.1.1 
X-Archives-Salt: 6dba6c12-82c0-4055-90dd-69d899f044ad
X-Archives-Hash: e18aec11054fe42cf02bf0289d3cf0fc


--=-ILpreVqqy0lrWnyP5V5V
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

On Sun, 2005-05-29 at 11:27 -0400, Ren� Rh�aume wrote:
> Where is the patch that removes .text relocations from mplayer and
> xine-lib? Solar said on IRC that was one lying around somewhere. I
> searched on Gentoo Bugzilla and on the Web with Google and I did not
> find it.

I could not find where I put it and your the second person to
ask/request it today so I did another. 

See attached untested patch for mplayer..

It may be easier to just have them do 
#if (defined (__PIC__) && !defined(PIC))
# define PIC __PIC__
#endif

> Why? This is what I get from /usr/bin/xine (part of xine-ui)
> This is xine (X11 gui) - a free video player v0.99.3.
> (c) 2000-2004 The xine Team.
> Can't modify /usr/lib/xine/plugins/1.0.0/post/xineplug_post_planar.so's 
> text section. Use GCC option -fPIC for shared objects, please.
> 
> Hmm, there is already a PIC patch applied to xine-lib.

It's probably not complete like mplayer was not. 


-- 
Ned Ludd <solar@gentoo.org>

--=-ILpreVqqy0lrWnyP5V5V
Content-Disposition: inline; filename=MPlayer-1.0pre7-more-pic-updates.patch
Content-Type: text/x-patch; name=MPlayer-1.0pre7-more-pic-updates.patch; charset=us-ascii
Content-Transfer-Encoding: 7bit

diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/common.h MPlayer-1.0pre7/libavcodec/common.h
--- MPlayer-1.0pre7.unpacked/libavcodec/common.h	2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/common.h	2005-05-29 13:05:40.000000000 -0400
@@ -219,13 +219,13 @@ static inline float floorf(float f) { 
 // Use rip-relative addressing if compiling PIC code on x86-64.
 #    if defined(__MINGW32__) || defined(__CYGWIN__) || \
         defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__))
-#        if defined(ARCH_X86_64) && defined(PIC)
+#        if defined(ARCH_X86_64) && defined(__PIC__)
 #            define MANGLE(a) "_" #a"(%%rip)"
 #        else
 #            define MANGLE(a) "_" #a
 #        endif
 #    else
-#        if defined(ARCH_X86_64) && defined(PIC)
+#        if defined(ARCH_X86_64) && defined(__PIC__)
 #            define MANGLE(a) #a"(%%rip)"
 #        else
 #            define MANGLE(a) #a
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx.c MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx.c
--- MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx.c	2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx.c	2005-05-29 13:01:39.000000000 -0400
@@ -59,7 +59,7 @@ static const uint64_t ff_pb_FC attribute
     "pcmpeqd %%" #regd ", %%" #regd " \n\t"\
     "paddb %%" #regd ", %%" #regd " \n\t" ::)
 
-#ifndef PIC
+#ifndef __PIC__
 #define MOVQ_BONE(regd)  __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_bone))
 #define MOVQ_WTWO(regd)  __asm __volatile ("movq %0, %%" #regd " \n\t" ::"m"(mm_wtwo))
 #else
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx_avg.h MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx_avg.h
--- MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx_avg.h	2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx_avg.h	2005-05-29 13:15:32.000000000 -0400
@@ -90,7 +90,7 @@ static void DEF(put_pixels4_l2)(uint8_t 
 	"add	$16, %2			\n\t"
 	"subl	$4, %0			\n\t"
 	"jnz	1b			\n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
 	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
 #else
 	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -137,7 +137,7 @@ static void DEF(put_pixels8_l2)(uint8_t 
 	"add	$32, %2			\n\t"
 	"subl	$4, %0			\n\t"
 	"jnz	1b			\n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
 	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
 #else
 	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -207,7 +207,7 @@ static void DEF(put_no_rnd_pixels8_l2)(u
 	"add	$32, %2			\n\t"
 	"subl	$4, %0			\n\t"
 	"jnz	1b			\n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
 	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
 #else
 	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -262,7 +262,7 @@ static void DEF(avg_pixels4_l2)(uint8_t 
 	"add	$16, %2			\n\t"
 	"subl	$4, %0			\n\t"
 	"jnz	1b			\n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
 	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
 #else
 	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -314,7 +314,7 @@ static void DEF(avg_pixels8_l2)(uint8_t 
 	"add	$32, %2			\n\t"
 	"subl	$4, %0			\n\t"
 	"jnz	1b			\n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
 	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
 #else
 	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -402,7 +402,7 @@ static void DEF(put_pixels16_l2)(uint8_t
 	"add	$32, %2			\n\t"
 	"subl	$2, %0			\n\t"
 	"jnz	1b			\n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
 	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
 #else
 	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -456,7 +456,7 @@ static void DEF(avg_pixels16_l2)(uint8_t
 	"add	$32, %2			\n\t"
 	"subl	$2, %0			\n\t"
 	"jnz	1b			\n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
 	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
 #else
 	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -529,7 +529,7 @@ static void DEF(put_no_rnd_pixels16_l2)(
 	"add	$32, %2			\n\t"
 	"subl	$2, %0			\n\t"
 	"jnz	1b			\n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
 	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
 #else
 	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx_rnd.h MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx_rnd.h
--- MPlayer-1.0pre7.unpacked/libavcodec/i386/dsputil_mmx_rnd.h	2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/i386/dsputil_mmx_rnd.h	2005-05-29 13:01:00.000000000 -0400
@@ -96,7 +96,7 @@ static void DEF(put, pixels8_l2)(uint8_t
 	"add	%5, %3			\n\t"
 	"subl	$4, %0			\n\t"
 	"jnz	1b			\n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
         :"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
 #else
         :"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
@@ -191,7 +191,7 @@ static void DEF(put, pixels16_l2)(uint8_
 	"add	$32, %2			\n\t"
 	"subl	$2, %0			\n\t"
 	"jnz	1b			\n\t"
-#ifdef PIC //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
+#ifdef __PIC__ //Note "+bm" and "+mb" are buggy too (with gcc 3.2.2 at least) and cant be used
 	:"+m"(h), "+a"(src1), "+c"(src2), "+d"(dst)
 #else
 	:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/libpostproc/mangle.h MPlayer-1.0pre7/libavcodec/libpostproc/mangle.h
--- MPlayer-1.0pre7.unpacked/libavcodec/libpostproc/mangle.h	2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/libpostproc/mangle.h	2005-05-29 13:05:40.000000000 -0400
@@ -11,13 +11,13 @@
 /* Use rip-relative addressing if compiling PIC code on x86-64. */
 #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || \
    (defined(__OpenBSD__) && !defined(__ELF__))
-#if defined(ARCH_X86_64) && defined(PIC)
+#if defined(ARCH_X86_64) && defined(__PIC__)
 #define MANGLE(a) "_" #a"(%%rip)"
 #else
 #define MANGLE(a) "_" #a
 #endif
 #else
-#if defined(ARCH_X86_64) && defined(PIC)
+#if defined(ARCH_X86_64) && defined(__PIC__)
 #define MANGLE(a) #a"(%%rip)"
 #else
 #define MANGLE(a) #a
diff -Nrup MPlayer-1.0pre7.unpacked/libavcodec/msmpeg4.c MPlayer-1.0pre7/libavcodec/msmpeg4.c
--- MPlayer-1.0pre7.unpacked/libavcodec/msmpeg4.c	2005-04-16 16:41:13.000000000 -0400
+++ MPlayer-1.0pre7/libavcodec/msmpeg4.c	2005-05-29 12:55:56.000000000 -0400
@@ -723,7 +723,7 @@ static inline int msmpeg4_pred_dc(MpegEn
        necessitate to modify mpegvideo.c. The problem comes from the
        fact they decided to store the quantized DC (which would lead
        to problems if Q could vary !) */
-#if (defined(ARCH_X86) || defined(ARCH_X86_64)) && !defined PIC
+#if (defined(ARCH_X86) || defined(ARCH_X86_64)) && !defined __PIC__
     asm volatile(
         "movl %3, %%eax		\n\t"
 	"shrl $1, %%eax		\n\t"

--=-ILpreVqqy0lrWnyP5V5V--

-- 
gentoo-hardened@gentoo.org mailing list