[MPlayer-dev-eng] [PATCH] Fix MPlayer to compile on Darwin/x86_64

Guillaume POIRIER poirierg at gmail.com
Sun Jun 7 00:34:50 CEST 2009


Hello,

On Sat, Jun 6, 2009 at 5:59 PM, Diego Biurrun <diego at biurrun.de> wrote:

> On Sat, Jun 06, 2009 at 02:57:33PM +0200, Guillaume POIRIER wrote:
> >
> > --- mangle.h  (revision 29344)
> > +++ mangle.h  (working copy)
> > @@ -31,6 +31,14 @@
> >
> > +/* Use rip-relative addressing if compiling PIC code (or code for
> Darwin)
> > + on x86-64. */
> > +#if ARCH_X86_64 && (defined(PIC) || defined(__APPLE__))
> > +#    define LOCAL_MANGLE(a) #a "(%%rip)"
> > +#else
> > +#    define LOCAL_MANGLE(a) #a
> > +#endif
>
> I wonder why you need to check for __APPLE__,


I need it because I need to detect that this file is compiled on a Darwin
OS, and __APPLE__ define is a define that is provided by the compiler.
Now, why I'm making MANGLE behave as PIC in x86_64 mode is described in the
document which I gave a link to earlier:
http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/1-Articles/x86_64_code.html
This is the relevant sentence: "It’s most similar to the small PIC model
defined by the x86-64 System V ABI."



> but libavutil/internal.h
> does not need it...
>

Why do you say that? I need the same change there too:Index:
libavutil/internal.h
===================================================================
--- libavutil/internal.h (revision 19076)
+++ libavutil/internal.h (working copy)
@@ -103,7 +103,7 @@
 #define LABEL_MANGLE(a) EXTERN_PREFIX #a

 // Use rip-relative addressing if compiling PIC code on x86-64.
-#if ARCH_X86_64 && defined(PIC)
+#if ARCH_X86_64 && (defined(PIC) || defined(__APPLE__))
 #    define LOCAL_MANGLE(a) #a "(%%rip)"
 #else
 #    define LOCAL_MANGLE(a) #a


It's just that this change doesn't belong to MPlayer's mailing list...
unless I missed something?

Cheers,

Guillaume

-- 
Only a very small fraction of our DNA does anything; the rest is all
comments and ifdefs.

Steven Wright<http://www.brainyquote.com/quotes/authors/s/steven_wright.html>
- "It's a small world, but I wouldn't want to have to paint it."



More information about the MPlayer-dev-eng mailing list