[MPlayer-dev-eng] [PATCH] detect PIC and set -DPIC in YASMFLAGS

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Nov 8 16:40:14 CET 2009


On Sun, Nov 08, 2009 at 02:54:08PM +0100, Diego Biurrun wrote:
> On Sun, Nov 08, 2009 at 09:17:31AM +0100, Reimar Döffinger wrote:
> > On Sun, Nov 08, 2009 at 09:02:27AM +0100, Reimar Döffinger wrote:
> > > On Sun, Nov 08, 2009 at 05:03:02AM +0100, Diego Biurrun wrote:
> > > > On Sun, Nov 08, 2009 at 12:47:36AM +0100, Reimar Döffinger wrote:
> > > > > this is necessary to compile with YASM enabled on amd64 systems that
> > > > > have PIC/PIE enabled by default, e.g. hardened Gentoo.
> > > > > --- configure   (revision 29850)
> > > > > +++ configure   (working copy)
> > > > > @@ -2580,6 +2580,20 @@
> > > > >  
> > > > > +echocheck "PIC"
> > > > > +pic=no
> > > > > +cat > $TMPC << EOF
> > > > > +int main(void) {
> > > > > +#if defined(__PIC__) || defined(__pic__) || defined(PIC)
> > > > > +    return 0;
> > > > > +#else
> > > > > +    error please!
> > > > 
> > > > ?
> > > 
> > > I thought it was obvious that it was supposed to make the compiler
> > > error out.
> > > Yes, for gcc #error works, but I think it is not part of the standard.
> > 
> > A variant more in line with other code (e.g. the kernel header version
> > check):
> > --- configure   (revision 29850)
> > +++ configure   (working copy)
> > @@ -2580,6 +2580,21 @@
> >  
> > +echocheck "PIC"
> > +pic=no
> > +cat > $TMPC << EOF
> > +int main(void) {
> > +#if defined(__PIC__) || defined(__pic__) || defined(PIC)
> > +    return 0;
> > +#else
> > +#error PIC not enabled
> > +    not_pic_code();
> 
> not_pic_code()?

Copied from some kernel header check. I guess it's time to remove some
cruft that gives the wrong idea.
I applied it with some "cleanup", hope it's still ok.



More information about the MPlayer-dev-eng mailing list